SRCMBC Banner
   




 

SERVO SLOWER

N.B. this is an old article describing Alan's prototype "servo slower" which has now evolved into a Servo Controller. You are strongly advised to visit that page rather than use this information!

'servo slower' units are used to reduce the slew-rate (traverse time) of proportional servos. The most common use in model boats is to control the rotation of a servo-controlled gun turret, where trying to do so by transmitter stick movement alone results in unrealistically rapid and/or jerky motion.
Using a 'slower', the stick can be thrust right or left and the servo will turn slowly and smoothly until it is aligned with the position commanded by the stick. The end to end travel time of the servo is adjustable in ten steps from 'straight through' - ie the 'slower' is inoperative - up to approximately 30 seconds. Actual times will vary dependent upon the transmitter frame rate. Connections are via a flying-lead to the receiver and pcb mounted connector to the servo.

This unit is based on a 'PICAXE' micro-controller so all the clever stuff is done in software and as a result the parts count is minimal. The photo shows a prototype unit built on the readily available PICAXE project board AXE021 and the circuit diagram reflects that situation. Should you wish to build the unit on strip-board then the 3.5mm stereo jack socket (used to program the PIC over a serial link from your PC) can be omitted, together with the programming link LK1. If omitting the jack socket, R1 and R2 cannot be omitted - otherwise the serial input would 'float' and the PICAXE could interpret that as a signal from the PC (which it expects to be attached to this input) to enter re-programming mode. R1 and R2 can of course be replaced by a single 33K resistor.

The white-ish looking LED is in fact a red/green bi-colour device which flickers at the transmitter frame rate to show the unit is operating. It flickers green whilst the servo is in alignment with the commanded position and flickers red whilst it is slewing to a new position. In the case of the 'straight through' mode being selected then the LED shows solid green. It also flashes red once per second if the input signal is not connected or disappears (eg a transmitter range problem) in either case returning the servo to its neutral position.

The LED also gives a long red flash at each 'step' position as the slew rate adjustment pot is turned from end to end, so by counting the flashes it is easy to determine the 'slow' setting selected.

Circuit Diagram

Click on the image to view the circuit diagram in a resizable pop-up window then enlarge, or maybe even maximize, the pop-up to render the diagram legible. The pop-up can be closed from its own control box, or alternatively click anywhere on the main window to close it.

Software
The PICAXE 08M chip is used in preference to the more basic 08 part so that the internal oscillator can be set to 8Mhz operation, yielding a pulse-width resolution of 5 uSec which allows the 1 mSec traverse from end to end to be achieved in 200 steps resulting in very smooth operation.

After checking for presence of the input signal the program enters the main loop where it first monitors the setting of the slew rate adjustment pot, diverting to the 'straight through' mode if required. The input pulse width (ie commanded servo position) is then checked and compared with the actual servo position. If an error exists, then the servo is moved one 5 uSec step towards the required postion and the program drops into the main loop again. Thus after a number of steps at the transmitter's (nominal) 20mSec frame rate the servo finally reaches the commanded position and the output pulse-width is then repeatedly asserted to hold the servo in position.

The slew rate adjustment pot sets the number of times to go round the 20mSec main loop before incrementing/decrementing the servo position and in this manner quite long duration traverses can be achieved.

Each time round the main loop the input pulse-width is checked to lie within the permitted 1 to 2mSec range, and if a spurious pulse-width occurs then the previous good pulse-width is output, thereby giving some resistance to 'glitches'. But sustained out-of-range signal (or non at all) returns the program into the start-up mode, flashing the red LED once a second, waiting for resumption of a good signal. For safety, the servo is returned to neutral in this condition. Future plans are to implement a moving average filter to 'clean up' the input signal as a better method of eliminating any 'glitches'.

My source code is not available - but on a local basis I am happy to 'burn' my program into your chip for any SRCMBC members. If you are further afield and really *must* make one, then contact me and we can probably come to some arrangement.

Variants
An alternative approach to gun control is to simply slew left or right (whoops - port or starboard!) at a steady pace whilst the transmitter stick exceeds defined thresholds (ideal for digital channels 5 & 6) then stop and hold when the stick is released or the end of servo travel is reached.

Another idea is that a single blip of the stick causes a slow traverse to some defined position, hold for a period, activate a 'fire' signal and then return to neutral.

A chip could also be programmed to continuously sweep a servo from side to mimic the movement of a forward facing radar scanner.

Doubtless you will have other ideas, but the beauty of using a micro-controller is that such variants can be explored without needing to alter the hardware. So, let me have your ideas!

Parts List
Check out Technobots for the PICAXE related parts (premises in Totton)

Circuit RefDescriptionSupplier
 Picaxe-08 Proto Board AXE021Technobots # 3803-010
   
C1capacitor, 100nF, polyesterAXE021 Kit
C2capacitor, 220uF, 6v3Maplin VH14Q
   
R1resistor, 22KAXE021 Kit
R2resistor, 10KAXE021 Kit
R3resistor, 220R 
R4resistor, 220R 
R5resistor, 10K 
   
RV1potentiometer, 5KMaplin N40BR
   
U1Picaxe-08M ICTechnobots # 3803-100
   
LED1LED, 3mm, bi-colourMaplin GW62S
   
LK13 pin header & jumper plugAXE021 Kit
PL1servo lead & plugsee below *
SKT13.5mm stereo socketAXE021 Kit
SKT2servo lead & socketsee below *

* PL1 and SKT2 are created by cutting a normal servo extender lead in two.

Page maintained by Alan Bond Last modified: 14:04, 04 February 2012