View unanswered posts | View active topics It is currently Thu Oct 23, 2014 5:19 am






Reply to topic  [ 9 posts ] 
Help 
Author Message
Rookie

Joined: Tue Sep 25, 2012 8:38 am
Posts: 4
Post Help
I know this is a ROBOTC forum but I have a question concerning programing in NXT. I've posted on several NXT forums with no help at all.
I purchased 12 Lego Mindstorms education kits and NXT 2.1 programing for my classroom. I am having trouble with several of the NXT robots not running properly. For example we program the robot to run a maze and it will not run a consistent pattern. One time it will run perfect the next it will stop several inches away from the original stopping area. We are running the motors at 75%. At first I thought it was just the students not lining the robots up properly so I built a jig/fixture to make sure it is in the exact spot each time we ran it. Unfortunately this did not help….Any suggestions


Tue Sep 25, 2012 9:32 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Help
Are you using timing, or degrees/rotations to define the motor movement?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Sep 25, 2012 9:43 am
Profile WWW
Rookie

Joined: Tue Sep 25, 2012 8:38 am
Posts: 4
Post Re: Help
degrees and rotations


Tue Sep 25, 2012 9:57 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Help
There are several reasons why this could be happening. One is that the wheels are slipping, causing the robot to go off course. Another is that the batteries are low, and the motors aren't going as far as they are supposed to, and NXT-G just says "whatever, close enough". The last one is that the NXT motor encoders aren't very accurate, and it is drifting to the point that is goes noticeably off-course. Or, it could be a combination of all three factors.

What you are trying to do is called "dead-reckoning" which, without a point of reference (such as a compass or a GPS) is very inaccurate.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Sep 25, 2012 10:03 am
Profile WWW
Rookie

Joined: Tue Sep 25, 2012 8:38 am
Posts: 4
Post Re: Help
Thank you for your input. Is there anything I can do to increase the accuracy of the NXT motor encoders?


Tue Sep 25, 2012 10:24 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 593
Post Re: Help
One thing I recommend is to try running the robot at a slower speed. As NeXT-Generation has correctly stated, the wheels on any robot always have a chance to slip (depending on a variety of factors). With the NXT robots being made of light-weight plastic, the chance for them to slip or drift past their target is a real concern. Slowing the motor speed down a bit helps compensate for this, at the cost of a longer program run time.

These inaccuracies (wheel slippage, drifting, motor encoder resolution) also lead to what is called accumulated error. Accumulated error is when a slight deviance in expected performance builds up over a period of time which results in poor performance. For instance, let's say that the robot is stopping 1/10th of a inch short before each turn or stage of the program. While 0.1 inch doesn't look like much on the first stage (it may well not even be noticeable to the students), by the second stage there is another 0.1 inch difference, for a total of .2 inches. The third stage will net a 0.3 inch error, the 4th stage 0.4, etc. By the end of a long program the robot may be well off target because of all the small, seemingly insignificant errors. Likewise, a turn that is 1 degree off will seem like it has turned correctly, but by the end of the program they can result in the robot running into a wall or off the edge of a table.

This is actually a good transition into the some of the problems that students will inevitably face with robots. No matter how complex or expensive the robot will be there is always room for error. This is why you'll never see a sensor with '100% accuracy', because there are always conditions that will introduce varying degrees of error into the equation. That being said, there are usually clearly superior ways of doing things (programming with motor encoders will trump coding for power and time almost always) that help minimize the amount of error introduced into the robot.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Tue Sep 25, 2012 10:47 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Help
Not really. You can use gearing to slow down the output, and thusly increasing the encoder counts per wheel rotation. Say you connect an 8-tooth gear to the motor, and a 24-tooth gear to the wheel. This will provide a 3:1 gear ratio, meaning it takes 3 rotations from the motor for the wheel to move 1 rotation. This means that the wheel will move 3 times slower, but it will also mean that the drift will make 3 times less of a difference.

EDIT: Ninja'd by John.
EDIT AGAIN: Actually, not really because the content of each post is different.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Sep 25, 2012 10:49 am
Profile WWW
Rookie

Joined: Tue Sep 25, 2012 8:38 am
Posts: 4
Post Re: Help
Thanks for everyone’s input. We are currently running at 75% power. I will have the students lower it and see if that helps. Should I recharge the batteries every day? And I also forgot to mention we are running the REMbot for our projects...really do not know if that is any of the problem


Tue Sep 25, 2012 11:04 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 593
Post Re: Help
I would suggest running at 50% power to see if that helps. With the REMBot, make sure that rear caster wheel is pointed 'back' when starting so it doesn't have to swivel from the start. Otherwise it can cause just enough friction to throw the robot off course.

Charging the batteries every night is not a bad idea, either; if you are running multiple classes though, the earlier classes may get different results than the later classes due to battery drain throughout the day.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Tue Sep 25, 2012 11:46 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.