top of page

Auto Charging programming

  • yourlocalengineers
  • Jan 28, 2017
  • 2 min read

Hey readers, welcome back to another progress update of our project! We hope to be giving you a weekly update of our project and share with you our

thoughts and feelings every week, such as this week's update.

This week we programmed the auto charging. One of the most challenging problem is moving accurately to the charging dock. The tolerance for the robot to connect with the charging dock is low, the team have came out with a algorithm to ensure the robot to dock accurately. we have decided to use line tracking to guide the robot to position accurately. The robot is using 2 sets of 8-array light sensor put side by side to increase the tracking range. However, the robot is using only 14 light sensor instead of 16 due to the lack of analog pins in the Arduino Mega 2560.

For the line tracking, we used the Proportional Line Tracking method. Proportional Line Tracking will allow the robot to determine how the steep the robot should turn depending on how far it is away from the line. There are 14 light sensors in use now so there will be an array with the size of 14. The array will store the value ‘1’ or ‘0’ depending whether the that particular sensor is sensing black or white. For example, if sensor 1 was to sense black and the, then array[0] will be 1 and if it senses white, array[0] will be 0.

After storing the respective values into the array, the robot use this information to determine its turning steepness according its current position on the line. The formula below will show the motor speed is calculated.

Vx = abs[Tvx - (L - 7.5)] * Kvx

Vz = (L - 7.5) X Kvz

L is the sensor that is sensing black

Vx is the linear x velocity of the robot in m/s

Vz is the angular velocity of the robot in rad/s

Tvx is the targeted speed of Vx when it the line is in the middle of the robot

Kvx is a constant of where is amplify or shrinks the difference in (L - 7.5) in Vx

Kvx is a constant of where is amplify or shrinks the difference in (L - 7.5) in Vz

Tvx, Kvx and Kvz are parameters the programmer can set to determine how sensitive they want the robot to react to errors.

After some tuning we were able to make the robot charge itself autonomously.

 
 
 

Comments


bottom of page