Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed delay, tuned constants for smooth line follow

  • Loading branch information...
commit c8008fc5094cef33b0fe2343f1fd50d2564137af 1 parent 2945c5d
@robrighter authored
Showing with 6 additions and 7 deletions.
  1. +3 −3 line-follower.c
  2. +3 −4 main.c
View
6 line-follower.c
@@ -15,17 +15,17 @@ int integral = 0;
//use these functions to tune the constants
int apply_kp(int p){
- return p/22;
+ return p/10;
}
int apply_kd(int d){
//For initial tuning we set the constant to 0
- return d/4;
+ return d;
}
int apply_ki(int i){
//For initial tuning we set the constant to 0
- return i/20000;
+ return i/6000;
}
int get_value_within_max(int value, int max){
View
7 main.c
@@ -11,6 +11,7 @@ int main()
while(1){
while(!button_is_pressed(BUTTON_B)){}
wait_for_button_release(BUTTON_B);
+ delay_ms(1000);
pololu_3pi_init(2000);
calibrate_for_line();
@@ -18,10 +19,8 @@ int main()
reset_line_follower();
//just follow the line for a little while while testing
- int counter = 0;
- while(counter++ < 330){
- set_motors_by_position(110,read_and_display_sensor_data());
- delay_ms(100);
+ while(1){
+ set_motors_by_position(140,read_and_display_sensor_data());
}
set_motors(0,0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.