Smoother Turning with high speed servos.
I am working on a line following project for a robotics class. We're using an Activitybot (not 360) with NO speed sensors on the wheels. We are using only 2 line sensors.
[img][/img]![40510594181_7639df6c0e_b.jpg](https://farm5.staticflickr.com/4710/40510594181_7639df6c0e_b.jpg)
When the bot detects the line, reverses one wheel to turn, then goes straight again. I am thinking that the robot would complete the track faster if one wheel was slowed rather than reversed. I have added the following "constant" to the setup block
![39615696145_8c8561c825.jpg](https://farm5.staticflickr.com/4703/39615696145_8c8561c825.jpg)
And changed the functions to:
![40510768711_71c093bf8f_b.jpg](https://farm5.staticflickr.com/4626/40510768711_71c093bf8f_b.jpg)
If the Delta = 2 X speed, the program is functionally the same as the previous code. My thought is that a lower delta would cause a more gentle turn back to the track, but its not working. If delta is near to 2 X speed it works exactly the same. If I set the delta to a significantly lower value it does not follow the line at all.
In short, is there a way to make the activity bot make a smooth turn rather than stopping and pivoting? Would this result in a hightr speed through the turns
[img][/img]
![40510594181_7639df6c0e_b.jpg](https://farm5.staticflickr.com/4710/40510594181_7639df6c0e_b.jpg)
When the bot detects the line, reverses one wheel to turn, then goes straight again. I am thinking that the robot would complete the track faster if one wheel was slowed rather than reversed. I have added the following "constant" to the setup block
![39615696145_8c8561c825.jpg](https://farm5.staticflickr.com/4703/39615696145_8c8561c825.jpg)
And changed the functions to:
![40510768711_71c093bf8f_b.jpg](https://farm5.staticflickr.com/4626/40510768711_71c093bf8f_b.jpg)
If the Delta = 2 X speed, the program is functionally the same as the previous code. My thought is that a lower delta would cause a more gentle turn back to the track, but its not working. If delta is near to 2 X speed it works exactly the same. If I set the delta to a significantly lower value it does not follow the line at all.
In short, is there a way to make the activity bot make a smooth turn rather than stopping and pivoting? Would this result in a hightr speed through the turns
Comments
When one sensor detects the line, the bot starts a shallow turn that does not return to the line fast enough. Both sensors then lose the line and the bot takes off in a straight line.
If this is true, is that why the Parallax implementation uses 4 sensors?
If so, is a delta closer to but still less than 2 X speed likely to make the circuit of the track any faster?
I've not used the Activity Bot for line following, but I've done a number of them over the years, and I've found reversing the motor to be pretty drastic unless you have a larger array, and it's the outside sensors that are picking up the line. I've done it with eight sensors (Pololu makes an 8-sensor strip), where in software the sensors are weighted from the center. The higher the weighting, the more differential is applied to the wheels.
For just two sensors, try half speed to veer off, or at worse, turn the motor completely off, but do so only very briefly (e.g. 5-10 milliseconds).
Also, consider coding a loose circle when neither sensor picks up the line. That way your robot can attempt, however feebly, to reacquire the line.
-- Gordon
Unfortunately, the midterm is a race and just sticking with the existing code will be faster than reacquiring.
This bot used a single 555 timer to vary the duty cycle to each motor. Very smooth, but huge turning radius.
Hmm. On most of these when the robot can't find the line again (from about where you left off) you're disqualified anyway. Going straight is like giving up. Or maybe in the rules of this race losing the line is a disqualifier no matter what, so you might as well drive off the course.
You might also consider adding some state memory to your algorithm. You can keep a repeating cycle of the last couple of steerings. If the robot suddenly loses the track altogether, you have a reasonable chance of undoing the overcorrection. You just need to record that you last veered right or left, and then apply the opposite correction in the hopes of getting the line again.