LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Servo motor gets stuck in loop

Solved!
Go to solution

My project involves the control of two motors based on footswitches using LabVIEW software in combination with UMI 7774 and PCI 7350.

 

I am using a traditional State Machine format to control two motors simultaniously based on absolute position mode. 

In one of the first states, both motors are wound manually using velocity mode (to set them at a desired tension). 

In a later state, the motors are wound to a postion specified by the user when a footswitch is pressed. When the other footswitch is pressed, they are then unwound to the previous "initial position" 

 

The after the first "Tension" state when the motor winding and unwinding due to the footswitches executes, the program gets stuck in the winding state. 

Although the motors are being told to go to a specific position, they never move and therefore the program cannot move on to the next state.

 

I have attached a screenshot of the winding state where the program is getting stuck (Motors are not moving, therefore when the final position is compare with the desired position, the loop continues to iterate). 

 

Please Help. 

 

Cat

0 Kudos
Message 1 of 10
(4,258 Views)

Please don't attach word documents with embedded diagram images. Simply attach the VI instead.

 

  • Who wrote the drivers? Are these commercial third party drivers?
  • What happens in "compare positions.vi"?
  • Why is the upper middle "OR" comparison inside the loop? That needs to be done only once before the loop, because the inputs never change once the loop has started.
  • How does it communicate with the instrument?
  • What's up with all these coercions?
  • etc.
0 Kudos
Message 2 of 10
(4,244 Views)

They are both Kollmorgan AKD ethernet based AC drives. 

 

I have attached the VI

0 Kudos
Message 3 of 10
(4,228 Views)

Can you also attach the "compare positions.vi" and the typedefs?

 

(Why did you add these two shift registers? They don't do anything useful because their value never changes for the duration of the loop.)

0 Kudos
Message 4 of 10
(4,226 Views)

Attached

0 Kudos
Message 5 of 10
(4,216 Views)

I'm stilling having the same problem. 

Any help is much appreciated.

Thanks

0 Kudos
Message 6 of 10
(4,147 Views)

Hello CathyD135,

 

I recommend running the “One-Axis Move with Position Monitor” VI example for each of your winding motors to test their functionality. They should both function as expected when running this example from what I’ve read in your previous posts.

 

You say in your original post that “… the program gets stuck in the winding state. Although the motors are being told to go to a specific position, they never move and therefore the program cannot move on to the next state.” What case specifically is this in your state machine? What is the exact function where execution gets held up? You can use highlight execution to determine this.

0 Kudos
Message 7 of 10
(4,099 Views)

Earl C,

 

I know that the motors function properly, because the entire process work correctly if you bypass the "Wind Left Motor" and "Wind Right Motor" states. 

However, if you first wind the motors to a position, then proceed to the "LBL Wind" or "RBL Wind" states, the motors do not move to the specified position.

As a result, the program gets stuck in the "LBL Wind" or "RBL Wind" state. It's almost as if the motor has been disabled when it reaches the "LBL/RBL Wind" states.

But I know that the motors are still enabled at this point. 

 

Catherine

0 Kudos
Message 8 of 10
(4,077 Views)

Hello Catherine,

 

So if you run the “One-Axis Move with Position Monitor” VI example does each motor wind properly? If you run the example again after winding each motor but with a negative position specified, does each motor unwind properly? You can also try the same using the “One-Axis Move” VI example to test a velocity move. And where in your program or at what VI does execution seem to freeze?

0 Kudos
Message 9 of 10
(4,038 Views)
Solution
Accepted by topic author CathyD135

I fixed the problem.

In states "Wind Left Motor" and "Wind Right Motor" the velocity was being set back to zero. When the program proceeded to the wind/unwind states, the velocity was still zero (motors cannot move).

 

I simply set the velocity to a desired value in each of the LBL/RBL states  (this allowed the motor to travel to the desire position).

 

Thanks for all the help,

Catherine

0 Kudos
Message 10 of 10
(4,027 Views)