Welcome to Cockpitbuilders.com. Please login or sign up.

March 28, 2024, 07:41:21 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
114 Guests, 0 Users
Members
Stats
  • Total Posts: 59,639
  • Total Topics: 7,853
  • Online today: 142
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 114
Total: 114

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

Recomendations for gauge servos

Started by Jørgen B. Nielsen, December 06, 2021, 10:18:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jørgen B. Nielsen

My next project is to design and manufacture all the gauges for my 737 NG simulator. My plan is to make the first revision using servos. What are the experience regarding servo selection. My initial guess is that a digital servo will perform better with regards to smoothness of movment. Are there any recommendations regarding specific servos to use.

I'm fully aware that steppers are preferable, however my diy IO card is set up for servos. Steppers is planned for a future project

RayS

I tried the servo route.... you'll need micro servos but the smaller the servo, the less resolution it will have which translates to jitter.

Another drawback is that most servos only have a 90-degree deflection, requiring some sort of gearing to drive the needles. Of course a 90-degree servo driving a needle that requires 300+ degrees of deflection will have a tendency to visibly amplify any stuttering or jitter.

If at all possible, go the Stepper route. You'll find it much less frustrating.
Ray Sotkiewicz

ame

I concur, and the hardest part is dealing with the limited travel of the servo and matching it to the gauge travel, plus each servo is ever-so-slightly not the same.

I designed a way to build 60mm gauges with speedo steppers here:
https://www.cockpitbuilders.com/index.php?topic=7836.msg56161#msg56161

Jørgen B. Nielsen

Thanks for the feedback. I'm currently in the process of moving away from the idea of using servos and go steppers in the first iteration. My IO card has a adafruit pca9685 16-channel servo driver board attached which I planned to drive the servos directly. However, my current plan is to send the PWM signal to a microcontroller and have the microcontroller control the stepper using the PWM signal data for setpoint information.

RayS

Quote from: Jørgen B. Nielsen on December 07, 2021, 09:39:03 AMmy current plan is to send the PWM signal to a microcontroller and have the microcontroller control the stepper using the PWM signal data for setpoint information.

Have to say... that's a really creative solution. Keep us informed on your success!
Ray Sotkiewicz

KyleH

Quote from: Jørgen B. Nielsen on December 07, 2021, 09:39:03 AMThanks for the feedback. I'm currently in the process of moving away from the idea of using servos and go steppers in the first iteration. My IO card has a adafruit pca9685 16-channel servo driver board attached which I planned to drive the servos directly. However, my current plan is to send the PWM signal to a microcontroller and have the microcontroller control the stepper using the PWM signal data for setpoint information.

If your going to do that, why not just send the digital data directly to the microcontroller rather than doing the PWM conversions?
Kyle

Chief Pilot
Worldflight Team USA
http://www.worldflightusa.com

Jørgen B. Nielsen

#6
Quote from: KyleH on December 07, 2021, 02:17:07 PMIf your going to do that, why not just send the digital data directly to the microcontroller rather than doing the PWM conversions?

The reason for contemplating using the PWM conversion is that my current setup uses five IO cards for all switches, leds, pots, 7 segment displays and relays. The IO card is running diy micropython code, with a looptime of 10 ms. The IO card is not design to control steppers, and I think the loop time is to long for stepper motor control. Communication between the IO cards and the simulator PC is over TCP/IP. My goal has been to avoid using usb connections except for flight controls as I have read that there seems to be issues with to many usb connections. Cable routing will also be simpler as the IO cards are all located close to where the gauges are, one in the MIP, one in the FWD OVHD, one in the AFT OVHD and two in the in pedestal. It also simplifies the interface on the computer side as everything will go through SIOC.

KyleH

That makes sense now I've re-read your original post. The first time I read through it I mistook adafruit for an arduino that everyone seems to be using.  :-[ 
Kyle

Chief Pilot
Worldflight Team USA
http://www.worldflightusa.com

ame

You could probably use your I/O cards, especially if you have written your own code and you can modify it.

The X27-168 steppers can be driven directly from microcontroller I/Os, so they can probably be wired straight up to your board. Four I/Os are required. The motors have a range of 315°, and a resolution of three steps per degree. If your loop time is 10ms and you can only send one stepper pulse per loop then it would take 315 x 3 x 0.01 = 9.45 seconds to traverse the whole range, which is a bit leisurely. If you could have a task that was interleaved with the 10ms loop and could generate pulses every millisecond or two then that would be responsive enough.

I'm very interested in your ideas to distribute data around the cockpit. I started something similar but decided to use a Raspberry Pi running Python to do all the work, and distribute control data via i2c. There are i2c modules for driving LEDs, reading switches, reading analog inputs, driving servos, and just plain old GPIO. The Pi would do the thinking and the modules would drive the hardware.

Jørgen B. Nielsen

My approach is quite similar to yours. However, I have chosen to use a Nucleo F767ZI development board instead of a PI. I have designed a large breakout board with IC modules for controlling 112 leds (DM13A), 56 7-segment displays (MAX7221), 24 pots (MCP3208), 32 gpio pins which can be used to read up to 16 rotary encoders and a diode key matrix capable of reading 256 switches (MCP21S17). I'm using SPI for communication as the nucleo board has a lot of pins which can be used for chip select (CS). Thereby i do not have to worry about running out of address space for the I2C ICs. I did have to used I2C for for the servo breakout board. For additional capabilites I have also added an IC that allows for off board I2C communication, however this is currently unused. For communication with the computer I'm using TCP/IP. I'm thereby able to control the whole cockpit using only five ethernet cables.

The board is programmed using micropython which is much slower than C, however I'm somewhat familiar with python which makes micropython "easy" to use. It is also very easy to prototyp, test and debug as you have access to a python console when connecting to the MCU

For controlling the gauges one option is to rewrite the current code to allow faster stepping, and I have an idea of how to do it. I'm however not to tempted, as it will require a lot of time and programming effort to complete. In addition I do not have the required pinout readily available on the breakout board, which makes it cumbersome. That is why I thought of using the PWM signal which will only require a few lines of code to implement and some cheap arduino nano boards.

At what voltage range do the X27-168 operate? Are there stepper libraries that allows driving the stepper directly instead of using a stepper driver such as the "easy driver"

ame

The X27-168 steppers run at nominally 5V. They are so puny that you can drive them directly from a GPIO, no buffer or back-EMF diode needed.

There is a popular library called Gaugette, but it's simple enough to write your own.

At startup you run the stepper all the way to one end of travel, and it hits an end stop. You can step it against the stop as much as you like without damage. Now you know that the stepper is at a known position. Next, just keep track of the steps and do whatever you need to map the stepper position to your input variable.

There are also dual-stepper concentric needle versions, and continuous rotation models. The continuous rotation models are rare, so it's easier to open the housing and cut off the stopping peg.

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate