Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Max scan engine period with SoftMotion on sbRIO

I have an application where I need to be able to control 4 stepper motors using step/direction using a sbRIO-9607, only open loop control. I based the control from the Stepper Interface(9401) example, and duplicated the code for multiple motors very similar to other projects I have seen. This project uses the Scan Engine to sync the RT and FPGA code. The issue I have is if I use the default and maximum reccomended scan engine period of 10ms, I get some slight jittering in the stepper motor control. The stepper motor moves but every half second or so you can hear it hiccup a bit. This jittering goes away when I drop the scan engine period to, say, 20ms, and it runs perfectly. Furthermore, when I add even one extra stepper motor the sbRIO seems to have issues meeting the 10ms loop speed and misses every other period, and I need to control 4. Running 2 motors with 20ms uses about 50% of the cpu. 3 uses almost 70%. 

 

With some testing, I have seen perfectly acceptable operation with the scan engine period set as low as 125ms, and the only side effect being a slight delay before the motor starts moving, not a problem for what I'm doing. What I don't understand is why there is a maximum period of 10ms. Furthermore, I dont understand why it won't send the config data for the axis unless the scan engine is 10ms or shorter. I get the following error:

 

"The NI Scan Engine scan period is too slow for SoftMotion to function correctly. Choose a scan period of 10 ms or less on the Scan Engine page of the Real-Time Target Properties dialog box. National Instruments recommends a scan period of 5 ms or less for optimal performance."

 

I have to change the scan engine period to 10ms, update my stepper motor settings, deploy the project, and then change it back to 20ms or longer in order to get smooth control. It seems for my application there is no chance of me leaving it set to 10ms and I'm going to have to do workarounds to keep it set slower. Any ideas?

0 Kudos
Message 1 of 4
(2,952 Views)

Hey Chris,

 

Can you let me know what version of SoftMotion and the model no. of the sbRIO you are using?

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(2,911 Views)

It's the sbRIO-9607 and I'm running SoftMotion 2015 SP1

0 Kudos
Message 3 of 4
(2,907 Views)

Hey Chris,

 

A couple things I suspect might play a role here:

1.) Some of the softmotion methods in the 9401 example project are actually not supported on NI Linux RT targets, such as the 9607. For example, the Read Execution Data method in the ReadData.vi in the Axis Interface Loop in the RT Stepper interface VI.

 

2.) There are a lot of code in the timed loop. It is possible that the amount of code is too much for the sbRIO to handle.

 

Instead of using the 9401 example, use the 9501 example instead, which utilizes UDVs. You would have to modify the project a bit more. For example, you can replace the Disable Drive method in the "Start --> Initializing" case with an I/O node on the sbRIO that controls the enable line of the drive.

 

Since you get accepetable operation with the scan engine period set to 125ms, it might not worth the effort for you to edit another example, but I do think the 9501 example is a better implementation. 

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(2,877 Views)