09-25-2012 03:06 AM
I'm new to NI Motion but have been programming in Labview for a number of years (hence I've not familiar with older Softmotion stuff).
Current environment is
Labview Version: LV2011, NI Softmotion Module is installed
CompactRIO: 9025
Chassis: 9118
Motion modules: NI9505
I've been trying to understand how I can use the "SoftMotion" functionality (ie whats available in the "NI SoftMotion" sub-palette in the "Vision and Motion" Palette ) for a motion application to minimise the amount of code I need to generate myself.
It seems to use the SoftMotion requires using the cRIO in Scan mode, but it seems that to use 9505 modules, you must use the cRIO in "FPGA Interface" programming mode. Is this the case ?? If so, it means that the 9505 modules aren't (really) compatible with the SoftMotion stuff (only the 951x modules).
When I create a Softmotion axis, I can only bind it to either a
1. Simulated Axis or
2. Unbound Axis
The softmotion axis is required to use the SoftMotion vi's (whether they be the express vi's or the function block vi's), but there doesn't seem to be any way to bind an NI9505 module to the softmotion axis.
And things like trajector generator discussed in (http://www.ni.com/white-paper/3195/en) don't seem to exist...
Am I missing something ?
I've looked through numerous examples that come with Labview, lots of on-line stuff, and some NI presentations and I've only found a few cryptic comments around this area. Lots of examples with 951x modules which look straightforward, but not with the 950x modules. A couple of pages I found from an NI presentation seem to suggest (but not clear) that 951X and 950X need to be treated differently (??) (see attached)
Any comments/feedback would be appreciated.
09-25-2012 10:52 AM
Welcome dwjef!
As you've noticed, there is a big difference in how the 951x (drive interface) modules are used vs the 950x (drive) modules. Much of the following is just a confirmation of what you've already discovered.
When using the drive interface modules in scan interface mode you, as the user, do not have the ability to view or modify the behavior or algorithms of the module beyond the configuration exposed through Softmotion. LabVIEW detects the modules and all interaction with the module happens through the project.
On the other hand, the 950x modules are almost entirely controlled by the FPGA. This means that the commutation and control algorithms are implemented as LabVIEW FPGA VIs and can be viewed and customized by the user as necessary. Of course it also means that the chassis must be in FPGA mode.
The problem then is how to connect Softmotion and the FPGA code that implements the 950x control. The glue code that connects Softmotion on RT to the LV FPGA code is called the "axis interface". The version of the axis interface in Softmotion 2011 required creating RT VIs that would expose certain abilities to Softmotion. The axis type associated with this technique is "unbound axis".
The Softmotion 2011 example that demonstrates this technique for the 9505 is called "Servo Drive (9505).lvproj"
Improvements were made in Softmotion 2012 that removed the requirement to write RT VIs. The communication to the FPGA happens instead over User Defined Variables (UDVs). It also became possible to create a 9501 axis type for module specific configuration as well as a generic UDV axis for the other 950x modules or for completely custom axes. There is not an example specific to the 9505 yet.
We continue to improve this feature and are trying to make it more convenient without sacrificing the flexibility of the FPGA controlled drive modules.
Let me know how it goes,
Nathan
Motion R&D
10-01-2012 03:41 AM
THanks for info. I did see the Servo Drive example early on, but didn't understand its signficance till your response, and most of the other examples were the 'FPGA mode'. Really its theinterface between the Softmotion stuff thats important. Once that data is accessible in the CompactRIO(as in RT Servo Drive), it is passed down to the FPGA as per running in the FPGA mode.
I'm still absorbing that example, but one aspect is puzzling me (perhaps lack of understanding of the cubic spline).
I can see the trajectory data is read in the "ReadData" vi (position, speed, accel, coefficients for spline etc) which I understand is coming from the Softmotion modules higher up (presumably through set methods). But the trajectory data doesn't seem to be written down to the FPGA anywhere ??
The spline coefficients, velocity, and acceleration are written, but the position not so ?? Or is the position information used to calculate the spline coefficients and hence the position setpoint is embedded in the spline coefficients)
(I'm imagining the coefficients are used to calculate the output based on the desired position ie
y = Ax^3 + Bx^2 + Cx + D type of thing, where
x is position setpoint
A,B,C,D are the coefficients
y is smoothed/interpolated position.).
As soon as LV2012 arrives here, I will look at that to understand the changes that are available as per your comments.
Thanks
10-03-2012 03:28 PM
Hello dwjef, let me interject myself into this thread.
We generate a set of spline coefficients once per setpoint during motion control, and then use these to evaluate the spline to create a series of interpolated points at a finer resolution in order to more smoothly drive the motion.
The velocity and acceleration are sent down as-is because these aren't used in quite the same way.
For more details on the spline evaluation, we have this handy page:
http://zone.ni.com/reference/en-XX/help/371093G-01/nismlvhlp/spline_engine/
There are other discussions of splines and their uses scattered around as well.
Edwin!
01-14-2013 09:08 AM
Hello
I am having exactly the same problem of concepts!
Thanks for such a clear answer.
but one more question I want to ask that using this example with 9505 that I am doing right now and its working, can we implement closed loop somehow??
beacuse as we have unbound axis so we cannot use the closed loop configuration from axis setting and neither it gives us option with 9505 maybe because we donot have encoder with this drive!I am using encoders seperately and the module for that is 9504.
M i correct with my concepts??
moreover then what should I do to implement closed loop?
thanks
01-15-2013 10:51 AM
Hello Sara,
I suggest you take a look at the Velocity Control (closed loop) - NI 9505 example. You can find this example by searching the NI Example Finder for the keyword "9505," and it is available in LabVIEW 2011 and LabVIEW 2012. This example demonstrates the use of closed loop control with the module in question, and should provide a good framework for developing your own closed loop control algorithm.
01-15-2013 10:59 AM
Thanks for the reply but that example cannot be used to acheive spline and other softmotions! right?
Thanks
01-16-2013 05:37 PM
Greetings, SaraBaber;
The example does not contain spline motion configuration out of the box. However, it will be a good starting point to add the Spline Engine information as per Edwin's post.
In addition, the following link might be of aid; the spline configuration will be dependant on the drive at hand, however.
http://zone.ni.com/reference/en-XX/help/371093G-01/nimclvfb/axisconfig_spline/
Finally, the Contour Express VI also contains some possibilities regarding splines that may be interesting:
http://zone.ni.com/reference/en-XX/help/371093K-01/nimclvfb/excontourmove_00b10009/
Cordially;
Simon P.