LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zaber translation stages with PVT

Solved!
Go to solution

This is only somewhat tangentially LabVIEW related…

I have been testing some Zaber translation stages using their LabVIEW library.  Zaber (apparently recently) added some commands to their command set for running sequences “streams” of positions and position velocity time (PVT) profiles with their controllers.  The LabVIEW library has not been updated to support these new commands.  I wrote VIs to extend their library to support these new features, and the code is functional.  However, I have not used PVT motion control before.  I need to determine the velocity at each point.  My initial plan is to spline the slopes of the trajectory and use this for the V.  If anyone has a recipe for implementing PVT or a link to a good tutorial it would be appreciated.

0 Kudos
Message 1 of 6
(897 Views)

Hi jjohn1,

 

If you recall from physics class (and maybe calculus), velocity is the derivative of acceleration, and position is the derivative of velocity.  Therefore, you can calculate velocity and position curves for any move, based on the acceleration and initial conditions.  Remember this math problem?  Given acceleration of gravity is -9.8 m/s2, if you throw a baseball directly upwards with initial velocity 'v', solve for ball's position and velocity as a function of time.

 

Typically within a motion controller, these calculations are done on the hardware with a "trajectory generator."  This is just a fancy word for deriving the position and velocity curves, given the parameters of a move.  NI used to have this functionality on their motion controllers (now discontinued.)  Later they moved the trajectory generator into a software package called NI SoftMotion (which is also discontinued, ha!)  The idea was that you could use the NI trajectory generator for calculations, and then control PVT profiles with whatever motor hardware you have (such as Zaber, Thorlabs, etc.)

 

Long story short, to answer your question, you need to write your own PVT solver.  If that sounds like overkill,  just try solving for a trapezoidal velocity profile.  (See pic, more info here: https://www.amci.com/industrial-automation-resources/plc-automation-tutorials/how-size-motor/.)  Velocity increases linearly, reaches cruising velocity, then decreases linearly to 0.  Not hard to generate with a LabVIEW while loop.  Then you feed these velocities to Zaber. 


RIObotics_0-1696299813994.png

For simple movements, doing software-based calculations for velocity might be adequate.  But when you have many moves combined, stop-and-go, interpolation, etc., you might need a hardware-based motion controller to do calculations in real-time.  (Shameless self-plug, my company sells hardware-based motion controllers for LabVIEW.)

 

BR

John

Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source NI hardware? Try NI Trading Post

 

0 Kudos
Message 2 of 6
(850 Views)

Hi Johns,

 

On the trapezoidal motion, the basic movement commands handle the trajectory with the acceleration/deceleration/peak speed inputs as you mention; the PVT command set is not needed for this. Additionally. the 'stream' command set on Zaber's controllers can handle similar trapezoidal trajectory for multi-axis lines. The PVT is useful for either: a) when matching a specific timing is critical, or b) when you want to generate a smooth spline motion from minimal points. 

 

John's point on having to write your own PVT solver is correct though. The Zaber API does allow a method of only specifying PT info (and auto-generating the V's). 

 

Note that Zaber's 'Launcher' software does now include a tool for viewing PVT path's (viewing both as position/velocity/acceleration vs time or as a 2D path) if you want to visualize the path before running it with LabVIEW.

 

The note on the PVT feature missing from the LabVIEW library is noted and passed on to the Zaber Software Development team. 

 

Cheers,

 

Mike

mike@zaber.com

0 Kudos
Message 3 of 6
(816 Views)

Mike,

Thanks for the response.

 

You state:

The Zaber API does allow a method of only specifying PT info (and auto-generating the V's). 

 

I could not find any reference to this feature in the ASCII Protocol document.  Is this only available through the API?  This is the solution I am looking for.

 

More missing LabVIEW VIs

The “scope” commands for live position measurements are also missing from the LabVIEW library.  I wrote a set of VIs to use this feature.  As a note: Using the Zaber command/response VIs, data transfers were extremely slow, and I had to increase the VISA buffer size to avoid overruns.  Data transfers took over a minute for the largest allowed data set.  I skipped the command/response VIs and used VISA reads and writes directly, and the transfers were ~10 seconds.

0 Kudos
Message 4 of 6
(781 Views)
Solution
Accepted by topic author jjohn1

Hi John,

 

Correct on the velocity generation being an API only feature. The math makes more sense to do on the software side than in the firmware. 

 

The auto-generated velocities use the 'Finite Difference method'. I've attached a quick example VI of applying this to position and time arrays to create a PVT array. Here are some photos of the block diagram:

2023-10-04_10h51_42.png

2023-10-04_10h52_10.png

Hopefully this helps as a starting place. 

 

EDIT: Sorry, please note that the time array in the example shows seconds between points, but the formula used assumes absolute times and positions (it takes the difference between t(i) - t(i-1) and t(i+1) - t (i) as the divisors). If you wanted to use time intervals, you would just use t(i-1) and t(i) as the divisors. 

 

Thanks for the notes on the scope as well. I'll pass these on for consideration for future development/optimization.

 

Cheers,

 

Mike

mike@zaber.com

 

 

0 Kudos
Message 5 of 6
(771 Views)

Mike,

I used your suggested finite difference method to generate the velocities.  It is working so far.

Thanks for the input!

0 Kudos
Message 6 of 6
(707 Views)