Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Softmotion & PID

Hi there,
 
I'm going to build a customised simple linear motion position move using PID Toolset & Softmotion (LV7.1)
 
This is a very slow motion. A cotrol loop of 10msec - 100 msec will be sufficient.
( I believe it can be done in LV instead of LV RT )
 
The hardware use are FP2000, FP-Quad510 & FP-AIO-610
 
The Analog output of AIO-610 +/-10V is to drive the AC motor drive in velocity mode.
The Quad510 configures to read the position & velocity of the motor
 
I'm trying to use the example program that comes with the softmotion software  (see attachment) & try to include the PID control vi into the vi but has no success.
 
Can someone please help how to achieve what I'm trying yo do ?
 
Thank you in advance.
 
 
 
 
 
0 Kudos
Message 1 of 16
(7,240 Views)
see attachment vi from Softmotion
0 Kudos
Message 2 of 16
(7,237 Views)
  1. Even if your loop rate is 100 Hz or lower it's still not a good idea to run the application on a non-deterministic system. The reason for that is potential jitter which is poison to the control behavior of your loop. The amount of jitter under Windows can be as high as some 10 ms which will make it hard to get a stable system.
    As you are using an FP2000 you should run the control application on this module.

  2. The example that you have attached is just a demo for the trajectory generator and it is typically meant to run on the host PC for demonstration only. In order to use it with your hardware you should combine it with the cFP Motionn Loop.vi. Please note that this vi is designed for compact FieldPoint devices (cFP) but it will also run with your hardware. The cFP Motion Loop.vi only contains the control loop so you will have to add the user interface loop.
    It might be a good idea to use the RT communication Wizard from the LabVIEW RT module to split the application into a host application with a user interface and a deterministic RT application.

I hope that helps,

Jochen Klier
National Instruments Germany
0 Kudos
Message 3 of 16
(7,230 Views)

Hello Jochen

First of all, thank you very much for your reply.

I just would like clarify what you explained in your reply. Are you telling me that the attached vi with a PID vi build into it will not work even in LV RT ? Correct me if I'm wrong !

I also try to run cP motion loop.vi with LV RT at the background . At the same time I run the cFP Main.vi (API) from the example of Softmotion using LV RT. It does not seem to be working.  ( of course with same modification on the FP I/O vi's) Can you please give me same advice what are the necessary steps to get the FP to work with softmotion in LV RT ?

Do you any other simple working example vi for FP & softmotion ? or any other DAQ hardware that work with softmotion for simple linear position motion control ? The motor drive is configured in velocity mode where the I use the AI of 610 (+/-10V) as the input to the drive.

So far, I have no success to get the FP to work with softmotion. I just an simple example that work with FP & softmotion & hopefully I can continue from there.

Thank you in advance & hope to hear from you again.

Best Regards

  

0 Kudos
Message 4 of 16
(7,212 Views)
Hi RF238

sorry, this was a bit misleading. You could modifiy the vi that you have posted to run the complete RT application but I wouldn't recommend that, as this vi contains the complete UI handling which is not a clean architecture for an RT application.

You better should use the cFP Main.vi and the cFP Motion Loop.vi as you have suggested.
What exactly do you mean by "it's not working"? Do you receive any error messages? Is there no position feedback or no control signal?

You have mentioned that you are using the AI of 610 (+/-10 V) as the input to the drive. Is this a typo? Of course an AI won't work but you will need to connect the AO to the drive.

There are several more things to consider: Typically it's easier to control a drive that is configured for torque mode rather than velocity mode. What about PID tuning (this might be one step beyond at the current state...)? Is there an enable input at the drive that should be set to high or to low in order to enable the drive?

Best regards,

Jochen
0 Kudos
Message 5 of 16
(7,211 Views)
Hi Jochen,
 
1st of all the I used the AO of 610 (not AI, a typo error..sorry !)
 
OK. now with cFP Main.vi and the cFP Motion Loop.vi (what I modified in the example vi's is just the I/O of the FP modules & the position error limit , I widen the position error limit so that the vi would not run into error for troubleshooting purpose. )
 
First I run the cFP Main.vi using RT at the background.
Then I run cFP Motion Loop.vi using RT
The cFP Main.vi  did show same changes of readings at the " current position1"  indicator. (as I tested only on one axis) But the motor does not seem to be moving. Is this because I configured the motor in velocity mode ?
 
May I know what is the effect of  motor drive in torque mode and velocity mode when running the above mentioned examples (ie cFP Main & cFP Motion Loop vi's ) ?
 
In velocity mode, when I vary the voltage from 0 to10v , it varies the velocity from 0 to 1000 rpm ( max limit that I set on the drive )
when I vary the the voltage from 0 to -10v, it varies the velocity from 0 to 1000 rpm but in opposite direction.
 
In torque mode, when I vary the voltge from 0 to 10v, it provides varying torque but running at preset velocity (say 1000rpm)
Similarly for voltage from 0 to -10V , but in opposite direction.
 
Can you please explain why it is easier to control motor in torque mode ?
 
As for PID tuning, I actually have all the values for Kp, Kd, etc which I obtained when I use the PCI-7344 motion control board to interface with the motor drive in torque mode. The motion is perfect when I use the motion board running LV vi.
 
I would like to implement the same thing using FP & Softmotion instead of 7344 board as later I would like to implement fuzzy logic control into softmotion.
 
As for the enable input of the drive is not an issue, as it is permenantly enable by pulling it to ground.
 
As I mentioned in my earlier mail, if you have other simpler motion example that use softmotion & FP, it would be of great help.
 
Meanwhile, I will try to reconfigure the drive into torque mode & run the same example vi's that I mentioned above ?
Is there any "hidden thing" or "hint" or "trick" that is required to make the example vi's working ?
 
Thank you & hear from you again.
 
Best regards
  
 
 
 
 
 
 
0 Kudos
Message 6 of 16
(7,203 Views)
Hi,

I have added some comments to your text.
 
OK. now with cFP Main.vi and the cFP Motion Loop.vi (what I modified in the example vi's is just the I/O of the FP modules & the position error limit , I widen the position error limit so that the vi would not run into error for troubleshooting purpose. 
 
First I run the cFP Main.vi using RT at the background.
Then I run cFP Motion Loop.vi using RT
As statedin cFP Main.vi you should run cFP Motion Loop.vi first.
The cFP Main.vi  did show same changes of readings at the " current position1"  indicator. (as I tested only on one axis) But the motor does not seem to be moving. Is this because I configured the motor in velocity mode ?
Do you mean "some changes"? If the position count is changing slowly but the motor is not moving at all, there might be a serious problem with noise on the encoder lines. If the motor is moving very slowly so that the movement is hard to see, this might be ok for a system that is not tuned correctly. Please see my comments about torque and velocity mode in the next paragraph.
Please make sure that the motor direction and the encoder direction fit together (encoder counts forward when motor moves forward).
 
May I know what is the effect of  motor drive in torque mode and velocity mode when running the above mentioned examples (ie cFP Main & cFP Motion Loop vi's ) ?
If the drive is configured in velocity mode it runs another control loop internally which sometimes may conflict with the surrounding control loop of the motion controller (=FP). In many cases it's hard or even impossible to find PID values for the motion controller that result in a stable system behavior in such a cascaded control loop architecture. Additionally in velocity mode the following error of the system is proportional to the motor's velocity which is typically an unfavorable behavior.
 
In velocity mode, when I vary the voltage from 0 to10v , it varies the velocity from 0 to 1000 rpm ( max limit that I set on the drive )
when I vary the the voltage from 0 to -10v, it varies the velocity from 0 to 1000 rpm but in opposite direction.
 
In torque mode, when I vary the voltge from 0 to 10v, it provides varying torque but running at preset velocity (say 1000rpm)
Similarly for voltage from 0 to -10V , but in opposite direction.
 
Can you please explain why it is easier to control motor in torque mode ?
see above

As for PID tuning, I actually have all the values for Kp, Kd, etc which I obtained when I use the PCI-7344 motion control board to interface with the motor drive in torque mode. The motion is perfect when I use the motion board running LV vi.
This is probably not a good idea. Even though the architecture of the nimcDMControlLoop_PID(FixedPoint).vi is very similar to the control loop used on the PCI-7344, the control loop rate has a strong impact on the PID parameter that should be used. As the control loop is typically running much slower on the FP system compared to the PCI-7344, you will have to modify the PID parameters accordingly.
 
I would like to implement the same thing using FP & Softmotion instead of 7344 board as later I would like to implement fuzzy logic control into softmotion.
 
As for the enable input of the drive is not an issue, as it is permenantly enable by pulling it to ground.
 
As I mentioned in my earlier mail, if you have other simpler motion example that use softmotion & FP, it would be of great help.
The example really contains only the necessary features. I can't think of a much simpler example.

Meanwhile, I will try to reconfigure the drive into torque mode & run the same example vi's that I mentioned above ?
Is there any "hidden thing" or "hint" or "trick" that is required to make the example vi's working ?
I'm not aware of a hidden trick. Please use the debugging features of LabVIEW to find out what's going on. Is the feedback working correctly? Does the AO work correctly?...
 
Thank you & hear from you again.
 
Best regards
0 Kudos
Message 7 of 16
(7,195 Views)
Hi Jochen
 
Thank you very much for your prompt reply.
 
I will try to reconfigure the motor drive to torque mode & test the example vi's according to your suggestions.
 
I will get to you on the outcome.
 
Again thank you very much for your help.
 
Best Regards
 
 
 
P/S :
Again, the following is just a typo mistake, I actually run cFP Motion Loop vi first.
First I run the cFP Main.vi using RT at the background.
Then I run cFP Motion Loop.vi using RT
As statedin cFP Main.vi you should run cFP Motion Loop.vi first.
0 Kudos
Message 8 of 16
(7,188 Views)

Hello Jochen

 

I followed your advice, configured the drive to torque mode.

 

Run cFP Motion Loop.vi at the background using LVRT.

Then run cFP Main.vi

 

There is no response on the motor at all.

 

See attached vi's for the modified vi's.

I even tried to disable the position error by putting an "NOT" at the PID vi, do not have any success.

Is there anything you can advise or suggest to make the system works ?

 

Thank you in advance. 

 

0 Kudos
Message 9 of 16
(6,727 Views)

Hello Jochen

 

I followed your advice, configured the drive to torque mode.

 

Run cFP Motion Loop.vi at the background using LVRT.

Then run cFP Main.vi

 

There is no response on the motor at all.

 

See attached vi's for the modified vi's.

I even tried to disable the position error by putting an "NOT" at the PID vi, do not have any success.

Is there anything you can advise or suggest to make the system works ?

 

Thank you in advance. 

 

0 Kudos
Message 10 of 16
(6,728 Views)