05-05-2010 05:05 AM
05-07-2010
07:45 AM
- last edited on
09-10-2025
02:15 PM
by
Content Cleaner
Hi JP
The PWM example you downloaded is correct, but it is meant to run on the FPGA of the cRIO system, not on the real-time controller.
Using the cRIO in Scan mode in combination with an analog output module in this case will never allow you to create a proper PWM signal. The cRIO Scan engine does not support update rates > 1 kHz, meaning that you have a maximum update rate of 1ms on your output (so also the pulse width will vary with with minimum 1ms).
In general, what you want in this case is a high speed digital output module such as the NI 9401. This kind of module will allow you to get an accurate and TTL compatible digital output signal, which is what a servo requests in general. With a digital module you can also configure the scan mode to output a PWM on the module, while you only have to write to duty cycle to the I/O variable.
If you don't have access to a digital module, you can still try with the analog output module. In this case however you will have to go through programming the FPGA to achieve the maximum 25 kS/s update rate of the analog output module. It will probably work, but will be a little bit thougher...
Good luck!