Motor Freezes

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

Motor Freezes

Postby Eva » Thu Jan 13, 2011 10:49 am

Hi,

I am working on a project for school, a balancing lego robot.
But i run into a problem that keeps coming back.

The motor's freeze for a couple of seconds and goes on.

this only happens when it is actually on the ground and try's to balance.
when I hold it in the air, and move it around a bit it does not happen.

It is very annoying because it trips the robot over every time it happens.

Anyway, I hope one of you guys know what the problem is.

With regards
Eva
Eva
New User
 
Posts: 4
Joined: Thu Jan 13, 2011 10:44 am

Re: Motor Freezes

Postby skoehler » Thu Jan 13, 2011 10:54 am

Just a hint:
My crystal ball tells me, that you might be adjusting the speed of the motor, instead of the power. You should turn off speed regulation, and adjust the power of the motor instead.
skoehler
leJOS Team Member
 
Posts: 1418
Joined: Thu Oct 30, 2008 4:54 pm

Postby Eva » Thu Jan 13, 2011 10:56 am

Thank you for your quick reply,

I am indeed using the setSpeed, and i will try to use the setPower.

with regards
Eva
Eva
New User
 
Posts: 4
Joined: Thu Jan 13, 2011 10:44 am

Postby Eva » Thu Jan 13, 2011 11:14 am

So, i use the regulateSpeed(false) and the setPower instead of the setSpeed, and it still freezes sometimes.

Although less then before.


It is pretty weird, I do a calculation to calculate the error and draw that on the screen,
and when the 2 motors freezes those calculations do go on and the screen gets update.
and correct me if i am wrong but that means that the loop is still running but the motors do not respond right?

With regards
Eva
Eva
New User
 
Posts: 4
Joined: Thu Jan 13, 2011 10:44 am

Postby gloomyandy » Thu Jan 13, 2011 11:40 am

The NXT hardware has a built in thermal limit that will stop the motor controllers from being damaged. One way to trigger this is to rapidly change the power settings to the motors by a large amount, particularly when they are in a semi stalled state. This is really easy to do when writing control code for a balancing robot (because in effect the motors are virtually stalled all of the time)... I had this problem when writing the code for my own balancing robot.

The good news is that if you are getting into this state you are almost certainly doing things wrong in the control algorithm. When a robot is balancing you actually need to make only very small changes to the power output, and the output is very rarely at 100%. So once you have your control algorithm right this problem will probably go away...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby Eva » Thu Jan 13, 2011 11:52 am

Thank you,

That is something I was already thinking about, but I did not know it was due to the rapid power change to the motors.
I am going to work on my algorithm and hope I figure it out,

With regards
Eva
Eva
New User
 
Posts: 4
Joined: Thu Jan 13, 2011 10:44 am


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff