LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using speed control to position a lead/ball screw through servo motor

I am using ASDA-AB servo driver with servo motors to control a x/y stage. In my current setup I am using USB-6341 as a Controller for the stage. The servo drivers are set in speed control mode. Thus by sending analog voltage signals, I can control the rotational speed of the motor. As for the stage, it's linear motion is guided by a lead screw with pitch of 10mm. So for each rotation it moves 10mm forward. The encoder that came with the servo provides 2048 pulses per revolution so, basically that gives me a measurement resolution of 0.005mm when converted to linear motion. 

So, I am stuck at part of the using the speed control to position the lead screw. Unlike position control where I have used pwm signals to control the position, this setup only allows me to control the analog output voltage (rpm of the servo) and I can use the encoder reading(difference encoder) as a feedback. But I am not certain about the mathematical part of this control. 

1. I need some suggestions or references if anyone has tried this kind of setup before and can help me with the control loop? 

I have already used NI motion controller in past so, I am aware that I cannot use softmotion module with USB devices. 

Thank you for any suggestions.

0 Kudos
Message 1 of 10
(3,843 Views)

Hi kumar,

 

just some thoughts:

When you want to move your stage in the positive direction you need to set a positive speed.

When heading for negative direction you set a negative speed.

When the distance between current position and target is large you might set a higher speed than for smaller distances…

You might even use a simple PID to control the position of your stage…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,795 Views)

Thank you for your time and advice. I tried the above said logic. Actually the positions are part of a contour. So basically, when I use the point to point move using the  above said logic. The motors starts and stops several times. So, I am trying to eliminate occurrence of these jerk motions. I am trying to achieve a smooth motion on the stage. So, I am not sure how to get there.

 

0 Kudos
Message 3 of 10
(3,774 Views)

Hi kumar,

 

The motors starts and stops several times. So, I am trying to eliminate occurrence of these jerk motions.

Simple: don't start and stop the motor several times per movement…

 

I am trying to achieve a smooth motion on the stage.

NI is selling full-blown modules (aka Softmotion) for this very purpose. So you have several options:

- Buy the module/toolkit license

- develop your own software

 

I guess your servo driver does support better use schemes than just "start-move-stop". Read its manual and develop better software!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(3,764 Views)

Thanks for the suggestion again. I am aware of motion control cards and softmotion module. I have used those in past. I guess, i am out of luck this time, since i am stuck with the project budget. I am work through this by comprising speed for precision. 

 

0 Kudos
Message 5 of 10
(3,755 Views)

To control the speed, you need to learn how to calculate the current speed and learn how to set the rotation at a given speed. The current speed is calculated as the difference in positions over a certain time interval. The speed control is performed by feeding the specified PWM signal. These two signals and another speed reference is a necessary and sufficient set for implementing the PID controller. In fact, in the classical problem of controlling the motor there are three feedback loops. The lowest is the torque control of the motor (via current and position sensor). The next above it is speed control (through the torque and position sensor). And most recently - position control (via speed and position sensor). To control the position, the PID output of the controller is the speed. For speed control, the PID output of the controller is torque.

Labview 4.0, 5.0, 6.1, 8.6, 2009, 2011, 2012, 2014
If you do not know something, ask me.
0 Kudos
Message 6 of 10
(3,747 Views)

following your instructions and going through some motion control papers. I build up following code. it basically read the first position from the array and then after PID reaches the set point it changes the setpoint to the next value. but there is only setback for this control is that it waits until the PID reaches setpoint. which sometimes cause the xy table to stop and start at some points if PID takes a while to reach the defined tolerance. I am wondering if there is a way around this. Like a continuous motion. 

Thank you for all your advice.

Download All
0 Kudos
Message 7 of 10
(3,718 Views)

Hi kumar,

 

uh-oh: race condition alarm!

Why do you use so many local variables? In parallel to accessing their terminals???

Clean up your VI, replace locals by wires!

 

I am wondering if there is a way around this. Like a continuous motion. 

Sure you can reach "continuous motion". But then you should not wait for reaching certain points with a small tolerance…

(You may calculate the whole movement in advance without any "stop points" in between. You know this Softmotion module?)

 

- Beside your race conditions you also have some Rube-Goldbergs in your code! One of them being the classical R-G of a select function to output TRUE or FALSE when the input is TRUE or FALSE, respectively…

- Why is the dt of the PID functions set to 10ms when you have a 5ms wait function in your loop?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 10
(3,712 Views)

Thank you for you input, GerdW.

but wouldn't I need a supported motion control cards to use the softmotion module? or there is a way around this? 

I will work on the race condition and things you pointed out. Thank s again, you are great help.

0 Kudos
Message 9 of 10
(3,690 Views)

Hi kumar,

 

wouldn't I need a supported motion control cards to use the softmotion module?

I guess so, haven't worked with yet.

I just wanted to point out: you are trying to start a software development that other people already did. (Just add the cost of the Softmotion module and the additional hardware cost for supported drives and divide by your own cost (income per hour) to know, how long you can work on just this topic…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 10
(3,674 Views)