ST UM2313 User Manual
ST UM2313 User Manual

ST UM2313 User Manual

Evaluation board based on stm32cube
Table of Contents

Advertisement

Quick Links

UM2313
User manual
Getting started with the STSW-GLA001V1 software package for
the STEVAL-GLA001V1 evaluation board based on STM32Cube
Introduction
The STSW-GLA001V1 firmware is designed to be used with the STEVAL-GLA001V1 insulated AC
switch control evaluation board to evaluate its embedded TRIACs and AC switches, implementing
different control modes.
The firmware is developed from the STM32Cube embedded software libraries for STM32F0 series
using the IAR Embedded Workbench for ARM.
The firmware also lets you interact with the STEVAL-GLA001V1 hardware user interface and allows the
configuration of some parameters using a PC user interface.
Thanks to the dynamic storage of the configuration parameters in a dedicated section of the Flash
memory embedded in the STM32 microcontroller, you can change any parameter any time without the
need of compiling and programming the MCU via third-party tools.
November 2017
DocID031215 Rev 1
1/33
www.st.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the UM2313 and is the answer not in the manual?

Questions and answers

Summary of Contents for ST UM2313

  • Page 1 UM2313 User manual Getting started with the STSW-GLA001V1 software package for the STEVAL-GLA001V1 evaluation board based on STM32Cube Introduction The STSW-GLA001V1 firmware is designed to be used with the STEVAL-GLA001V1 insulated AC switch control evaluation board to evaluate its embedded TRIACs and AC switches, implementing different control modes.
  • Page 2: Table Of Contents

    Contents UM2313 Contents STSW-GLA001V1 firmware structure ..........5 Overview ................... 5 Architecture ..................5 Parameters..................6 Variables ................... 6 Parameters and variables stored in the MCU Flash memory .... 6 System setup guide ................. 9 Hardware configuration and board setup .......... 9 2.1.1...
  • Page 3 UM2313 List of tables List of tables Table 1: Stored parameters and variables....................7 Table 2: Factory values for td_buffer ......................8 Table 3: State machine fault codes ......................15 Table 4: STEVAL-GLA001V1 operating modes: analog input and digital level........16 Table 5: STEVAL–GLA001V1 evaluation board: user interface command list ........
  • Page 4 IHM09M1 expansion board ......................... 9 Figure 3: NUCLEO device on Windows OS ..................... 10 Figure 4: ST-LINK utility tool window after bin file opening ..............11 Figure 5: ST-LINK utility tool Target menu and Program command ............11 Figure 6: ST-LINK utility tool download window ..................12 Figure 7: STSW-GLA001V1 firmware –...
  • Page 5: Stsw-Gla001V1 Firmware Structure

    UM2313 STSW-GLA001V1 firmware structure STSW-GLA001V1 firmware structure Overview The STSW-GLA001V1 firmware features:  Based on the STM32Cube embedded software libraries  Support for the NUCLEO-F030R8 board  Configuration and independent control of three TRIACs and AC switches embedded in the STEVAL-GLA001V1 evaluation board: ...
  • Page 6: Parameters

    STSW-GLA001V1 firmware structure UM2313 The STSW-GLA001V1 firmware consists of a list of functions that allow the user to interface with the code variables and functions which manage and implement the different evaluation board operating modes  AC_Switch_Control_Lib_Interface_Methods.c file: contains the interfacing functions used by the firmware ...
  • Page 7: Table 1: Stored Parameters And Variables

    UM2313 STSW-GLA001V1 firmware structure During this process, do not switch the system off to avoid data loss.  The data is changed in a state different from GATE_CONTROL_AVAILABLE_IDLE: in this case, the store request is activated and the storage process is only performed, when the state is GATE_CONTROL_AVAILABLE_IDLE.
  • Page 8: Table 2: Factory Values For Td_Buffer

    STSW-GLA001V1 firmware structure UM2313 Description Name Unit Range Factory value (td_min+1) to MainsPeriod/2- μs Maximum td delay td_max MainsPeriod/2- ZCS_margin ZCS_margin Refer to Table 2: μs "Factory values for Turn-on delay buffer td_buffer[N_td] td_min to td_max td_buffer" Table 2: Factory values for td_buffer …...
  • Page 9: System Setup Guide

    STEVAL-GLA001V1 evaluation board. The two boards are connected through the X-NUCLEO-IHM09M1 expansion board, which acts as an adapter between a standard ST morpho connector and a 34-pin connector usually mounted on ST evaluation boards. The user has to ensure that SB16 and the SB50 jumpers on the NUCLEO-F030R8 board are closed.
  • Page 10: Figure 3: Nucleo Device On Windows Os

    Plug the NUCLEO-F030R8 board USB connector (CN1) to the PC via a USB type A to mini-B cable. If the ST-LINK drivers are correctly installed, the PC recognizes it as an external memory device called NUCLEO or similar. Download the firmware binary file for the NUCLEO-F030R8 board from www.st.com.
  • Page 11: Figure 4: St-Link Utility Tool Window After Bin File Opening

    UM2313 System setup guide The following window appears. Figure 4: ST-LINK utility tool window after bin file opening Click on the Program command in the Target menu to download the code in the STM32 MCU as shown below. Figure 5: ST-LINK utility tool Target menu and Program command...
  • Page 12: Programming The Nucleo-F030R8 Board Using A Preconfigured Source Project

    System setup guide UM2313 Click on the Start button in the window below and wait until the flashing is complete. Figure 6: ST-LINK utility tool download window Close the STM32 ST-LINK utility tool. 2.1.2 Programming the NUCLEO-F030R8 board using a preconfigured source project The STSW-GLA001V1 firmware is based on STM32Cube and is provided for the IAR™...
  • Page 13: Steval-Gla001V1 Operating Modes

    UM2313 System setup guide  AC_SWITCH_CONTROL: if the user does not want to use the serial communication feature. Figure 8: STSW-GLA001V1 firmware – IAR workspace configuration selection Compile the active project using the Make command from the Project menu or pressing F7 on the PC keyboard or clicking on the highlighted icon shown in the following figure.
  • Page 14: Figure 11: Stsw-Gla001V1 State Machine

    System setup guide UM2313 Figure 11: STSW-GLA001V1 state machine The different states are:  SYSTEM_INIT: initializes all the firmware variables and parameters used as default values, at board power on or after MCU hardware reset.  SYSTEM_SWITCH_ON: checks if the ZVS detection circuit is available and/or used and sets the next state as MAINS_PERIOD_DETECTION if the ZVS signal is available or as CONTROL_MODE_DETECTION if the ZVS signal is not available.
  • Page 15: Table 3: State Machine Fault Codes

    UM2313 System setup guide If the ZVS signal input is not present when zvs_hw = ENABLE, the MainsPeriod detection algorithm restart as soon as the ZVS signal is available.  CONTROL_MODE_DETECTION: checks the value of the analog selector called MODE and then sets the GATE_CONTROL_AVAILABLE_IDLE as next state and the related detected operating mode.
  • Page 16: Stsw-Gla001V1 Control Mode Detection

    System setup guide UM2313 2.2.1 STSW-GLA001V1 control mode detection In the AC_Switch_Control_Tasks.c file, the MediumFrequencyTasks() function calls the AC_Switch_Ctrl_MODE_Selector_Reading() method, if the actual state is not SYSTEM_INIT, SYSTEM_SWITCH_ON, MAINS_PERIOD_DETECTION and FAULT_ERROR. The AC_Switch_Ctrl_MODE_Selector_Reading() method detects if the MODE selector has been moved from the previous position and so if the actual MODE selector value is changed.
  • Page 17: Figure 12: Zvs Delay Principle

    UM2313 System setup guide Figure 12: ZVS delay principle Real Ideal mains Real td_zvs The TRIAC control synchronization with ZVS has to be accurate in some applications; so, this delay has to be compensated. For this purpose, the TIM6 is used. As mentioned, the td_zvs delay can be positive or negative: in the first case the pulse gate command must be anticipated and in the second case it must be delayed.
  • Page 18: On/Off Pulse Basic/Timer Control Mode

    System setup guide UM2313  td_zvs = 0  Equation 5 ZVS_IRQ event ������6_������ = ����������������������/2 ∙ �� ����������_������6 2.2.3 ON/OFF pulse basic/timer control mode 2.2.3.1 td_zvs = 0 The figure below shows the timing diagram of the ON/OFF control in basic/timer mode related to the generic TRIAC Tx with pulse command.
  • Page 19: Figure 14: On/Off Control In Basic/Timer Mode With Pulse Gate Command Timing Diagram With Td_Zvs

    UM2313 System setup guide crossing of the V signal. The TIM6 is used to count the MainsPeriod/2 to generate the mains gate pulse command at the falling edge zero crossing. The gate command signal stops in the TIM1 Update ISR (TIM1_UP ISR). The TIM1_ARR (auto reload register) is calculated with the t value.
  • Page 20: Figure 15: On/Off Control In Basic/Timer Mode With Pulse Gate Command Timing Diagram With Td_Zvs

    System setup guide UM2313 The following figure shows the timing diagram for the generic TRIAC (Tx) gate command generation in case of a negative delay in the ZVS signal. Figure 15: ON/OFF control in basic/timer mode with pulse gate command timing diagram with td_zvs <...
  • Page 21: Figure 16: On/Off Basic Mode Control With Dc Gate Command Timing Diagram

    UM2313 System setup guide Figure 16: ON/OFF basic mode control with DC gate command timing diagram Push-Button PBTlow PBTlow signal mains Gate command G TIM1_PWM_CHx Start TIM1 Stop TIM1 generated by µC Figure 17: ON/OFF timer mode control with DC gate command timing diagram...
  • Page 22: Phase Control Mode

    System setup guide UM2313 2.2.4 Phase control mode 2.2.4.1 td_zvs = 0 Figure 18: Phase control timing diagram mains ZVS_IRQ Start TIM1 Start TIM6 ZVS Rising edge ISR operations TIM6_ARR TIM6 counting TIM6_UP_IRQ timing diagram Start TIM1 TIM6 Update ISR...
  • Page 23: Figure 19: Phase Control Timing Diagram With Td_Zvs > 0

    UM2313 System setup guide The CCRx value of TIM1 (TIM1_CCRx) is calculated with t , as follows: Equation 9 ������1_�������� = �� ∙ �� �� ����������_������1 The TIM1_PWM_Chx is activated (1 logic level) when the TIM1 counting (TIM1_CNT) value is greater than the CCRx value and deactivated (0 logic level) when it is lower than the CCRx value.
  • Page 24: Zvs Signal Delay Measurement

    Neutral, ensuring to connect the high voltage probe positive terminal to Neutral and the negative one to the Line. The user can alternatively use the STEVAL-GLA001V1 test point, as better described in the related documentation on www.st.com. 24/33 DocID031215 Rev 1...
  • Page 25: User Interface

    UM2313 System setup guide The PC4 GPIO signal output is switched on/off in the void EXTI4_15_IRQHandler(void) interrupt function to capture the time the function is called. The following figure shows the oscilloscope capture with the delay measure considering the ZVS signal zero crossing interrupt event falling edge (ZVS signal is inverted with respect to the V signal).
  • Page 26: Figure 22: Hyperterminal: New Connection Window

    System setup guide UM2313 Figure 22: HyperTerminal: new connection window In the new window, select the virtual COM port in the Connect using field and click OK. Set the Port Settings on the basis of the USART2 peripheral configured by the CubeMX program.
  • Page 27: Figure 24: Tera Term: New Connection Menu

    UM2313 System setup guide Select the Settings window and choose VT100 in the Emulation field, then click Open the project Properties from the File menu and select Terminal Setup. Check the 132 column mode option and click OK to close the window.
  • Page 28: Figure 25: Tera Term: Setup Menu

    System setup guide UM2313 Figure 25: Tera Term: setup menu Set the parameters using the values shown below and click OK. Figure 26: Tera Term: setup menu parameters The serial terminal is now configured. For further details about the use of this program, refer to the program Help menu.
  • Page 29: Figure 27: Tera Term: Command List

    UM2313 System setup guide Click on the Nucleo board reset button or reset the MCU via software or hardware. The following window appears. Figure 27: Tera Term: command list To change the window background and/or text color, select the Window menu from the Setup menu.
  • Page 30: Table 5: Steval-Gla001V1 Evaluation Board: User Interface Command List

    System setup guide UM2313 Some parameters cannot be modified via the push buttons, but can be modified by inserting the valid values listed below. Table 5: STEVAL–GLA001V1 evaluation board: user interface command list Command Description Sets the tp pulse value [μs] set(tp) Sets the variation step associated to tp +/- push buttons [μs]...
  • Page 31 UM2313 System setup guide Command Description stop(tx) where tx can be:  This command can be independently applied to three Triacs to stop the triac control.   Stores a set of data in a dedicated section of the Flash memory of the store(data) microcontroller.
  • Page 32: Revision History

    Revision history UM2313 Revision history Table 6: Document revision history Date Version Changes 23-Nov-2017 Initial release. 32/33 DocID031215 Rev 1...
  • Page 33 ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.

This manual is also suitable for:

Stsw-gla001v1Steval-gla001v1

Table of Contents