05-02-2013 06:56 AM
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.
05-03-2013 06:04 PM
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.
05-06-2013 09:24 AM
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.
05-07-2013 03:22 AM
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?
05-08-2013 03:03 PM
Is the motor that's jumping the same motor each time? Does this occur each time you run the program or only sometimes?
05-09-2013 08:42 AM
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.
05-10-2013 04:50 PM
Do you mean that you've switched the axes or that you've set both motors to axis 2?
05-13-2013 06:41 AM
Just switched them.
05-15-2013 10:43 AM
Try taking a look at this KB. It describes how to synchronize stepper motor axes.
05-16-2013 03:18 AM
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.