Straight lines

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
huddyyeo
Posts: 7
Joined: 09 Apr 2011, 09:08

Straight lines

Post 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.
webstorms
Posts: 38
Joined: 10 Mar 2011, 15:27

Re: Straight lines

Post 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.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Straight lines

Post 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).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
bungeshea
Posts: 207
Joined: 14 Aug 2011, 08:45
Location: Australia
Contact:

Re: Straight lines

Post by bungeshea »

If you want arobot to go in a perfectly straight line, you could just use one motor controlling two wheels. :idea:
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Straight lines

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
huddyyeo
Posts: 7
Joined: 09 Apr 2011, 09:08

Re: Straight lines

Post 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?
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Straight lines

Post 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...).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
huddyyeo
Posts: 7
Joined: 09 Apr 2011, 09:08

Re: Straight lines

Post 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...
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Straight lines

Post by mattallen37 »

Too slow? They are as powerful as the large PF motors, so just gear up some.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
huddyyeo
Posts: 7
Joined: 09 Apr 2011, 09:08

Re: Straight lines

Post 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.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests