Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

running two motors in the reverse directions

Hi,

I am controlling two step motors with the vi I attached in the post. This application runs the motors seperately. But I want the left pusbutton to run the first motor in the forward direction and the second motor in the backward direction at the same time.

And the right pushbutton should do the opposite movement.

 

Could you please help me with this issue.

 

Best regards.

0 Kudos
Message 1 of 11
(7,394 Views)

Hi ozenc,

 

I noticed that you were using two parallel loops, one for each motor. It might be more useful to use just one loop for both motors, especially since both loops appear to be running at the same speed. Then it would be easier for you to use case structures to control the motors.

 

 

When your left button is pressed, you can have the motors going in their respective directions, and then have them reverse those directions when the right button is pressed based on a case structure.

 

0 Kudos
Message 2 of 11
(7,365 Views)

Hi Burrito,

 

I attached a picture which is explaining the top point I am trying to go. There should be four buttons such as on a Playstation joystick.

 

I first tried to use one loop for the two motors, it worked. But when I try to add the second button it doesn't work, the motors can not run properly they run with gaps or do not run.

The VI which can run for left button(hiz kontrolu2eksencopy2) and the VI which I am triyng to run for and right button(hiz kontrolu2eksen2buton) 

 

I want to use case structures but I don't know how to use multicases, I think there are four cases here (Four buttons). 

 

Could you please give me an advise about this issue?

 

Best regards.

0 Kudos
Message 3 of 11
(7,346 Views)

I have solved this problem by using enum control as in the attached VI. But I have one more problem, one of the motors is jumping at the start I think I am missing one switch or button to be disabled at the beginning. But I can't find it. Could anyone please help me?

0 Kudos
Message 4 of 11
(7,327 Views)

Is the motor that's jumping the same motor each time? Does this occur each time you run the program or only sometimes?

0 Kudos
Message 5 of 11
(7,297 Views)

It always occurs when I just (at the first second) run the program then it doesn't during the program runs. The same motor is jumping but when I change the axis1 to axis2 the other motor is jumping as the first one.

0 Kudos
Message 6 of 11
(7,282 Views)

Do you mean that you've switched the axes or that you've set both motors to axis 2? 

0 Kudos
Message 7 of 11
(7,272 Views)

Just switched them.

0 Kudos
Message 8 of 11
(7,255 Views)

Try taking a look at this KB. It describes how to synchronize stepper motor axes.

0 Kudos
Message 9 of 11
(7,237 Views)

Dear Burrito,

 

Thank you very much for your helps, but there is no problem about the synchronise running of the motors. They can run very well but one of the motors (always the same axis) is trying to run very fast immediately I press the run button. And after a very short time it stops, then I can run as I want. But this uncontrollable run is a troubleshoot for my system.

 

0 Kudos
Message 10 of 11
(7,227 Views)