2012-12-19 06:08 AM
Hi all,
In comparator section of reference manual of stm32f30x devices. It is mentioned:''Cycle-by-cycle current control loop when combined with the DAC and a PWM output
from a timer''.
What does it mean? Is there some explanations on the web? HerzlichMCU L�fter, #dac-comp
2012-12-19 07:47 AM
''Cycle-by-cycle'' current limiting is an effective technique when employing PWM - especially in BLDC motor control. With PWM @ 20KHz - and PWM generators set to ''center'' rather than edge - the ''live'' motor current can be measured and then compared against torque or current limiting. (it's helpful if the PWM Generator automatically ''triggers'' the ADC conversion)
When the monitored motor current exceeds our pre-set value - we disable the PWM outputs for that cycle. 50uS later (@ 20KHz PWM rates) we check the current again - if ok the PWM output is re-enabled. This method is especially effective against transient over-currents - many/most of which are self-clearing if the PWM is killed for a cycle or several. Should the over-current persist beyond a reasonable number of PWM Cycles - we shut down the motor and provide an over-current detection report on local (and remote) displays.2012-12-19 08:08 AM
More generally, ''cycle by cycle'' refers to controlling the current in a closed loop, based on measurements in the same PWM cycle. It is used for other PWM controlled loops, too, not only motor control. DC/DC converters and LED converters (for lighting) use PWM frequencies of up to 100 ... 200 kHz.
That is a challenge for most controllers, as it results in a 5 .. 10us overall cycle time.2012-12-19 12:22 PM
Indeed you are correct in properly identifying the broader usage of, ''Cycle by cycle.'' And modern DC-DC converters employ this technique well - suspect so well that it would prove wasteful to burden (and task limit) an MCU when a dedicated IC can well solve.
At the lower frequencies encountered in the motor-control and certain other control fields - an MCU with PWM generators, analog comparator, and enhanced PWM Fault Handling (perhaps a slelectable/dedicated pin) is well capable of adding, ''Cycle by cycle'' to its bag of tricks...2012-12-20 01:26 AM
Hi sprague,
Thankk you for your explanation but what could be the role of the DAC? Is there some application notes on stm32 which explains this (or even from copetitors)?2012-12-20 01:56 AM
The DAC is often used to set the threshold for a comparator.
And this comparator, in turn, compares the measured current (i.e. voltage drop over a shunt) with this reference voltage. The comparator output turns the switch (i.e. mostly a MOSFET) on or off. This way, the current and thus the amount of power transferred to the output is controlled.2012-12-20 11:54 AM
As poster fm states - the DAC output could be routed to one of the MCU's analog comparator inputs. In our case - a small pot proves simpler. (and provides instant visual feedback of setting - via the pot's slot) Believe the DAC mention was unnecessary - it is not a vital part for ''Cycle by cycle.''
We have a far different approach when it comes to handling/managing the MCU's comparator output - we route this directly to the PWM Fault Handler pin - and this disables PWM output from all active (and so programmed) PWM Generators when the comparator transitions from its ''safe'' zone. In the case of motor drive - the analog comparator would never tie directly to the power FET stage - separate gate drivers receive the MCU's PWM signals and these gate drivers properly excite both the high and low side power FETs.2012-12-20 12:30 PM
In dimmable LED converters, the DAC value (and thus the comparator reference) is tied to the dim value. The DAC resolution is therefore a crucial parameter for resolution, at least in this setup.
Albeit dimming down to 0.1 percent is somehow ridiculous, it is still a sales argument ...2012-12-20 05:54 PM
Interesting to note that you properly ''generalized'' my 1st response to, ''Cycle by cycle poster'' - and that now you've steered to Led (specialized) while I persist in the area of motors and actuators. (also specialized but perhaps more in the MCU perspective)
The DAC does allow ''dynamic'' (i.e. software controlled) adjustment of the, ''Cycle by cycle'' current-limiting set-point - but does so at the cost of added MCU software to both condition and adjust the DAC - and then ''send'' its setting to some remote or local display. Pot - by contrast - is far simpler - announces its setting visually - but has no dynamic adjustment capability.2012-12-21 01:52 AM
Hi all,
To enhance this valuable disussion and in response to the question regarding application notes on stm32 which explains DAC role, the following ANs may be interesting:
Cheers,
STOne-32