Posts

Showing posts from May, 2017

[STM32F3] Hello World with STM32F3 Discovery - Part 4

Image
Open loop Boost Converter to Close loop Boost Converter As what we have discussed and talked about in part 3 of this blog series, we are now going to have an open loop controller first before we can properly set our PI Close loop Control System. With our duty cycle percentage value and the voltage output due to that duty cycle percentage we can then use System Identification Toolbox of Matlab to get the transfer function of the design under test. However we still need Instrument Control Toolbox to be able to bring the snapshot of our oscilloscope to Matlab. Open Loop Boost Converter Fig. 1 Connections for the Open Loop To simply our open loop response a step block will be used that will issue a value of  9216 which is equivalent to 50% duty cycle Fig. 2 Open Loop Model Channel 1 which is connected to the Boost Converter Output has a value of 10 Volts and Channel 2 which is connected to the DAC PA4 output has a value of 1.64 (~ 50% of 3.3 volts) Fig. 3 Step Respon

[STM32F3] Hello World with STM32F3 Discovery - Part 3

Image
Checks on the Peripherals As being discussed in the previous post, we can already use the blocks that is provided by the STM32-MAT support package from STMicroelectronics. Further more we will be checking if we have set the configuration correctly and the register values accordingly.  Learning the effects of a certain configuration will let us understand each parameters of the STM32CubeMX for the STM32F3348Discovery. Hardware and Software needed: Fig. 1 Needed Hardware/Software Matlab/Simulink with Embedded Coder Oscilloscope (2 Channels would be sufficient) STM32F3348 Discovery Board GPIB Cable (depends on your oscilloscope) 5 Volts Power Supply HRTIM TimerB The key point why we will use the HRTIM timer is that we can be able to achieve higher PWM Frequency. Normally SMPS has around 100kHz to 4MHz of operating frequency. For our case we will be setting the  HRTIM Timber B PWM Period to 250kHz and a Repetition IRQ on every 16 or 32 cycles of our PWM. It ha

[STM32F3] Hello World with STM32F3 Discovery - Part 2

Image
Setting up the hardware: I wanted to merge the examples provided by STM32-MAT/TARGET (STM32 embedded Target for Matlab/Simulink) and the common use case of System Identification Toolbox, Control System Toolbox and Simulink Control Design Toolbox of Mathworks. This will stream line the capabilities of the support package that the  STM32-MAT has provided and the available toolboxes with matlab to be able to develop a Switch Model Power Supply (Boost Converter). References would be on this links: STM32-MAT Target Support Package STM32F3348Discovery Website STM32F3348 Application Note HRTIM Cookbook Fig. 1 The STM32F3348 Discovery board has a buck boost converter on the pcb (Highlighted in red) Objective 1: Enable the boost section of the circuit with STM32CubeMX Based on the documentation of the STM32F3 Application note AN4449  we need to set TA1 (PA8) to high and TA2(PA9) to low. We also need to set the TB1(PA10) to PWM output and TB2(PA11) to the complimentar

[STM32F3] Hello World with STM32F3 Discovery - Part 1

Image
Hello World! I am starting a blog site as a future references and documentation of my passion for STM32 discovery boards and Mathworks Model Based Design workflow. I am really an avid fan of the STM32 discovery kits where in I will be using them as the basis of my blog post in the coming future. STM32F3348 Discovery Kit http://www.st.com/en/evaluation-tools/32f3348discovery.html For the 1st series of my blogs, i will be sharing my knowledge about the STM32F3 and how to use Mathworks Tools to be able to link the Model Based Design Workflow to an implemented embedded system. We will be covering in this blog series about: 1. HRTIM (High Resolution Timer) 2. Timers and Interrupts 3. SMPS (Switch Mode Power Supply) 4. STM32F3348 Discovery Board 5. STM32 Cube MX 6. Kiel UVision 5 7. Simulink - Matlab 8. Instrument Control Toolbox - Matlab 9. System Identification Toolbox - Matlab 10. Control System Toolbox - Matlab 11. Embedded Coder - Matlab and ETC