Society of Robots - Robot Forum
Software => Software => Topic started by: byuri on February 02, 2009, 01:18:01 PM
-
Hello, I need help with the code of the 50$ robot.
How to make robot turn around in 90 degrees?
I tried the following code
void robot_spin_right(void) //robot spin right 90 degrees
{
for (i=0 ; i<19 ; i++)
{
robot_turn_right();
delay_cycles(1000);
}
}
But there is a problem with this code. If the battery full, it spins about 90 degrees,
but as the battery voltage falls down the robot is not able to complete the spin.
Someone has an idea how to help me?
-
Are you powering your MCU with a Voltage Regulator or raw battery power?
-
Yup.... but you gotta let yourself in some deeper water....
To do an exact 90 degree spin you need encoders...
encoders are like switches that measure a certain amount of "clicks" per revolution of one wheel...
Google about encoders and servos.... NOTE that RC servos are NOT real servos... They are a hybrid...
A real servo let's you know the position of the motor or it's speed... RC servos get a pulse and you assume
it will run at the speed requested.... :P
So do a little goggle and we will help you out more if we can!!! :P
Cheers!!!
-
Good point, some really easy to use motors and encoders to use would probably be:
Encoders from Solarbotics:
http://www.solarbotics.com/motors_accessories/wheels/3/ (http://www.solarbotics.com/motors_accessories/wheels/3/)
EDIT: from what I've been told via email from Dave at SB, they are either re-vamping the design of them or canning 'em for good.
Motors like these ones from them fit perfectly with it:
http://www.solarbotics.com/products/gm8/ (http://www.solarbotics.com/products/gm8/)
-
Also you could use a magnetic compass sensor.
-
Or you could use stepper motors
-
i read about wave_front tutorial
http://www.societyofrobots.com/programming_wavefront.shtml
Admin use iRobot and like i saw at the movie, the robot spin exactly 90 degrees.
did Admin use encoders or digital compass to rotate the robot?
-
i read about wave_front tutorial
http://www.societyofrobots.com/programming_wavefront.shtml
Admin use iRobot and like i saw at the movie, the robot spin exactly 90 degrees.
did Admin use encoders or digital compass to rotate the robot?
The iRobot Create uses encoders . . . attached to a stretchable rubber belt . . . so the accuracy was horrible . . .
Anyway, its impossible to rotate 90 degrees exactly every time:
http://www.societyofrobots.com/robot_faq.shtml#robot_accuracy_tradeoff