Skip to content

Commit

Permalink
Revert "Increase search speed"
Browse files Browse the repository at this point in the history
This reverts commit 54b090f.
  • Loading branch information
Peque committed Apr 25, 2018
1 parent f1da839 commit 111f8b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
*/
static volatile float linear_acceleration = 5.;
static volatile float linear_deceleration = 5.;
static volatile float angular_acceleration = 64. * PI;
static volatile float angular_acceleration = 32. * PI;

static volatile float target_linear_speed;
static volatile float target_angular_speed;
static volatile float ideal_linear_speed;
static volatile float ideal_angular_speed;

static volatile float kp_linear = 800.;
static volatile float kp_linear = 1600.;
static volatile float kd_linear = 100.;
static volatile float kp_angular = 60.;
static volatile float kd_angular = 50.;
Expand Down
22 changes: 11 additions & 11 deletions src/target/move.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "move.h"

static volatile float max_linear_speed = .8;
static volatile float max_linear_speed = .6;

/* Assume the mouse tail is initially touching a wall */
static float cell_shift = WALL_WIDTH / 2 + MOUSE_TAIL;
Expand Down Expand Up @@ -201,11 +201,11 @@ void turn_left(void)
{
uint32_t starting_time = get_clock_ticks();

set_target_angular_speed(-8 * PI);
while (get_clock_ticks() - starting_time <= 88)
set_target_angular_speed(-4 * PI);
while (get_clock_ticks() - starting_time <= 125)
;
set_target_angular_speed(0);
while (get_clock_ticks() - starting_time <= 176)
while (get_clock_ticks() - starting_time <= 250)
;
}

Expand All @@ -216,11 +216,11 @@ void turn_right(void)
{
uint32_t starting_time = get_clock_ticks();

set_target_angular_speed(8 * PI);
while (get_clock_ticks() - starting_time <= 88)
set_target_angular_speed(4 * PI);
while (get_clock_ticks() - starting_time <= 125)
;
set_target_angular_speed(0);
while (get_clock_ticks() - starting_time <= 176)
while (get_clock_ticks() - starting_time <= 250)
;
}

Expand Down Expand Up @@ -257,11 +257,11 @@ void move_front(void)
void move_left(void)
{
enable_walls_control();
decelerate(current_cell_start_micrometers, 0.02, 0.666);
decelerate(current_cell_start_micrometers, 0.03, 0.404);
disable_walls_control();
turn_left();
enable_walls_control();
accelerate(get_encoder_average_micrometers(), 0.02);
accelerate(get_encoder_average_micrometers(), 0.03);
entered_next_cell();
}

Expand All @@ -271,11 +271,11 @@ void move_left(void)
void move_right(void)
{
enable_walls_control();
decelerate(current_cell_start_micrometers, 0.02, 0.666);
decelerate(current_cell_start_micrometers, 0.03, 0.404);
disable_walls_control();
turn_right();
enable_walls_control();
accelerate(get_encoder_average_micrometers(), 0.02);
accelerate(get_encoder_average_micrometers(), 0.03);
entered_next_cell();
}

Expand Down

0 comments on commit 111f8b8

Please sign in to comment.