Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting S-curve Values in LabWindows/CVI

I am using a 7344 motion card in an embedded system without the benefit of MAX, so it is being initialised by adapting the InitialiseFM.c template provided by NI. This works OK until I come to adjusting the S-curve times, but putting different smoothing times into the flex_load_scurve_time function makes no difference at all. Am I missing something? I attach a segment of the initialisation file that calls flex_load_scurve_time. This loads and runs without error but even nonsensical values (as in the attachment) make no difference to the motion behaviour.
0 Kudos
Message 1 of 6
(3,737 Views)
Attached to this response I am sending you a pseudocode for a simple one axis straight line move with s-curve. I have seen it work on my side without any issues. Please code this afte your initialize routine and let me know if the s-cruve is still not being executed.


In the NI-Motion API, Vector Spaces are numbered starting with 17, or hex 11. Therefore in this pseudocode, when "Vector Space 1 (17)" is referenced, the number in parenthesis is the actual value of the Vector Space Resource.

Information about the NI-Motion functions or VIs can be found in the Software Reference Manual or the VI Online Help.

Reset the position to 0 on all 4 Axes on Board ID 1.

The NI-Motion function that should be used is:
Reset Position

The following code applies to Boar
d ID 1.


Move Constraints

To load the move constraints, set the acceleration to 100000 counts/sec/sec, the deceleration to 100000 counts/sec/sec, the velocity to 10000 counts/sec, and the s-curve time to 32767 sample periods.

The NI-Motion functions that should be used are:
Load Acceleration/Deceleration
Load Velocity
Load S-Curve Time


1D Straight Line Move - "Straight Line Move"

Set the operation mode for axis 1 to Absolute Position mode. Set the target position to 10000 counts/steps. Start motion on the axis.

The NI-Motion functions that should be used are:
Set Operation Mode
Load Target Position
Start Motion

Repeat the following until move is complete on the axis, following error is exceeded, the motor is off, or there is a function error:

Wait 100 ms.
Read Axis Status.

The NI-Motion function that should be used is:
Read Axis Status

Check for function and modal errors on Board ID 1.

The NI-Motion function that should be
used is:
Motion Error Handler
0 Kudos
Message 2 of 6
(3,737 Views)
Thank you for your response. My initialisation covers all the steps you list in your pseudocode, and I can successfully command a simple one axis straight line move. I can successfully vary all motion control parameters such as acceleration and velocity, but **not** the S-curve smoothing time. Whatever value I place in the 'Load S Curve Time' command has no effect at all on the movement profile. I have tried placing the 'Load S Curve Time' command at various stages of the initialisation, and even immediately prior to commanding the move, but all to no avail. The command returns no error, but seems to ignore all time values given to it.
0 Kudos
Message 3 of 6
(3,737 Views)
What version of the driver are you currently using? Are you running the board in servo or stepper mode?
0 Kudos
Message 4 of 6
(3,737 Views)
I am using FlexMotion 5.1.1, and the 7344 card is being driven in Stepper mode.
0 Kudos
Message 5 of 6
(3,737 Views)
I would recommend upgrading to the latest motion driver which is NI-Moiton 6.0.1, it can be downloaded from:

http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BB9002C16DF?opendocument&node=132070_US


Make sure you download NI-Motion 6.0 first and then the 6.0.1 maintenance package. I have tried the same functionality here and it works fine with it so please give it a try and let us know what happens.
0 Kudos
Message 6 of 6
(3,737 Views)