Page 1 of 1

How to turn accurately?

Posted: 23 Dec 2012, 23:15
by droidzz
I have built the standard quick start robot in the Lego Mindstorms NXT 2.0 set and am having some trouble turning accurately.
If i tell it to do a turn with 90 degrees duration it doesn't actually turn 90 degrees.
I was wondering if someone could help explaining how to calculate the degrees duration to accurately turn a fixed number of degrees like 90, 180 etc

Re: How to turn accurately?

Posted: 24 Dec 2012, 00:13
by aswin0
Hi,

First of all, you'll have to accept never to get a perfect robot.
But then you should find out why it is not so good. Is it the motors, the wheels, the build, the speed?
And then you'll probably know the answer. If not, we're here to help.

Aswin

Re: How to turn accurately?

Posted: 24 Dec 2012, 00:21
by aswin0
Sorry,

Forgot about the calculations. I assume a differential drive.

Code: Select all

// calculate the distance to drive for each wheel
// note that angle is in radians
// note that radius is the distance between wheel and center of the turn 
// note that radius is different for each wheel (larger for outer wheel

Distance = angle * radius


Re: How to turn accurately?

Posted: 24 Dec 2012, 07:53
by droidzz
Thanks for the replies.

What I meant is that in the default lego software i create a move block and tell it to move 90 degrees with the slider all the way to the right on the motor and it will move about 30 degrees and no where near 90 degrees.
So I dont mean that its slightly off and as i understand I might never get it perfectly 90 degrees, but the fact it is so wrong suggests either the software is broken, or more likely my understanding of how it works.

So I am just wondering when I enter 90 it does about 30.

Also I am going to switch to LeJos soon as I am a Java developer professionally and am wondering if it works more accurately with that than the default Lego software?

Re: How to turn accurately?

Posted: 24 Dec 2012, 08:26
by h-g-t
The 'Move' block rotates the motor by 30 degrees, not the robot.

What the robot does depends on whether you have a differential fitted, the size of the tyres, distances between wheels, slipperiness of the wheel/ surface, etc.

This has already been covered in recent threads so I suggest that you have a look through the forums.

Re: How to turn accurately?

Posted: 25 Dec 2012, 22:34
by droidzz
Thanks for the replies.
I did a search but only found 1 related post here https://sourceforge.net/apps/phpbb/mind ... ing#p12063
so I will continue the discussion in that existing thread.