Skip to content
Snippets Groups Projects
Commit 4b1cf027 authored by dawehr's avatar dawehr
Browse files

1. Changed default yaw controller to be stable.

2. Switched to level 5 IMU filter
3. logging setpoints
4. Logging for up to 5 minutes
5. Also accounting for time spent during logging when calculating LOOP_TIME
6. Logging during manual mode now, too.
parent dd10eae9
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@
//#define YAW_ANGLE_KD 0.0f
// when using units of radians
#define YAW_ANGULAR_VELOCITY_KP 190.0f * 2292.0f//200.0f * 2292.0f
#define YAW_ANGULAR_VELOCITY_KP 29700//200.0f * 2292.0f
#define YAW_ANGULAR_VELOCITY_KI 0.0f
#define YAW_ANGULAR_VELOCITY_KD 0.0f
#define YAW_ANGLE_KP 2.6f
......
......@@ -30,7 +30,7 @@ int iic0_mpu9150_start(){
// Set clock reference to Z Gyro
iic0_mpu9150_write(0x6B, 0x03);
// Configure Digital Low/High Pass filter
iic0_mpu9150_write(0x1A,0x06); // Level 6 low pass on gyroscope
iic0_mpu9150_write(0x1A,0x05); // Level 5 low pass on gyroscope
// Configure Gyro to 2000dps, Accel. to +/-8G
iic0_mpu9150_write(0x1B, 0x18);
......
......@@ -112,6 +112,9 @@ void initialize_logging(log_t* log_struct, parameter_t* ps) {
addOutputToLog(log_struct, ps->vrpn_alt, CONST_VAL, m);
addOutputToLog(log_struct, ps->vrpn_pitch, CONST_VAL, rad);
addOutputToLog(log_struct, ps->vrpn_roll, CONST_VAL, rad);
addOutputToLog(log_struct, ps->x_set, CONST_VAL, m);
addOutputToLog(log_struct, ps->y_set, CONST_VAL, m);
addOutputToLog(log_struct, ps->alt_set, CONST_VAL, m);
addOutputToLog(log_struct, ps->mixer, MIXER_PWM0, pwm_val);
addOutputToLog(log_struct, ps->mixer, MIXER_PWM1, pwm_val);
addOutputToLog(log_struct, ps->mixer, MIXER_PWM2, pwm_val);
......
......@@ -9,7 +9,7 @@
#define LOG_DATA_H_
#include "type_def.h"
#define LOG_STARTING_SIZE 8192 //262144 // 2^18 32768 2^15
#define LOG_STARTING_SIZE 60000 //262144 // 2^18 32768 2^15
// Maximum number of block outputs you can record, and maximum number of block parameters to record
#define MAX_LOG_NUM 50
......
......@@ -75,15 +75,12 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
// update the GUI
update_GUI(&(structs.log_struct));
// Processing of loop timer at the end of the control loop
timer_end_loop(&(structs.log_struct));
if (!this_kill_condition) {
// Log the data collected in this loop
log_data(&(structs.log_struct), &(structs.parameter_struct));
if(structs.user_defined_struct.flight_mode == AUTO_FLIGHT_MODE)
{
// Log the data collected in this loop
log_data(&(structs.log_struct), &(structs.parameter_struct));
static int loop_counter = 0;
loop_counter++;
......@@ -113,6 +110,9 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
}
last_kill_condition = this_kill_condition;
// Processing of loop timer at the end of the control loop
timer_end_loop(&(structs.log_struct));
}
kill_motors(&(structs.hardware_struct.pwm_outputs));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment