MATLAB: How to set the duty cycle of the PWM channel for the DM6816 PWM block in xPC Target 2.7.2 (R14SP2)

channelcycledm6816dutyelectric_motor_controlinputpower_conversion_controlpower_electronics_controlpwmrtdSimulink Real-Timesitplan_xpc_setuptargetxpc

I am attempting to set the duty cycle for the first PWM channel of the Real Time Devices DM6816 PWM block in xPC Target 2.7.2 (R14SP2). I don't have sufficient information related to the block's inputs.

Best Answer

We have verified that documentation for the Real Time Devices DM6816 PWM block found within the xPC Target I/O Block Reference section is incomplete as of xPC Target 2.7.2 (R14SP2). Here is some additional information related to setting the duty cycle of the PWM channel associated with that block:
The value of the duty cycle relies on the input to the block. Valid input to the DM6816 PWM block is a number in the range from 0 to 255. This input corresponds to the block duty cycle, where 0 is a duty cycle of 0% and 256 is 100%. Consequently, the maximum input duty cycle is:
255 / 256 = 0.996
To set a duty cycle of 0.06 for example, the block input associated with the PWM channel should be:
0.06 * 256 = 15.36
However, note that the block rounds to the nearest integer. As a result, the duty cycle is actually:
15 / 256 = 0.0586