Subscribe

RC Servo Tester/Exerciser

Posted by Circuit Labs on Thursday, November 13, 2008

Author: Ray King

040172ukThe design presented here is for a device for testing radio control (RC) servos. The present design has features that make it especially useful to people designing and building radio control equipment. By building a number of these devices in a single enclosure an entire radio controlled model can be set up and tested without having to actually use the RC transmitter.

The most unusual feature of this design is that it doesn’t use a joystick or similar analogue device to determine the servo position. Instead it gives an output of precisely 1.5 ms that can be changed up or down in steps of 0.166 ms and gives a display on a line of LEDs of the position selected. This is of particular use if you are designing and testing radio control devices that use the receiver output directly, enabling a known pulse width to be applied without resorting to using an oscilloscope. With this facility the devices can be calibrated simply and quickly.

Secondly the device has the ability to switch to an ‘exercise’ mode. Selecting this mode cycles the servo between the extremes of its travel and serves as a useful quick test of normal servos to verify correct working. A further LED indicates selection of this mode.

Finally the device uses very few components and is extremely cheap to build since the PIC processor carries out all of the timing functions.

040172uk[5]

The circuitry is a pretty straightforward implementation of the good old PIC 16F84 processor with eight LEDs D1-D8 and three switches S1, S2, S3 connected. The software generates a servo output signal every 20 ms then scans the switches for a button press. Depending on the button pressed the output pulse length will be adjusted accordingly.

When first switched on the circuit will output a servo pulse of 1.5 ms duration and the middle
LED of the array will be lit. Pressing the ‘up’ or ‘down’ buttons will increase or decrease the pulse width by 0.166 ms and the LED display will move as appropriate to show the pulsewidth selected.

At any time the ‘mode’ button may be pressed which causes the device to switch to/from the ‘exercise’ mode. A servo connected to the output will cycle repeatedly from end to end of its travel — a useful indication of whether the servo is operational or not.

An Elektor-style PCB was designed for the project and the artwork is shown here. Only one wire is required on the board. The author’s own prototype incorporated two of these boards in a single enclosure so that two servos on a model can be tested at once. The board shown in the photograph is a prototype differing from the final version in minor detail.

 

040172 040172[3]

The source code was written using Proton PIC Basic+ which then compiles into assembler and object code. For those with a PIC programmer, all project software including the hex and source code files is available as a free download, file ref. 040172-11.zip, from the Elektor Electronics website. The PIC is also available ready programmed though Readers Services under number 040172-41.

Several options are available for powering the circuit. A 9-V PP3 (6F22) battery may look okay at first blush but then it will be exhausted quickly even with small servos. A mains adaptor (‘battery eliminator’) is possible, but precludes field use. Undoubtedly the most elegant approach, then, is the use of a case with a battery compartment for penlight (AA size) batteries, and then use four alkaline cells or five NiMH rechargeables to obtain a raw supply voltage of 6 V. This will necessitate the use of a low-drop regulator for IC2, like the 4805 or the LM2940 you find suggested here because it will not drain an almost flat battery due to its own current. An on/off switch is also recommended. The standby current consumption of the circuit amounts to about 5 mA.

Finally, PIC burners among you using the hex file should set the config bits as follows: HS (10) (since xtal > 4 MHz ); WDTE disable (0); PWRTE enable (0). The other config bits are for code protection and their use is at your discretion.

COMPONENTS LIST

Resistors
(1/4W 10%)
R1,R4,R5,R6 = 10kΩ
R2, R3=1kΩ

Capacitors
(5mm lead pitch)
C1,C2 = 27pF
C3, C4 = 100nF

Semiconductors
D1,D2,D3,D5,D6,D7 = LED, 3mm, high efficiency, green
D4, D8 = LED, 3mm, high efficiency, yellow
IC1 = PIC16F84(A), DIL18 case, programmed, order code 040172-41
IC2 = LM2940, TO220 case (or 5V 1A low drop equivalent)

 

Miscellaneous
X1 = 8MHz quartz crystal, 32pF parallel load capacitance, HC49 case or lowprofile model
K1 = 3 way SIL pinheader
S1, S2, S3 = pushbutton, 1 make contact
Case: Hammond 1591ATBU
IC socket 18p
Mains adaptor DC socket
PCB, order code 040172-1
Project software, free download 040172-11 from Elektor website
A kit of parts is available from Elektor
Electronics; order code 040172-71, see SHOP pages or website. Kit contents as components list.

 (Elektor Electronics Magazine – 07-08/2006)


Download this article (#040172-uk.pdf)
 040172-11.zip >> or direct link

0 comments:

Subscribe to: Post Comments (Atom)