07-20-2015 10:59 AM
Hello,
I am trying to implement a position control on linear actuator controlled by servo motor based on the position feedback. I am using timed loop with scan engine mode having 100Hz freq.
The goal is to acheive position control and after reaching the desired force value of sensor, it should stop its position movement
How to program the loops to control the actuator movement when I set certain desired postion and force?
Thanks in advance
07-21-2015 12:14 PM
Hi ritzi,
That sounds like an interesting application. I would recommend implementing the position control first and adding the force feedback after the position control is implemented. Please see the below link for an example to get started.
07-21-2015 02:44 PM
Thank you for the reply. But I am already done with all the required setup and configurations.
My query is how to run two loops in following manner -
1) The first loop will solve the first order differential equation which will give us the desired position and velocity. Then these values will be given as an input to second loop.
2) Now, in the second loop, we should be able to move actuator to the position specified by first loop output. This second loop should run in real time. Also this loop will have feedback from actuator position.
I am stuck because I dont have an idea on how to run these two loops. Should I place these two loops in 1 big while loop? or should I execute them separately?
Which of these two loops should use scan engine mode?
Thanks !
07-22-2015 11:50 AM
Since you need the motion to be real time and the equation solve does not necessary have to be real time, I would recommend two separate loops. You could put the equation into a normal while loop, pass the position and velocity using Single-Process Shared Variable with RT FIFO Enabled to a Timed Loop that would control motion. You can sync the Timed Loop to the Scan engine. See below for more information. Also check out the cRIO Developer's Guide for best practices on developing applications for cRIO.
http://zone.ni.com/reference/en-XX/help/370622K-01/lvrtconcepts/deterministic_apps_timed_loop/
Interprocess Data Communication, page 29
http://www.ni.com/pdf/products/us/fullcriodevguide.pdf
http://zone.ni.com/reference/en-XX/help/371361J-01/lvdialog/loop_configuration_db/