[Company Logo Image]        Servo Reverser 

Home Up Contents Search Articles Caveat Purpose Notice                                                           

Rev Assembler
PBP Reversers

Situation

The classic case requiring a servo reverser is that of ailerons.  The requirement is to place a servo in each wing directly driving one aileron.  But, the receiver only has one aileron channel.  If we plug in a "Y" harness into the aileron channel, then both servos will drive in the same direction - we want them to deflect in OPPOSITE directions.  This is of course a trivial application, but it serves the purpose for easy illustration.

JH points out that a dual servo application on an elevator is where a very accurate reverser on a "Y" harness is used.  A high degree of accuracy is required because dual elevator servos are typically used in high performance precision aerobatic planes and it is essential to avoid aileron effect of elevator (where different deflections on each elevator half act like ailerons).  In this case the servos are mounted on opposite sides of the fuse in the rear with short stiff push rods.  The servos must track in perfect mirror image with each other.

First Solution

The answer is to set up a MASTER to SLAVE relationship.  The servo on the MASTER side of the "Y" is left unchanged, while we cut the cable on the SLAVE side and insert a SERVO REVERSER.  The signal going to the MASTER will be reversed in the SLAVE.

What we want to achieve is shown in the truth table below:                                                  

MASTER SLAVE MASTER + SLAVE ADJUST
1.00 milliseconds 2.00 milliseconds 3.00 milliseconds 3-MASTER = 2.00
1.25 milliseconds 1.75 milliseconds 3.00 milliseconds 3-MASTER = 1.75
1.50 milliseconds 1.50 milliseconds 3.00 milliseconds 3-MASTER = 1.50
1.75 milliseconds 1.25 milliseconds 3.00 milliseconds 3-MASTER = 1.25
2.00 milliseconds 1.00 milliseconds 3.00 milliseconds 3-MASTER = 1.00

Notice that the MASTER signal added to the SLAVE signal always comes to 3 milliseconds.  We will use this fact to create an elegant solution, which CatsEyes has summarized as:

  1. Measure input signal on MASTER
  2. Calculate SLAVE = 3mS minus MASTER
  3. Send PWM value of SLAVE as output

In the examples of GEAR and FLAP rotation, we used the idea of a code loop where 1 millisecond equalled 100 loops.  The ASSEMBLER code shown on the sidebar continues this trend and the MASTER + SLAVE value is accordingly given the value 300.

 

The input signal from the 'Y' harness would come in on Pin 5 which has been designated as GP3

The reversed output signal would go out on Pin 5 which has been designated as GP2

The positive and negative leads of the slaved servo are fed off the 5 volt and ground leads of the PIC, which in turn were supplied for the leads coming out of the receiver.

 

 

Note:  We are going to explore the idea of using the Analog/Digital module within the 12F675 to supply a TRIM capability to accurately align the slaved servo.  The A/D would use Vdd (in this case 5 volts) as the reference voltage.  A trimming potentiometer would feed into the A/D module.  The output from the A/D would be assigned as the variable TRIM and fed into the adjusting code.

In the meantime, a variable called TRIM has been embedded in the code.  A hard-coded zero assigns a neutral value and has no effect.  Positive or negative numbers affect the throw by small amounts.  For instance, a value of 5 seems to offset the servo arm by a couple of degrees.  More experimentation to follow.

Second Solution

Ironsides, came up with a much more pedantic version by introducing the complication that not all radios transmit an absolutely clean 1 millisecond to 2 millisecond Pulse Wave Modulation.  The deflection might be slightly higher or lower than those norms.  Therefore, we will assume an arbitrary mid-point of 1.5 milliseconds.  Then we will measure all deflection from the mid-point, which neatly gets around the arbitrary nature of the end-points.

The high level logic for the second servo reversing process is shown below:

Master Input:

         Measure the input signal to determine if it is greater than 1.5 milliseconds or less than or equal to 1.5 milliseconds

         If greater then GOTO  Greater:

         If less than or equal then GOTO Less:

Greater:

           Determine the magnitude of the difference and call it Greater_diff

           GOTO Slave_Output_Greater

Less:

          Determine the magnitude of the difference and call it Lesser_diff

          GOTO Slave_Output_Less

Slave_Output_Greater:

          1.5 minus Greater_diff = PWM width sent on Slave_Signal

Slave_Output_Less:

          1.5 plus Lesser_diff = PWM width sent on Slave_Signal

Slave_Signal:

          Output the reversed PWM 

          Return to Master_Input

End

A very simple ProBasic Pro solution is posted as PBP Reverser in the sidebar.

 

 

Home ] Up ] Rev Assembler ] PBP Reversers ]                                                                                                                                               

Send mail to ironsidz@hotmail.com with questions or comments about this web site.
Copyright © 2003 
Last modified: March 18, 2004