IMU - Accelerometer
• measures acceleration in terms
of g-force (g)
• requires offset calibration,
similar to gyroscope data
• z axis should be calibrated to
1G!
The PI Controller
(Proportional-Integral)
• Calculates error based on difference
between sensor reading and pilot command
• Proportional term depends on present error
• Integral term depends on accumulation of
past errors
The PI Controller
(Proportional-Integral)
#define KP 2.0 # ???
#define KI 2.0 # ???
float error = desired_pitch - current_pitch;
proportional = KP * error;
integral += KI * error * dt;
output = proportional + integral;
The PI Controller
(Proportional-Integral)
#define KP 2.0 # ???
#define KI 2.0 # ???
float error = desired_pitch - current_pitch;
proportional = KP * error;
integral += KI * error * dt;
output = proportional + integral;
The PI Controller
(Proportional-Integral)
#define KP 2.0 # ???
#define KI 2.0 # ???
float error = desired_pitch - current_pitch;
proportional = KP * error;
integral += KI * error * dt;
output = proportional + integral;
The PI Controller
(Proportional-Integral)
#define KP 2.0 # ???
#define KI 2.0 # ???
float error = desired_pitch - current_pitch;
proportional = KP * error;
integral += KI * error * dt;
output = proportional + integral;