motor float/stop question and/or issue

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

motor float/stop question and/or issue

Postby kirkpthompson » Wed Jan 16, 2008 1:45 pm

Hi All.

When I power up the NXT (w/LeJOS firmware), the motor (on any motor port) is much less "moveable" that when the NXT is powered off so it appears that they are getting some amount of power to hold them in place. It's not like a .stop() where it is pretty difficult to rotate the motor but it's not like if the motor is not plugged in where it rotates much easier.

This happens without even running a program first... right from a clean startup. When I run code and do a .flt(), it still is resistant to be manually rotated.

I tried this on a NXT brick that has the Lego firmware 1.05 and the motor rotates freely (until of couse I program it not to and run the program). Does this make sense?

Thnx.

-K
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby gloomyandy » Wed Jan 16, 2008 3:21 pm

Hi,
The current firmware, resets the motor drive between application programs and at startup. Currently it sets the motor into brake mode (so the motor is being "driven" with 0V on each of the supply lines). However if your application switches to float mode then so long as your application is running the motor should be free to turn. If this is not the case (and you are not driving the motor in some other way), then it sounds like there could be a problem. If you have a small test program that shows the problem then please post it and we can take a look....

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

Postby kirkpthompson » Wed Jan 16, 2008 3:27 pm

Hi Andy. Try this: Plug a motor into the NXT, put a axle in it w/ a gear, turn it by hand to get a feel for the freedom of movement.

Now, just turn on the brick and notice the difference.

Let me know...

Thnx.

-K
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby gloomyandy » Wed Jan 16, 2008 4:13 pm

Hi Kirk,
No I understand that things are different when at the start-up menu that is to be expected. My question was more what happens when you run an app and set the mode to float. Is there still a difference? If there is then changing the firmware to set float mode may not help (because the firmware would just be doing what your app has done.).

For 0.5 there are two changes in this area...
1. To support the returning to the menu after a program exits, the firmware resets various bits of the hardware. As part of this it currently sets the motors to brake mode.
2. In 0.5 there are a number of changes to the Motor classes (which also use brake mode in some cases).

So what I'm trying to understand (with your help) is if we have one difference or two! If you can get the results you expect (or used to have), by in your application setting float mode, then it is probably just the reset change that you are seeing. However if setting float mode does not give the expected results, then perhaps some of the changes in the motor code are also having an impact...

Hope that makes some sort of sense....

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

Postby kirkpthompson » Wed Jan 16, 2008 7:37 pm

Hi Andy.

When I get home tonight after work, I will write a test case and report back.

I was working on some motor behaviour baselining stuff when I discovered this and I can tell you that before my program exits, it sets the motor to float with the .flt() method. The motor still feels like it is "binding" (not a very good word.. "semi-powered?" ".stop()"ed?).

I'll get back to you...

-K
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby roger » Wed Jan 16, 2008 7:58 pm

Hi Kirk and Andy,
I just ran a test program with the fragment
Motor.A.flt();
Button.waitForPress();

The axle turns freely till press a button, then it is difficult to turn.
I assume your brick will do the same.
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Postby gloomyandy » Wed Jan 16, 2008 8:12 pm

Hi Roger/Kirk,
Just to clarify... What happens to the program after you press the button? Does it exit back to the menu? If so that would make sense because the firmware wold reset the hardware to bake mode...

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

Postby roger » Thu Jan 17, 2008 12:00 am

Yes, after the button press, the program exits to the main menu.
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Postby kirkpthompson » Thu Jan 17, 2008 3:02 am

Roger, Andy,

I got the same result as Roger in his test.

-K
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby gloomyandy » Thu Jan 17, 2008 12:51 pm

Hi again!
So it sounds like the only problem we have here is the change in the default state following a reset. Is this correct? So what do you guys think. Should we change things so that after a reset we are in float mode? It's an easy change to make....

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

Postby kirkpthompson » Thu Jan 17, 2008 1:46 pm

Hi all!

Yeah, I think changing the "rest" state to float would be good. That way, we aren't using as much battery when the unit is idle.

I saw another post concerning smoothAcceleration. Could this be related to the idle state .stop()?

http://lejos.sourceforge.net/forum/viewtopic.php?t=669

Thnx.

-K
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby gloomyandy » Thu Jan 17, 2008 3:10 pm

Hi again,
Just one quick note. Brake mode probably does not use any more power than float mode. In Brake mode both motor outputs are held at 0V (so in effect they short out the motor windings, it is this that makes the motor hard to turn), so there is no current flow through the motor. In float mode the motor outputs are just allowed to float. In both cases the actual motor drivers are still powered on, so I don't think that there should be any real difference in battery usage. I guess the driver may consume slightly more power in brake mode (but that will be down to the design of the motor driver, some consume more power in float mode....).

But I tend to agree that having the default state be float mode as it was before makes sense....

I think Roger is currently looking into the acceleration issues....

All the best...
Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4240
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby kirkpthompson » Thu Jan 17, 2008 4:06 pm

Ok. Thnx for the hardware lesson :)
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff