Motor Question

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

Moderators: roger, imaqine, 99jonathan

cheung_carmen
New User
Posts: 2
Joined: Fri Nov 09, 2007 12:22 am

Motor Question

Postby cheung_carmen » Thu Mar 06, 2008 11:42 am

hi,

Is any one can tell me wat is the max value of the tacho count could be and as in the api said the motor has two mode smooth acc. and speed reg. wat happen if they both switch on and off.

Many Thx
Carmen

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

Postby kirkpthompson » Thu Mar 06, 2008 2:24 pm

probably the max size of an signed integer (int) since that is the return datatype. Integer.MAX_VALUE is in the API docs. It is 2,147,483,647.

roger
Moderator
Posts: 372
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: Motor Question

Postby roger » Thu Mar 06, 2008 8:19 pm

Hi Carmen
cheung_carmen wrote: the api said the motor has two mode smooth acc. and speed reg. wat happen if they both switch on and off.
Smooth acceleration only works when speed regulation is on. Speed regulation works by comparing the tacho count with speed times elapsed time, and adjusts the motor power to keep these two closely matched. Smooth acceleration compensates for the fact that it takes a while for the motor to reach the desired speed. If it is turned off, the speed regulation will initially apply very high power to make up for the acceleration lag.
If you want a 2 wheel robot it to travel in a straight line, you will have more success with speed regulation on, which is why it is the default mode. Try building a 2 wheel robot and do some experiments.
Roger

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

Postby kirkpthompson » Fri Mar 07, 2008 4:40 am

This is good information. Could you please include this in the code javadoc comments?

-K


Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 2 guests