Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
balance initialisation problem
09-11-2017, 01:38 PM
Post: #1
balance initialisation problem
Hello All

i have a problem when i start the bot Sad(( the balancing system do not seems to initialize properly. The motors starts and makes a lot of noise, but there is no balance at all Sad
it was working super fine until now, also i use brand new batteries.

i made a quick video so you can see the problem :/

mp4 file
https://we.tl/WZggGWS6dy

Any help is welcome =)
++
Alex
Find all posts by this user
Quote this message in a reply
09-12-2017, 04:00 PM
Post: #2
RE: balance initialisation problem
The IMU is quite sensitive. Maybe (just maybe) it got damaged during the manipulation? (short circuit between Vin+Ground?)
Check the DEDUB MODE and see what the IMU provides. Try setting the DEBUG MODE==1 so you will see the IMU angle in real time in the SERIAL MONITOR (arduino IDE). More info:

There is a DEBUG MODE inside the B-robot CODE. This MODE will allow you the debug the behaviour of the robot if you are having issues. Please, refer to the B-robot community if you have problems or questions.

Look at the sketch line “#define DEBUG 0″ and change the 0 to 1…8 depending on what info you want to get. Take a look to the CODE below:

#if DEBUG==8
Serial.print(throttle);
Serial.print(” “);
Serial.print(steering);
Serial.print(” “);
Serial.println(mode);
#endif

//angle_adjusted_radians = angle_adjusted*GRAD2RAD;

#if DEBUG==1
Serial.println(angle_adjusted);

#endif

//Serial.print(“\t”);
mpu.resetFIFO(); // We always reset FIFO

// We calculate the estimated robot speed:
// Estimated_Speed = angular_velocity_of_stepper_motors(combined) – angular_velocity_of_robot(angle measured by IMU)
actual_robot_speed_Old = actual_robot_speed;
actual_robot_speed = (speed_M1 + speed_M2)/2; // Positive: forward

int16_t angular_velocity = (angle_adjusted-angle_adjusted_Old)*90.0; // 90 is an empirical extracted factor to adjust for real units
int16_t estimated_speed = -actual_robot_speed_Old – angular_velocity; // We use robot_speed(t-1) or (t-2) to compensate the delay
estimated_speed_filtered = estimated_speed_filtered*0.95 + (float)estimated_speed*0.05;

#if DEBUG==2
Serial.print(” “);
Serial.println(estimated_speed_filtered);
#endif

// SPEED CONTROL: This is a PI controller.
// input:user throttle, variable: estimated robot speed, output: target robot angle to get the desired speed
//target_angle = (target_angle + speedPControl(estimated_speed_filtered,throttle,Kp_thr))/2.0; // Some filtering : Average with previous output
//target_angle = target_angle*0.3 + speedPIControl(dt,estimated_speed_filtered,throttle,Kp_thr,Ki_thr)*0.7; // Some filtering
target_angle = speedPIControl(dt,estimated_speed_filtered,throttle,Kp_thr,Ki_thr);
target_angle = constrain(target_angle,-max_target_angle,max_target_angle); // limited output

#if DEBUG==3
Serial.print(” “);
Serial.println(estimated_speed_filtered);
Serial.print(” “);
Serial.println(target_angle);
#endif

#if DEBUG==10
Serial.print(angle_adjusted);
Serial.print(” “);
Serial.println(debugVariable);
#endif

#if DEBUG==6 //BATTERY STATUS
Serial.print(“B”);
Serial.println(battery);
Serial.print(” “);
#endif
#if DEBUG==7
Serial.print(distance_sensor);
Serial.print(” A”);
Serial.println(autonomous_mode_status);
Find all posts by this user
Quote this message in a reply
09-13-2017, 03:18 PM
Post: #3
RE: balance initialisation problem
Hello
thank you for the support, i rechecked all connections, replaced the IMU with a new tape and finally it work again.
YAY \O/

Now i need to figure out what battery to use, 6*1.5 is too big Smile i need to find a smaller battery.
++
Alex
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)