looking for easy way to design digital controlled SMPS  - Page 1
Forum section: electronics / general

author: Miyuki
author_rank: Frequent Contributor
timestamp: August 04, 2017, 08:08:11 am
content: HiI wan to ask if you have any experience with digital controlled SMPS and if you using any tools to do all the math aroundI have following DC/DC setup: full bridge IGBT, have current transformer to measure primary current also have over current protection compactor, and at secondary side, voltage sense and current shunt to measure outputI need to be able to control output as constant voltage and also as constant currentI'm little lost where to begin with all that digital compensation networks, is here any easy tools to do it (just put ADC values in and get needed duty cycle)?processor used is STM32F103

author: hans
author_rank: Super Contributor
timestamp: August 04, 2017, 09:24:22 am
content: STM32F3x4 (e.g. 334) has similar PWM module like the dsPIC33 GS, but with a 217ps resolution (like having a 4.6GHz timer clock). That way you could create a 100kHz PWM with 12-bit resolution.I think both STM32F3x4 and dsPIC33GS have hardware dead-time insertion if you want to drive a full H-bridge.And it has a 5MSPS ADC plus 72MHz Cortex m4 core.

author: coppice
author_rank: Super Contributor
timestamp: August 04, 2017, 09:29:38 am
content: Quote from: blueskull on August 04, 2017, 08:36:48 amHigh resolution PWM is vital. However, its not usually the actual CPU crunch that makes devices unsuitable for making power supplies (or many other things requiring a tight control loop) with a decent impulse response. Its the latency from ADC sample to PWM output. The CPU power plays a part in that, but its not the whole story.....Quote from: blueskull on August 04, 2017, 08:36:48 am.... the Piccolo and Delfino's ADC interrupt scheme, CLAs and high resolution PWM hardware have been optimised to allow every cycle of the PWM to be updated by the control loop with minimal delay from the ADC samples which feed the control loop. This is what distinguishes these control oriented devices, and comparable families from other vendors, from reasonably fast general purpose MCUs being fudged into control applications.

author: julian1
author_rank: Frequent Contributor
timestamp: August 05, 2017, 12:33:38 am
content: Can I add a question ;-) How do you go about introducing the slight timing delay when switching between high-side and low-side transistors to avoid shoot-through? Eg. to account for gate charge/discharge time, and transistor turnon/off time?Basic analog mosfet drivers sometimes introduce additional logic to sense gate charge before switching the opposing transistor. More complex designs use programmable delay via a resistor with RC circuits to reach better efficiency.Do hardware based mcu PWMs modules offer this type of control? I was thinking it might be easier to use a mcu DAC controlling a RC circuit.OP asked about IGBT and a full bridge, but I imagine many of the issues are the same.

author: NorthGuy
author_rank: Super Contributor
timestamp: August 05, 2017, 01:50:56 am
content: There are MCU series designed specifically for power applications (for example dsPIC33EPxxxGS). They will have all you need - high resolution PWM with dead time and complimentary channels to drive bridges, fast multi-channel ADC, DSP engine, fault detection etc. etc.

author: JPortici
author_rank: Super Contributor
timestamp: August 05, 2017, 05:48:34 am
content: I wanted to embark in this adventure sooner, but the PCB has been sitting there for months... maybe during vacations is the time.I have a question: do you happen to know what happens if you pause the excecution with the debugger in the dspic GS?AFAIK peripherals like CANbus keeps operating at least to end current transmission and keeps generating ACKs so the bus isn't upset, but peripherals like old-style PWM is stopped at current state.I'd like to have the switches put in a safe state and i remember reading that some MCUs have option to specify that but i don't remember seeing such an option for the GS

author: Pitrsek
author_rank: Regular Contributor
timestamp: August 05, 2017, 07:54:53 am
content: It seems that XMC range from Infineon is tailored for SMPS as well. No personal experience tough.

author: nctnico
author_rank: Super Contributor
timestamp: August 05, 2017, 11:32:51 am
content: IMHO you shouldn't attempt to use a debugger on a microcontroller which controls a PWM stage.On topic: it very much depends on the topology whether you really need a fast control loop. Flyback for example doesn't depend on the PWM to transfer more or less energy so the control loop only needs to compensate for input voltage changes and current dependant voltage drops. I have done a few of these circuits and one thing which is very important is to have an inductor current limitter in hardware so when the software does something bad it doesn't cause damage.

author: NorthGuy
author_rank: Super Contributor
timestamp: August 05, 2017, 02:44:28 pm
content: Quote from: JPortici on August 05, 2017, 05:48:34 amEach module has a bit which indicates if the module should continue running when debugger halts or not. PICkit3 manipulates these bits and should have settings somewhere (at least it used to in pre-X MPLAB) which lets you configure which module should continue running in debug or not. On some PICs this bit is broken in CAN modules, I don't know if yours is one of them. This might be in errata or in the debugger docs.