How to turn accurately?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
droidzz
Posts: 11
Joined: 23 Dec 2012, 22:36

How to turn accurately?

Post 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
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: How to turn accurately?

Post 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
My blog: nxttime.wordpress.com
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: How to turn accurately?

Post 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

My blog: nxttime.wordpress.com
droidzz
Posts: 11
Joined: 23 Dec 2012, 22:36

Re: How to turn accurately?

Post 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?
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: How to turn accurately?

Post 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.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
droidzz
Posts: 11
Joined: 23 Dec 2012, 22:36

Re: How to turn accurately?

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

Who is online

Users browsing this forum: No registered users and 7 guests