Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kierdavis committed Mar 13, 2017
1 parent adbe2d5 commit cadd69e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,18 @@ void control_cycle(measured_state_t *measured_state,
MIN_INTEGRAL_YAW,
MAX_INTEGRAL_YAW);

//static float t = 0.0;
// z_factor = desired_state->z_vel*0.1;
// roll_factor = desired_state->roll*0.01;
// pitch_factor = desired_state->pitch*0.01;
// yaw_factor = desired_state->yaw_vel*0.1;
z_factor = 0.5;
//roll_factor = 0.0;
//pitch_factor = 0.0;
z_factor = 0.2 + desired_state->z_vel*0.15;
roll_factor = -desired_state->roll*0.05;
pitch_factor = desired_state->pitch*0.05;
yaw_factor = 0.0;
//t += 0.00001;

z_factor = 0.0;
roll_factor = 0.0;
pitch_factor = 0.0;
yaw_factor = 0.0;
//z_factor = 0.5;
//yaw_factor = 0.0;

// z_factor = 0.0;
// roll_factor = 0.0;
// pitch_factor = 0.0;
// yaw_factor = 0.0;

// printf("LOG %f,%f,%f\n", dt_float, z_factor, measured_state->z_vel);

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void convert_rc_packet(desired_state_t *desired_state) {
// 1 = roll
// 2 = pitch

desired_state->z_vel = ((float) rc_data_packet.channel_0) / 128.0 - 1.0;
desired_state->z_vel = 2.0 * (((float) rc_data_packet.channel_0) / 128.0 - 1.0);
desired_state->roll = ((float) rc_data_packet.channel_1) / 128.0 - 1.0;
desired_state->pitch = ((float) rc_data_packet.channel_2) / 128.0 - 1.0;
desired_state->yaw_vel = ((float) rc_data_packet.channel_3) / 128.0 - 1.0;
Expand Down
2 changes: 1 addition & 1 deletion src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

// Allowable limits for rotor speeds (0.0 = 1ms pulse, 1.0 = 2ms pulse).
#define MIN_ROTOR_SPEED 0.0
#define MAX_ROTOR_SPEED 0.6
#define MAX_ROTOR_SPEED 0.4

// Rotor speeds are filtered to reduce transients. The higher this parameter is,
// the more filtering is applied (but the slower the rotors are to respond to
Expand Down

0 comments on commit cadd69e

Please sign in to comment.