mandag den 4. juni 2012

Project - Meeting 7


Date: 04-06-2012
Duration of activity: 5 hours
Group members participating: Jeppe, Thomas and Stefan.

Goal

  • Mounting black line on track.
  • Make the robots stack on top of each other using Bluetooth and a feedback sensor.
  • Start making all the robots follow the black line on the track to the basket.
  • The track should now be complete.

Plan

The black tape is to be mounted on the white track.
We will have to build the basics for having the robots communicating using Bluetooth. 
We will have to implement a PID control for the robots to follow the black line. The challenge here is to build the control such that the robots will make a 90 degree turn (this should be a matter of setting the constants right).
After today the track should be completely done.

Results

We got some black insulation tape which we mounted on the track with 90 degrees angles as shown in the picture.


Robot stacking:
Thomas and Stefan started working on the robots Bluetooth connection. Stefan also mounted light sensors on the two Stacking robots.

We decided to solve the problem of stacking one robot on top of the other by creating a behavior on each robot. On the robot that was to climb on top of the other one, the behavior is simpy to drive forward until it gets a message "STOP1" after which it stops. The other robot has a behavior that waits for either of the push-buttons on top of it to be pressed after which it sends a "STOP1" message out through the network.

By the end of the day we had problems with yet unknown exceptions that meant the "STOP1" message was either not send or not received for some reason. We will look into this more on the next meeting.

Line follower:
Jeppe started working on a PID control algorithm for the line follower. 
We implemented a PID control like the one presented in Fred G. Martin [1]. The main difficulty in the line follower algorithm was to make the robot make a sharp turn when it hits a corner. That problem was solved by introducing an integration part for the error equation, that will quickly sum up the over all error when the robot is over the black line for a long time (only happens when it bumps in to a right 90 degree turn).
The integration part is set back to 0 as soon as the pint error is 0 again (the robot is right between the black line and the white area).

double threshold = (black + white) / 2;

double pointConst = 1.5;
double diffConst = 1;
double intConst = 0.1;

double intError = 0;
double prevPointError = 0;
int c = 0;
while (!Button.ESCAPE.isPressed()) {
 int currentValue = light.readValue();

 double pointError = currentValue - threshold;
 double diffError = prevPointError - pointError;
 if (pointError < 0) {
  intError += pointError;
 } else {
  intError = 0;
 }

 int error = (int
 ( pointConst * pointError 
 + diffConst * diffError 
 + intConst * intError);

 motorLeft.controlMotor(power - error, direction);
 motorRight.controlMotor(power + error, direction);

 prevPointError = pointError;
}
Download the GLineFollow.java

The same algorithm has been used for both for the Grabber robot and the Stacking robot.
The video below shows the result.

1) The Grabber robot following the line.




2) The Stacking robot following the line.


3) The Grabbing robot and the Stacking robot following the line.



We were considering if we should just mount a black line on top of the stacking robot and just let the other robots follow the line on top of the stacking robot. We might experiment with that next time we meet.

Conclusion

We made the robots follow the black line by mounting light sensors on them and constructing a PID control algorithm. We completed the track. As for the stacking of the robots using Bluetooth it is still a work in progress.

References


[1], PID Control, Chapter 5, pp. 179-190 of Fred G. MartinRobotic Explorations: A Hands-on Introduction to EngineeringPrentice Hall, 2001.

Ingen kommentarer:

Send en kommentar