PDA

View Full Version : RC Servos in Simulated Instruments



Mike.Powell
05-01-2008, 03:32 PM
Steam-gauge style instruments used in hobby flight simulators are generally based on air-core movements, RC servos, or stepping motors. This tutorial is an overview of RC servos.


RC servos are rotary actuators used in the radio controlled car/airplane/boat/robot/etc. hobbies. They come in a variety of sizes, capabilities, and price ranges. A standard-size, standard-performance servo, like the Tower Hobbies TS-53 pictured below, retails for about $10US on line.


http://www.mikesflightdeck.com/images/rcservo2.jpg

RC servos are appealing because they offer conveniently packaged, easily controlled torque. For your $10 you get a little plastic box with wires on one end and an output shaft on the other. Put 5 volts and a control pulse on the wires, and the output shaft will position itself somewhere between 0 and 180 degrees. The shaft turns with enough torque to rotate large flight instrument indicators. Look inside some of the Simkits instruments and youíll find RC servos.

Look inside an RC servo and youíll find something that looks like this.

http://www.mikesflightdeck.com/images/rcservo1.jpg

A small electric motor turns an output shaft through a reduction gear train. The servo output shaft will turn slower than the motor, but will have greater torque. The dark gray cylinder on the back end of the output shaft is a position-sensing potentiometer. Itís wired to the invisible electronics on the green circuit board, as is the motor (using invisible wires, of course).


The electronics provides power to the motor depending upon the width of the control pulse and the orientation of the shaft. For example, a pulse width of 1.5 milliseconds commands the electronics to position the shaft near the 90 degree position. If the potentiometer ďtellsĒ the electronics the shaft is not at 90 degrees, the electronics spins the motor in the direction needed to properly orient the shaft. Pulse widths vary from 1 to 2 milliseconds to position the shaft position at 0 to 180 degrees, respectively. The servo expects to see a pulse every 50 milliseconds or it will automatically turn to its neutral position.


The neat thing is that you donít have to worry about whatís going on inside. Remember, an RC servo is just a well behaved box of available torque that does what itís told.


RC servos are very easy to control, very easy to interface to a PC. If youíre a do-it-yourselfer itís a two chip exercise to interface one to the serial com port. One chip is a data transceiver, the other is a microcontroller. Actually, a single micro controller can interface a whole crowd of RC servos. It only takes a single output pin from the micro controller for each servo, and some micro controllers have lots of pins. If you prefer to use ready-made electronics, you have several options, Beta innovations (www.betainnovations.com (http://www.betainnovations.com)), Open Cockpits (www.opencockpits.com (http://www.opencockpits.com)), and Phidgets (www.phidgets.com (http://www.phidgets.com)) among them.


You can buy RC servos at your local hobby shop, but youíll almost certainly pay less to on line vendor like Tower Hobbies (www.towerhobbies.com (http://www.towerhobbies.com/)), ServoCity (www.servocity.com (http://www.servocity.com/)), and people selling on Ebay. RC servos are generally packaged with one or more removable control horns, the X-shaped piece in the upper most picture. There are a variety of control horns types. Generally one or more of them can be adapted to your project. Sometimes, however, youíll find yourself contemplating a project that cries out for gearing. If so, youíll be happy to know that ServoCity also sells gears specifically designed to mount on RC Servos.


RC servos have a designed-in ďdead zoneĒ. This reduces power use and wear on the servo by not supplying power to the motor until the input has changed by some minimum amount. The result is that the output shaft tends to move in small discrete steps. This is generally not noticeable, though if you used gears to provide a full 360 degree movement of a long instrument pointer, you probably would.


An RC servo can be used as a single pointer gauge simply by putting a pointer on its shaft. With a few plastic gears (Serv-O-Link www.servolink.com (http://www.servolink.com/) is a great source of gears) and some hobby brass tubing, you can easily make a dual pointer gauge. Of course, one of the great strengths of RC servos is, well, their strength. They produce a lot of torque, so you arenít limited to pointer style instruments. You can make complex instruments like turn coordinators,

http://www.mikesflightdeck.com/images/rcservotc1.jpg

http://www.mikesflightdeck.com/images/rcservotc2.jpg

and artificial horizons.

http://www.mikesflightdeck.com/images/rcservoah1.jpg

http://www.mikesflightdeck.com/images/rcservoah2.jpg

Bob Reed
05-01-2008, 03:57 PM
Mike... Thank you for your tutorials! I am loving them!

dodiano
05-01-2008, 07:08 PM
Wow Mike inspiring!! What you use to connect the servoīs to FS?? I mean what software for the interface?

REGARDS,

Roberto

Mike.Powell
05-01-2008, 07:57 PM
Roberto, Bob,

Thank you.

I believe the commercially available interface boards come with software.

If you roll your own interface you can write "fairly simple" code using the express editions of visual studio (Visual Basic, Visual C++, Visual C#) from Microsoft at http://www.microsoft.com/express/product/default.aspx. The express editions are free! The Microsoft article "Serial Communications in Win32" at http://msdn.microsoft.com/en-us/library/ms810467.aspx explains how to access the serial port. And on the FSX end you can use SimConnect. All the documentation is included in the SimConnect SDK on the FSX installation DVD.

I've written a few chunks of demo interface code which will be published in an upcoming book. Hopefully I'll get it in print before the whole concept of personal computers becomes obsolete.:roll:

jmig
05-02-2008, 10:15 AM
Roberto, Bob,

Thank you.

I believe the commercially available interface boards come with software.

If you roll your own interface you can write "fairly simple" code using the express editions of visual studio (Visual Basic, Visual C++, Visual C#) from Microsoft at http://www.microsoft.com/express/product/default.aspx. The express editions are free! The Microsoft article "Serial Communications in Win32" at http://msdn.microsoft.com/en-us/library/ms810467.aspx explains how to access the serial port. And on the FSX end you can use SimConnect. All the documentation is included in the SimConnect SDK on the FSX installation DVD.

I've written a few chunks of demo interface code which will be published in an upcoming book. Hopefully I'll get it in print before the whole concept of personal computers becomes obsolete.:roll:

Or I die from old age. ;)