Page 1 of 2

Straight lines

Posted: 04 May 2011, 12:28
by huddyyeo
hi, for a project, i need a robot to go in a perfectly straight line.
i am not using nxt motors, but pf m motors. is there a way to sync them together?
i am planning on buying a gyro to help me with that but i wanted to know if there was a better alternative.
i am using nxt-g btw.

Re: Straight lines

Posted: 04 May 2011, 13:39
by webstorms
I'm not sure about the robot's set up, but this is how I would attempt to tell a robot using pf motors to drive in a straight line.

I would place to pf motors parallel to each other, directly attached to two rubber wheels.
Can the Gyro sensor be used in a vertical environment? I'm not sure, so I would connect a Compass sensor instead to take the compass heading.
The program would run the motors at a slow speed forward, if the compass sensor measures slightest movement to the side, the robot shall correct it's coarse and continue with the procedure.

When using this you might find that when traveling long distances, the robot will go forward in the same direction, yet might not be on a straight line from the start, more on a parallel line to the start.
Hope this helps.

Re: Straight lines

Posted: 04 May 2011, 19:02
by mattallen37
The Gyro can measure rate of rotation in any axis.

I would use the compass, because it uses absolute heading instead of rate of rotation (dead reckoning).

Re: Straight lines

Posted: 05 May 2011, 03:37
by bungeshea
If you want arobot to go in a perfectly straight line, you could just use one motor controlling two wheels. :idea:

Re: Straight lines

Posted: 05 May 2011, 05:57
by mattallen37
With one motor, it still won't go completely straight. Due to tolerance and other issues, it will turn slightly, and with only one motor, there would be no way to correct it.

Re: Straight lines

Posted: 05 May 2011, 06:06
by huddyyeo
well its not hard to get absolute heading from a gyro.
just integrate the rate of rotation.
i need my robot to turn as well, so i cant use a single motor.
how about using two of legos old style rotation/angle sensors?
is that a good idea?

Re: Straight lines

Posted: 05 May 2011, 06:25
by mattallen37
If you have available some of the RCX rotation sensors, that might work. However, they are only 16 counts per rotation. They are also awful at missing counts when used with the RCX, with standard 2.0 FW. I have heard that some of the other FW's are a lot better, and perhaps the NXT is as such.

If you don't have them, then don't use them. They retail for around the price of an NXT motor, and you would be better off using NXT motors (built in encoder, much better resolution, no missing counts...).

Re: Straight lines

Posted: 05 May 2011, 06:31
by huddyyeo
the nxt motors are much too slow.
i need a fast motor for my project. how about using a differential from both motors?
so eg when it goes forward, the differential turns but when the robot is turning, the differential stops.
then accuracy wont be needed, so i would have no problems using the rcx rotation sensors
im not really sure how to explain that clearly though...

Re: Straight lines

Posted: 05 May 2011, 17:03
by mattallen37
Too slow? They are as powerful as the large PF motors, so just gear up some.

Re: Straight lines

Posted: 06 May 2011, 04:51
by huddyyeo
gearing up would take too much space. the m motors are small and fast. nxt motors are just too bulky.
the nxt motors just take too much space, especially when my project requires the robot to be as small,accurate and fast as possible.