2

Author Topic: How to make Robot sensitive to direction....  (Read 591 times)

0 Members and 1 Guest are viewing this topic.

Offline RITESH29Topic starter

  • Robot Overlord
  • ****
  • Posts: 152
  • Helpful? 0
How to make Robot sensitive to direction....
« on: January 18, 2012, 07:08:02 AM »

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: How to make Robot sensitive to direction....
« Reply #1 on: January 18, 2012, 08:08:50 AM »
Hi there

Gyro will not show direction as it outputs angular velocity detected around axis. You can use it, but it will difficult and not very precise.

Accelerometer is useful only when robot is moving, otherwise it will output 1G along vertical axis. If Your robot does not use omniwheels, accelerometer can be used to determine if robot is going backward or forward and angle of the turn when it's turning (not applicable for differential drive bots). If robot uses omniwheels and does not rotate around any axis, 2 axis accelerometer will indicate movement in 2D plane and You will be able to know which direction it is heading to.

To know absolute direction of movement of a robot which has front and back (like a car) and does not go sideways - compass is the way to go.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline RITESH29Topic starter

  • Robot Overlord
  • ****
  • Posts: 152
  • Helpful? 0
Re: How to make Robot sensitive to direction....
« Reply #2 on: January 18, 2012, 08:11:07 AM »
HI,

I want to make a bot called automatic which will move with help of Encoder and Line follower it has to rotate also in 90* so, i was thinking to use it!!!

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: How to make Robot sensitive to direction....
« Reply #3 on: January 18, 2012, 08:37:03 AM »
Using gyro or accelerometer will be difficult to get robot to turn exact amount of degrees. With compass it will be very easy.

Code: [Select]
currentAngle = getCurrentAngle(); //relative to north

turnCW(motor1);
turnCCW(motor2);

while (getCurrentAngle() != curentAngle -/+ 90) //modular arithmetics will be required
{} //do nothing

stopMotor(motor1);
stopMotor(motor2);

Something like that.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

 


Get Your Ad Here