To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates how to create a center-aligned PWM output.
Description
This block of code produces a center-aligned PWM output to be used in motion control applications. In a FET or IGBT bridge such as an H-bridge, use of a center-aligned PWM means that the switches change state half as frequently as they would when using a normal PWM signal. This reduces wear on the switches, decreases the heat generated by the FETs or IGBTs and also improves the dynamic characteristics of the system. The code has been designed to run in a single-cycle timed loop so that with a high-speed digital output on a cRIO or FPGA card, the PWM signal can update on the FPGA clock cycle. It can also be executed on windows and real-time targets.
The image below shows two normal PWM signals on the top graph, the first with a 20% duty cycle and the second with a 10% duty cycle. The second graph shows the same PWM signals using the center-aligned PWM output.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.