SPRUIU1C July 2020 – February 2024 DRA821U , DRA821U-Q1
In a typical power control loop (switch modes, digital motor control (DMC), uninterruptible power supply (UPS)), a digital controller (PID, 2pole/2zero, lag/lead, and so forth) issues a duty command, usually expressed in a per unit or percentage terms.
In the following example, assume that for a particular operating point, the demanded duty cycle is 0.405 or 40.5% on-time and the required converter PWM frequency is 1.25 MHz. In conventional PWM generation with a system clock of 100 MHz, the duty cycle choices are in the vicinity of 40.5%. Figure 12-2652 shows that duty cycle of 40% (a compare value of 32 counts) is the closest to 40.5%. This is equivalent to an edge position of 320 ns instead of the desired 324 ns. This data is shown in Table 12-5079.
Utilizing MEP allows to achieve an edge position much closer to the desired point of 324 ns. Table 12-5079 shows that in addition to the CMPA value, 22 steps of the MEP (HRPWM_CMPAHR register) will position the edge at 323.96 ns, resulting in almost zero error. In this example, it is assumed that the MEP has a step resolution of 180 ns.
CMPA (count)(1) (2) (3) | DUTY (%) | High Time (ns) | CMPA (count) | CMPAHR (count) | Duty (%) | High Time (ns) | |
---|---|---|---|---|---|---|---|
28 | 35.0 | 280 | 32 | 18 | 40.405 | 323.24 | |
29 | 36.3 | 290 | 32 | 19 | 40.428 | 323.42 | |
30 | 37.5 | 300 | 32 | 20 | 40.450 | 323.60 | |
31 | 38.8 | 310 | 32 | 21 | 40.473 | 323.78 | |
32 | 40.0 | 320 | 32 | 22 | 40.495 | 323.96 | |
33 | 41.3 | 330 | 32 | 23 | 40.518 | 324.14 | |
34 | 42.5 | 340 | 32 | 24 | 40.540 | 324.32 | |
32 | 25 | 40.563 | 324.50 | ||||
Required | 32 | 26 | 40.585 | 324.68 | |||
32.40 | 40.5 | 324 | 32 | 27 | 40.608 | 324.86 |