Society of Robots - Robot Forum

Software => Software => Topic started by: RITESH29 on January 18, 2012, 07:08:02 AM

Title: How to make Robot sensitive to direction....
Post by: RITESH29 on January 18, 2012, 07:08:02 AM
Hi All,

I want to make the robot sensitive to direction in X and Y, I have found these Dual Axis Gyro Module
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=288&zenid=ea3264b3432e30fb2fb8781c2d060a47 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=288&zenid=ea3264b3432e30fb2fb8781c2d060a47)

or 1.5G/2G/4G/6G 3 Axis Linear Accelerometer Module
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=39&zenid=ea3264b3432e30fb2fb8781c2d060a47 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=39&zenid=ea3264b3432e30fb2fb8781c2d060a47)


Title: Re: How to make Robot sensitive to direction....
Post by: newInRobotics 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.
Title: Re: How to make Robot sensitive to direction....
Post by: RITESH29 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!!!
Title: Re: How to make Robot sensitive to direction....
Post by: newInRobotics 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.