1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

How to turn accurately?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.

How to turn accurately?

Postby droidzz » 23 Dec 2012, 23:15

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
droidzz
 
Posts: 11
Joined: 23 Dec 2012, 22:36

Re: How to turn accurately?

Postby aswin0 » 24 Dec 2012, 00:13

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

Re: How to turn accurately?

Postby aswin0 » 24 Dec 2012, 00:21

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

Re: How to turn accurately?

Postby droidzz » 24 Dec 2012, 07:53

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?
droidzz
 
Posts: 11
Joined: 23 Dec 2012, 22:36

Re: How to turn accurately?

Postby h-g-t » 24 Dec 2012, 08:26

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

Re: How to turn accurately?

Postby droidzz » 25 Dec 2012, 22:34

Thanks for the replies.
I did a search but only found 1 related post here viewtopic.php?f=4&t=1313&start=0&hilit=turning#p12063
so I will continue the discussion in that existing thread.
droidzz
 
Posts: 11
Joined: 23 Dec 2012, 22:36


Return to Mindstorms Software

Who is online

Users browsing this forum: No registered users and 0 guests