Connecting a servo to the Parallax Flight Controller on your ELEV-8 v3 quadcopter, and editing the firmware, gives you more control of the servo.
The original Parallax Flight Controller firmware only generates servo pulses ranging from 1000 μs to 2000 μs (1.0 ms to 2.0 ms) wide. Many servos operate over a wider range, ~700 μs to ~2300 μs. So, the original Parallax Flight Controller firmware will only drive the servo through a portion of its full range:
This is important to note if the servo you are driving with the Parallax Flight Controller is part of a mechanism attached to your ELEV-8 v3.
If you haven't done so already, follow the directions here (http://learn.parallax.com/elev-8-v3-quadcopter-assembly-guide/step-22-install-software [1]) to open the ELEV-8 v3 firmware using SimpleIDE. Make sure you understand how to upload firmware to your ELEV-8 v3. This project was tested with firmware version 1.0.2 and 1.0.3.
A list of files will appear on the left side of the window.
static long LEDModeColor;
static int servoPosition = 8000; // create a variable to store the servos position, also tells servo where to start
Servo32_Init( 400 ); for( int i=0; i<4; i++ ) { Servo32_AddFastPin( MotorPin[i] ); Servo32_Set( MotorPin[i], Prefs.MinThrottle ); } Servo32_Start();
Servo32_AddSlowPin( PIN_MOTOR_AUX1 ); // Add a standard servo on PIN_MOTOR_AUX1 Servo32_Set( PIN_MOTOR_AUX1, servoPosition ); // Set the starting position
S4_Define_Port(3, 115200, PIN_MOTOR_AUX2, TXBuf4, sizeof(TXBuf4), 32, RXBuf4, sizeof(RXBuf4));
S4_Define_Port(3, 115200, 32, TXBuf4, sizeof(TXBuf4), 32, RXBuf4, sizeof(RXBuf4));
UpdateFlightLEDColor();
if( Radio.Aux1 < -512 ) servoPosition = servoPosition - 12; // if the switch/knob is low/down, turn counterclockwise if( Radio.Aux1 > 512 ) servoPosition = servoPosition + 12; // if the switch/knob is high/up, turn clockwise servoPosition = clamp( servoPosition, 8000, 16000 ); // don't let the variable go outside of the 8000 to 16000 range!! Servo32_Set( PIN_MOTOR_AUX1, servoPosition ); // set the servo position
DO NOT CONNECT YOUR ELEV-8's Battery. Make sure the propellers have been removed from your ELEV-8 quadcopter before continuing.
Links
[1] http://learn.parallax.com/elev-8-v3-quadcopter-assembly-guide/step-22-install-software