SyncMotors

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

Moderators: 99jonathan, roger, imaqine

SyncMotors

Postby sven » Fri Mar 02, 2012 7:59 pm

Hello, everyone!
First of all: I am sorry for possible linguistic mistakes because i am from Germany.
My question is:
How can i control 2 Motors at the same time?
I have already heard of the class SyncMotors that is provided by icommand 0.5 , but i don´t want to use this outdated library.
Is there any other way?
sven
New User
 
Posts: 3
Joined: Fri Mar 02, 2012 7:37 pm

Re: SyncMotors

Postby Aswin » Sat Mar 03, 2012 1:06 am

Hi,

In the current release of Lejos each motor is synched against time. Time is the same for all. As a consequence all three motors are synched to each other. Only regulated motors are synched. There is no need to activate it.
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: SyncMotors

Postby sven » Sat Mar 03, 2012 8:55 am

Ok... but which classes or methods do i have to use to start or stop 2 Motors at exactly the same time?
sven
New User
 
Posts: 3
Joined: Fri Mar 02, 2012 7:37 pm

Re: SyncMotors

Postby Aswin » Sat Mar 03, 2012 11:19 am

You'll have to apply the forward method and the stop method to each of the motors. If you make sure that you apply them right after each other then this so little time between them that this will not have any effect.
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: SyncMotors

Postby sven » Sat Mar 03, 2012 11:48 am

I´ve already tried this, but because of the little Time difference between the two Motors, the Robot turns ca. 10 degrees.
sven
New User
 
Posts: 3
Joined: Fri Mar 02, 2012 7:37 pm

Re: SyncMotors

Postby kirkpthompson » Sat Mar 03, 2012 2:14 pm

Set the immediateReturn param to true on the first stop().

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

Re: SyncMotors

Postby skoehler » Sat Mar 03, 2012 2:16 pm

sven wrote:I´ve already tried this, but because of the little Time difference between the two Motors, the Robot turns ca. 10 degrees.

Are you using Bluetooth to remote-control the NXT?
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: SyncMotors

Postby Aswin » Sat Mar 03, 2012 11:31 pm

10 degrees is a lot. You should check the mechanics.
You could lower the maximum acceleration of the motors. There is a method to do so.
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff