Converter Cable

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Converter Cable

Postby virgiawanap » Wed Jan 15, 2014 4:03 pm

Hello everyone, I have a problem with my project.
I have a simple code in Lejos :

import lejos.nxt.*;
public class simple{
public static void main(String[] args) throws Exception {
Motor.A.rotate(500);
}
}

Motor A can run and stop normally with the NXT cable, but when I plug this Converter cable, motor A can't stop run. How can I make this motor run normally with the converter cable ? Because I want to make 2 motors run together in 1 motor port.
Please your response .. :)

Image
virgiawanap
New User
 
Posts: 8
Joined: Thu Jan 02, 2014 9:26 am

Re: Converter Cable

Postby gloomyandy » Wed Jan 15, 2014 4:14 pm

As I posted over on the facebook group...

What sort of motors are you running with that cable? Looks like an NXT to RCX cable in which case the RCX motors do not have a tachometer so you can't do things like tell them to rotate 500 degrees, basically you can't use the regulated motor class with them (which is what you get from Motor.A), you should be able to use a simple RCXMotor class with it.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3900
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Converter Cable

Postby virgiawanap » Wed Jan 15, 2014 4:22 pm

Thank you andy for your response here and in facebook. I answered it in facebook, too.. :)

Ya, that's the problem, I'm still using regulated motor class.. But now, I used 2 motorports with code:
Motor.A.rotate(500, true);
Motor.B.rotate(100, true);

And, it's working better..
virgiawanap
New User
 
Posts: 8
Joined: Thu Jan 02, 2014 9:26 am

Re: Converter Cable

Postby gloomyandy » Wed Jan 15, 2014 5:06 pm

So I ask again. What sort of motors are you trying to run with that cable? are you trying to use three of them to attach two standard NXT motors to one motor port? If so there is no chance of this running as a regulated motor as there is no connection for the tachometers via this cable. The motor may run for a while, but there is no way that they will rotate to the requested position.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3900
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Converter Cable

Postby virgiawanap » Wed Jan 15, 2014 6:04 pm

Ya, I did it. But now, I know that it can't work well, so I use 2 motorports with regulated cable, and use the code Motor.A.rotate(200, true); Motor.B.rotate(200, true); so it can run together..
virgiawanap
New User
 
Posts: 8
Joined: Thu Jan 02, 2014 9:26 am

Re: Converter Cable

Postby skoehler » Wed Jan 15, 2014 7:50 pm

virgiawanap wrote:Ya, I did it. But now, I know that it can't work well, so I use 2 motorports with regulated cable, and use the code Motor.A.rotate(200, true); Motor.B.rotate(200, true); so it can run together..

That's still wrong. Why you ask? Because you tell leJOS to rotate Motor.A by 200 degrees. So leJOS tries. It turns on the motor and waits for feedback on how much the motor has rotated. Because the converter cable AFAIK don't allow for such feedback, leJOS will increase the power (cause the motor could be under heavy load) and since there is still no feedback from the motor, leJOS will increase the power even more. All that is called regulatation. And since you use Motor.A (instead of the RCXMotor class that Andy recommended) leJOS must assume that you have attached a type of motor that provides feedback about how much it rotated. Hence, a regulation algorithm is started in the background. However, the type of motors you seem to be using cannot and shouldn't be regulated. Basically, the regulation algorithm goes crazy because of that, and the side effects of that include that you don't really have any control over the motor and the power that the motor is fed with. You have been warned.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Projects

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

more stuff