Checkout our new site at AeroQuad.com! This site is maintained for backup purposes. Please go to our new site for the latest and greatest on the AeroQuad project!
You are here: AeroQuad> Main Web>SerialCommands_v11 (2009-06-16, AeroQuad)

AeroQuad Configuration and Status Commands

To configure and read status from your quad without using the Configurator, connect the Arduino to your serial port and click the Serial Monitor button on the toolbar. In the lower left hand side of the IDE, you will see a pull down which allows you to set the serial link's baud rate. Select 115200 for the baud rate. The AeroQuad responds to single character commands which can be entered into the text field in the lower right hand side of the IDE. When ready, press the Send button to transmit the command to the AeroQuad.

(A) Send roll and pitch gyro PID values

Send an 'A' followed by numeric values to transmit user defined roll and pitch PID values for gyro stabilized flight control. Each value is separated by a semi-colon in the form:

A[Roll P Gain];[Roll I Gain];[Roll D Gain];[Pitch P Gain];[Pitch I Gain];[Pitch D Gain];

P Gain = Proportional gain of PID (start with a value of 1, and increase/decrease until the quad is stable)
I Gain = Integral gain of PID (not normally used for gyro only control)
D Gain = Derivative gain of PID (use this to help quad return to a level hover quicker after forward flight, start with -1 and keep going negative until happy with quad behavior, it's OK to set D=0)

Send a 'B' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
A2.5;0;-4;3.1;0;-3.8;

The above example command specifies a user defined PID values of:
Roll P Gain = 2.5
Roll I Gain = 0
Roll D Gain= -4
Pitch P Gain = 3.1
Pitch I Gain = 0
Pitch D Gain = -3.8

(B) Read roll and pitch gyro PID values

Send a 'B' to receive user defined roll and pitch PID values for gyro stabilized flight control. The AeroQuad will then send a string response in the form:

[Roll P Gain],[Roll I Gain],[Roll D Gain],[Pitch P Gain],[Pitch I Gain],[Pitch D Gain]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
2.5,0,-4,3.1,0,-3.8

(C) Send yaw PID values

Send a 'C' followed by numeric values to transmit user defined yaw PID values. Each value is separated by a semi-colon in the form:

C[Yaw P Gain];[Yaw I Gain];[Yaw D Gain];

P Gain = Proportional gain of PID (start with a value of 1, and increase/decrease until the quad is stable)
I Gain = Integral gain of PID (not normally used for gyro only control)
D Gain = Derivative gain of PID (use this to help quad return to a level hover quicker after forward flight, start with -1 and keep going negative until happy with quad behavior, it's OK to set D=0)

Use 'D' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
C10;0;0;

The above example command specifies a user defined PID values of:
Yaw P Gain = 10
Yaw I Gain = 0
Yaw D Gain= 0

(D) Read yaw PID values

Send a 'D' to receive user defined yaw PID values. The AeroQuad will then send a string response in the form:

[Yaw P Gain],[Yaw I Gain],[Yaw D Gain]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
10,0,0

(E) Send roll and pitch auto level PID values - Experimental

Send an 'E' followed by numeric values to transmit user defined roll and pitch PID values for experimental auto level flight control. Each value is separated by a semi-colon in the form:

E[Roll P Gain];[Roll I Gain];[Roll D Gain];[Pitch P Gain];[Pitch I Gain];[Pitch D Gain];

P Gain = Proportional gain of PID (start with a value of 1, and increase/decrease until the quad is stable)
I Gain = Integral gain of PID (not normally used for gyro only control)
D Gain = Derivative gain of PID (use this to help quad return to a level hover quicker after forward flight, start with -1 and keep going negative until happy with quad behavior, it's OK to set D=0)

Send an 'F' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
E2.5;0;-4;3.1;0;-3.8;

The above example command specifies a user defined PID values of:
Roll P Gain = 2.5
Roll I Gain = 0
Roll D Gain= -4
Pitch P Gain = 3.1
Pitch I Gain = 0
Pitch D Gain = -3.8

(F) Read roll and pitch auto level gyro PID values - Experimental

Send an 'F' to receive user defined roll and pitch PID values for experimental auto level flight control. The AeroQuad will then send a string response in the form:

[Roll P Gain],[Roll I Gain],[Roll D Gain],[Pitch P Gain],[Pitch I Gain],[Pitch D Gain]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
2.5,0,-4,3.1,0,-3.8

(G) Send auto level configuration values - Experimental

Send a 'G' followed by numeric values to transmit user defined experimental auto level values, followed by a string of numeric values separated by semi-colon in the form:

G[Level Limit];[Level Interval];

Level Limit = Maximum motor command value that experimental auto level algorithm sends to motors
Level Off = When transmitter input exceeds this value during a hover, the auto level feature is turned off

Send an 'H' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
G1000;100;

The above example command specifies experimental auto level values of:
Level Limit = 1000
Level Off = 100

(H) Read auto level configuration values - Experimental

Send an 'H' to receive experimental auto level configuration values. The AeroQuad will then send a string response in the form:

[Level Limit],[Level Interval]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
1000,100

(I) Send flight control configuration values

Send a capital letter 'I' followed by numeric values to transmit user defined flight control values, followed by a string of numeric values separated by semi-colon in the form;

I[Windup Guard];[Transmitter Factor];

Windup Guard = Windup guard value used for PID loops to insure Integral gain is controlled and limited
Transmitter Factor = controls the strength of the commands sent from the transmitter (0.01 = weakest, 1.0 = strongest)

Send a 'J' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
I500;0.2;

The above example command specifies experimental auto level values of:
Windup Guard = 500
Transmitter Factor = 0.2

(J) Read flight control configuration values

Send a 'J' to receive flight configuration values. The AeroQuad will then send a string response in the form:

[Windup Guard],[Transmitter Factor]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
500,0.2

(K) Send data filtering values

Send a capital letter 'K' followed by numeric values to transmit user defined data filtering values, followed by a string of numeric values separated by semi-colon in the form;

K[Gyro Smooth Factor];[Accelerometer Smooth Factor];[Complimentary Filter Time Constant];

Gyro Smooth Factor = Low pass filtering for acquired gyro data in the form
Accelerometer Smooth Factor = Low pass filtering for acquired accelerometer data in the form
Complimentary Filter Time Constant = time constant in seconds used for Complementary Filter

Send an 'L' to verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string to transmit:
K0.20;0.20;0.500;

The above example command specifies experimental auto level values of:
Gyro Smooth Factor = 0.20
Accelerometer Smooth Factor = 0.20
Complimentary Filter Time Constant = 0.500 seconds

(L) Read data filtering values

Send an 'L' to receive data filtering values. The AeroQuad will then send a string response in the form:

[Gyro Smooth Factor],[Accelerometer Smooth Factor],[Complimentary Filter Time Constant]

When you verify that the values you sent match the values in the AeroQuad, send a 'W' to write these values to the EEPROM. It is recommended to set all desired user defined values first, then send a 'W' to write all values to EEPROM at once.

Example string received:
0.20,0.20,0.500

(Q) Read Sensor Data

Send a 'Q' to initiate reading back of gyro, accel, and calculated absolute roll/pitch values. After a 'Q' is transmitted, the following comma delimited string ending with a carriage return and line feed will be continuously sent from the AeroQuad:
[Roll Gyro Rate],[Pitch Gyro Rate],[Yaw Gyro Rate],[Roll Accel],[Pitch Accel],[Z Accel],[Roll Angle],[Pitch Angle]\r\n

Roll Gyro Rate = measured ADC value of roll gyro axis centered around zero
Pitch Gyro Rate = measured ADC value of pitch gyro axis centered around zero
Yaw Gyro Rate = measured ADC value of yaw gyro axis centered around zero
Roll Accelerometer Position = measured ADC value of roll accel axis centered around zero
Pitch Accelerometer Position = measured ADC value of pitch accel axis centered around zero
Z Accelerometer Position = measured ADC value of Z-axis accel axis centered around zero
Roll Angle = absolute roll angle experienced by the quad as calculated by the 2nd order complementary filter
Pitch Angle = absolute pitch angle experienced by the quad as calculated by the 2nd order complementary filter

(R) Read Raw Sensor Values

Send an 'R' to initiate reading back of all sensor values. After an 'R' is transmitted, the following comma delimited string ending with a carriage return and line feed will be continously sent from the AeroQuad:
[Roll Gyro ADC],[Pitch Gyro ADC],[Yaw Gyro ADC],[Analog Channel 2],[Analog Channel 3],[Analog Channel 4]\r\n

Roll Gyro ADC = raw ADC value for roll channel
Pitch Gyro ADC = raw ADC value for pitch channel
Yaw Gyro ADC = raw ADC value for yaw channel
Analog Channel 2 = raw ADC value for channel 2
Analog Channel 3 = raw ADC value for channel 3
Analog Channel 4 = raw ADC value for channel 4

Example string that can be transmitted:
512,534,510,0,1024,100\r\n

The above example string specifies:
Roll Gyro ADC = 512
Pitch Gyro ADC = 534
Yaw Gyro ADC = 510
Analog Channel 2 = 0
Analog Channel 3 = 1024
Analog Channel 4 = 100

(S) Read All Flight Values

Send an 'S' to initiate reading back of all flight values. After an 'S' is transmitted, the following comma delimited string ending with a carriage return and line feed will be sent continuously from the AeroQuad:
[Loop Time],[Roll Gyro Rate],[Pitch Gyro Rate],[Yaw Gyro Rate],[Throttle Output],[Roll PID Output],[Pitch PID Output],[Yaw PID Output],[Front Motor Command],[Rear Motor Command],[Right Motor Command],[Left Motor Command]\r\n

Loop Time = time in milliseconds it takes the AeroQuad to execute one iteration in code
Roll Gyro Rate = measured ADC value of roll gyro axis centered around zero
Pitch Gyro Rate = measured ADC value of pitch gyro axis centered around zero
Yaw Gyro Rate = measured ADC value of yaw gyro axis centered around zero
Throttle Output = measured PWM output of throttle (ranges from 1000-2000)
Roll PID Output = PID output for roll axis (ranges from 1000-2000)
Pitch PID Output = PID output for pitch axis (ranges from 1000-2000)
Yaw PID Output = PID output for yaw axis (ranges from 1000-2000)
Front Motor Command = PWM output sent to front motor (ranges from 1000-2000)
Rear Motor Command = PWM output sent to rear motor (ranges from 1000-2000)
Right Motor Command = PWM output sent to right motor (ranges from 1000-2000)
Left Motor Command = PWM output sent to left motor (ranges from 1000-2000)

Example string that can be transmitted:
2,-10,3,-2,1011,1012,1002,1000,1001,1003,1002,1004\r\n

The above example string specifies:
Loop Time = 2
Roll Gyro Rate = -10
Pitch Gyro Rate = 3
Yaw Gyro Rate = -2
Throttle Output = 1011
Roll PID Output = 1012
Pitch PID Output = 1002
Yaw PID Output 1000
Front Motor Command = 1001
Rear Motor Command 1003
Right Motor Command = 1002
Left Motor Command = 1004

(T) Read Processed Transmitter Values

Send a 'T' to initiate reading back of all processed transmitter values. These values are used as the setpoint into the PID control loop that describes the position of the roll, pitch and yaw transmitter stick in PWM values (centered around 1500). It is also multiplied by the Transmitter Factor to reduce the strength of this value. After a 'T' is transmitted, the following comma delimited string ending with a carriage return and line feed will be continuously sent from the AeroQuad:
[Roll Command],[Pitch Command],[Yaw Command]\r\n

Roll Command = PWM value of roll ransmitter stick (centered around 1500) and multiplied by Transmitter Factor
Pitch Command = PWM value of pitch ransmitter stick (centered around 1500) and multiplied by Transmitter Factor
Yaw Command = PWM value of yaw ransmitter stick (centered around 1500) and multiplied by Transmitter Factor

Example string that can be transmitted:
1520,1490,1500\r\n

The above example string specifies:
Roll Command = 1520
Pitch Command = 1490
Yaw Command = 1500

(U) Read Receiver Values

Send an 'U' to initiate reading back of R/C receiver values. After an 'U' is transmitted, the following comma delimited string ending with a carriage return and line feed will be continuously sent from the AeroQuad:
[Loop Time],[Throttle],[Roll],[Pitch],[Yaw],[Gear],[Aux]\r\n

Loop Time = time in milliseconds it takes the AeroQuad to execute one iteration in code
Roll = PWM output from roll channel (ranges from 1000-2000)
Pitch = PWM output from pitch channel (ranges from 1000-2000)
Yaw = PWM output from yaw channel (ranges from 1000-2000)
Throttle = PWM output throttle channel (ranges from 1000-2000)
Gear = PWM output from gear channel (ranges from 1000-2000)
Aux = PWM output from auxilliary channel (ranges from 1000-2000)

Example string that can be transmitted:
1,1403,1620,1523,1501,1900,1950\r\n

The above example command specifies receiver values of:
Loop Time = 1
Roll = 1403
Pitch = 1620
Yaw = 1523
Throttle = 1501
Gear = 1900
Aux = 1950

(W) Write user defined values to EEPROM

(X) Stop sending continuous data

Topic revision: r3 - 2009-06-16 - 08:02:30 - AeroQuad
 
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding AeroQuad? Send feedback