Renesas RA6T1 Application Note
Renesas RA6T1 Application Note

Renesas RA6T1 Application Note

120-degree conducting control of permanent magnetic synchronous motor using hall sensors
Hide thumbs Also See for RA6T1:

Advertisement

Quick Links

RA6T1
120-degree conducting control of permanent magnetic synchronous motor
using hall sensors
Summary
This application note describes the sample program for a permanent magnetic synchronous motor drive with
120- degree conducting method using hall sensors based on Renesas RA6T1 microcontroller. This
application note also describes how to use the motor control development support tool, 'Renesas Motor
Workbench'.
The targeted software for this application is only to be used as reference purposes only and Renesas
Electronics Corporation does not guarantee the operations. Please use this after carrying out a thorough
evaluation in a suitable environment.
Operation checking device
Operations of the sample programs have been checked by using the following device.
・ RA6T1 (R7FA6T1AD3CFP)
Contents
1.
Overview ................................................................................................................................. 3
1.1
Development environment ...................................................................................................................... 3
2.
System overview ..................................................................................................................... 4
2.1
Hardware configuration ........................................................................................................................... 4
2.2
Hardware specifications .......................................................................................................................... 5
2.2.1
User interface ........................................................................................................................................ 5
2.2.2
Peripheral functions ............................................................................................................................... 7
2.3
Software structure ................................................................................................................................. 13
2.3.1
Software file structure .......................................................................................................................... 13
2.3.2
Module configuration ........................................................................................................................... 14
2.4
Software specifications .......................................................................................................................... 15
2.5
Interrupt priority ..................................................................................................................................... 16
3.
Descriptions of the control software ....................................................................................... 17
3.1
Contents of control ................................................................................................................................ 17
3.1.1
Motor start / stop.................................................................................................................................. 17
3.1.2
A/D converter ....................................................................................................................................... 17
3.1.3
Speed control ...................................................................................................................................... 18
3.1.4
Voltage control by PWM ...................................................................................................................... 19
3.1.5
State transition..................................................................................................................................... 21
3.1.6
Start-up method ................................................................................................................................... 22
3.1.7
Sytem protection function .................................................................................................................... 23
3.1.8
AD triggers ........................................................................................................................................... 24
3.2
Function specifications of 120-degree conducting control software using hall sensors software ......... 25
3.3
Contents of control ................................................................................................................................ 36
R01AN6258EJ0100 Rev.1.00
Dec.17.2021
APPLICATION NOTE
Page 1 of 56

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Renesas RA6T1

  • Page 1 ’Renesas Motor Workbench’. The targeted software for this application is only to be used as reference purposes only and Renesas Electronics Corporation does not guarantee the operations. Please use this after carrying out a thorough evaluation in a suitable environment.
  • Page 2 Project import ............................46 Build and debug ............................. 47 Operation outline of sample software ....................48 4.4.1 Quick start ............................48 Motor Control Development Support Tool, ‘Renesas Motor Workbench’ ..........49 4.5.1 Overview .............................. 49 4.5.2 Easy function operation example ......................50 4.5.3...
  • Page 3: Development Environment

    (PMSM) using hall sensors based on the RA6T1 microcontroller and how to use the motor control development support tool, ’Renesas Motor Workbench’. Note that these sample programs use the algorithm described in the application note ‘120-degree conducting control of permanent magnetic synchronous motor: algorithm’.
  • Page 4: System Overview

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 2. System overview Overview of this system is explained below. 2.1 Hardware configuration The hardware configuration is shown below. RA6T1 A/D converter input Bus voltage P005 / AN005...
  • Page 5 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 2.2 Hardware specifications 2.2.1 User interface Table 2-1 and Table 2-2 is lists of user interfaces of this system. Table 2-1 Inverter board user interface Item Interface component...
  • Page 6 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 2-3 is a list of port interfaces of RA6T1 microcontroller of this system. Table 2-3 Port Interface R7FA6T1AD3CFP Port name Function P014 / AN005 Inverter bus voltage measurement...
  • Page 7 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 2.2.2 Peripheral functions Table 2-4 is a list of peripheral functions used in this system. Table 2-4 Peripheral Functions List Peripheral Function Resource - Rotation speed command value input...
  • Page 8 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors (1). 12-bit A/D converter (ADC12) U-phase current (Iu), W-phase current (Iw), the rotation speed command value input, inverter bus voltage(Vdc) are measured by using the ’12 bit A/D converter’.
  • Page 9 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors (2). Low power consumption asynchronous general-purpose timer (AGT) Used as a 1ms interval taimer. Figure 2-3 FSP configuration of AGT driver (FSP3.5.0) R01AN6258EJ0100 Rev.1.00 Page 9 of 56...
  • Page 10 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors (3). General-purpose PWM timer (GPT) On the channel 0, 2, and 3, output with dead time is performed by using the complementary PWM Output Operating Mode. Channel 1 is used as a free run timer for speed measurement.
  • Page 11 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Figure 2-5 FSP configuration of GPT driver (free run timer for speed measurement) (FSP3.5.0) R01AN6258EJ0100 Rev.1.00 Page 11 of 56 Dec.17.2021...
  • Page 12 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors (4). Port output enable for GPT(POEG) The ports executing PWM output are set to high impedance state when an overcurrent is detected(when the low level of the GTETRGC port is detected) Figure 2-6 FSP configuration of POEG driver (FSP3.5.0)
  • Page 13: Software Structure

    ICS2_RA6T1.h : Communication-related definitions for tools Note1 : For details on the Analyzer function of the motor control development support tool "Renesas Motor Workbench", refer to Chapter 4.5. Also, for the names of folders, files, functions, and variables related to the motor control development support tool "Renesas Motor Workbench", The identifier "ics / ICS (formerly Renesas Motor Control Development Support Tool"...
  • Page 14 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 2.3.2 Module configuration Figure 2-9 show module configuration of software. Application Layer (User Application) Main User Interface Module mtr_main.c r_mtr_ics.c Set User Command to Buffer Middle Layer (Motor Control Process) Interface Module rm_motor_120_degree.c...
  • Page 15: Software Specifications

    Control method 120-degree conducting control Rotor magnetic pole position Position detection by signals of hall sensors (by each 60 degrees) detection SW1 input or input from ‘Renesas Motor Workbench’ Motor rotation start/stop Input voltage DC 24V Main clock frequency 120 [MHz] 20 [kHz] (Carrier cycle:50 [μs])
  • Page 16: Interrupt Priority

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 2.5 Interrupt priority The interrupts and priorities used in this system are shown below. Table 2-6 Interrupt priority Interrupt Priority Process level 1[ms] interrupt processing A/D conversion completion interrupt...
  • Page 17 3.1.1 Motor start / stop Starting and stopping of the motor are controlled by input from ‘Renesas Motor Workbench’ or SW1. A general-purpose port is assigned to SW1 and based upon its level the motor operation is controlled. → Motor Start "Low"...
  • Page 18: Speed Control

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.3 Speed control In this system, the motor rotation speed is calculated from a difference of the current timer value and the timer value 2π [rad] before. The timer values are obtained from compare match value of GPT0 (free running timer) at every external interrupt due to hall sensor signals.
  • Page 19 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.4 Voltage control by PWM PWM control is used for controlling output voltage. The PWM control is a control method that continuously adjusts the average voltage by varying the duty of pulse, as shown in Figure 3-2.
  • Page 20 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Figure 3-4 Complimentary first 60-degree Chopping R01AN6258EJ0100 Rev.1.00 Page 20 of 56 Dec.17.2021...
  • Page 21 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.5 State transition Figure 3-5 show state transition diagrams of 120-degree conducting control software. In this application note target software, the status is managed by "SYSTEM MODE". POWER ON/...
  • Page 22: Start-Up Method

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.6 Start-up method In the case of 120-degree conducting control using hall sensors, the rotor position can be determined by hall sensors’ signals. Therefore, the conduction pattern at start-up is also determined.
  • Page 23 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.7 Sytem protection function This system has the following six types of error status and enables emergency stop functions in case of occurrence of respective error. Refer to Table 3-5 for settings.
  • Page 24 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.1.8 AD triggers Shows the timing of AD triggers and scan groups. Timer start 50us Carrier cycle ADC trigger ADC trigger ADC trigger ADC trigger from GPT from GPT...
  • Page 25 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.2 Function specifications of 120-degree conducting control software using hall sensors software Multiple control functions are used in this control program. Table 3-6 List of Functions “mtr_main.c” [1/2]...
  • Page 26 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-7 List of Functions “mtr_main.c” [2/2] ファイル名 関数名 処理概要 Get the status of SW1 get_sw1 Input : None Output : None Get the status of SW2 get_sw2...
  • Page 27 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-8 List of Functions “r_mtr_ics.c” File name Function name Process overview Set value from GUI tool mtr_set_com_variables Input : None Output : None Initialization of variables used...
  • Page 28: Function Name

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-9 List of Functions “rm_motor_120_degree.c” [1/3] File name Function name Process overview 120 degree control start RM_MOTOR_120_DEGREE_Open process Input : (motor_ctrl_t * const) p_ctrl / Instance parameter...
  • Page 29 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-10 List of Functions “rm_motor_120_degree.c” [2/3] File name Function name Process overview Motor rotation start process rm_motor_120_degree_active Input : (motor_120_degree_instance_ctrl_t *) p_ctrl / Instance parameter Output : (uint8_t) err / Result...
  • Page 30 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-11 List of Functions “rm_motor_120_degree.c” [3/3] Function name File name Process overview rm_motor_check_over_current_error Overcurrent error detection Input : (float) f4_iu / U phase current [A] process (float) f4_iv / V phase current [A]...
  • Page 31 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-12 List of Functions “rm_motor_120_control_hall.c” [1/3] Function name File name Process overview RM_MOTOR_120_CONTROL_HALL_Open Hall sensor control start Input : (motor_120_control_ctrl_t * const) p_ctrl / Instance parameter process...
  • Page 32 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-13 List of Functions “rm_motor_120_control_hall.c” [2/3] Function name File name Process overview RM_MOTOR_120_CONTROL_HALL_PatternErrorFlagGet Hall sensor pattern error Input : (motor_120_control_ctrl_t * const) p_ctrl / Instance parameter status acquisition process...
  • Page 33 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-14 List of Functions “rm_motor_120_control_hall.c” [3/3] Function name File name Process overview rm_motor_120_control_hall_pattern_first60 Non-complementary first 60 Input : (motor_120_control_hall_instance_ctrl_t *) p_ctrl / Instance degree chopping process parameter...
  • Page 34 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-15 List of Functions “rm_motor_120_driver.c” [1/2] File name Function name Process overview RM_MOTOR_120_DRIVER_Open Driver start processing for Input : (motor_120_driver_ctrl_t * const) p_ctrl / Instance parameter 120 degree control...
  • Page 35 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-16 List of Functions “rm_motor_120_driver.c” [2/2] File name Function name Process overview RM_MOTOR_120_DRIVER_ParameterUpdate Parameter update process Input : (motor_120_driver_ctrl_t * const) p_ctrl / Instance parameter (motor_120_driver_cfg_t const * const) p_cfg / Configuration...
  • Page 36: Configuration Options

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.3 Contents of control 3.3.1 Configuration Options The configuration options for the 120-degree control using hall sensors module for the motor can be configured using the RA Configurator. The changed options are automatically reflected in hal_data.c when the code is generated.
  • Page 37 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-18 Configuration Options Configuration Options (rm_motor_120_control_api.h) Contents Option name Conduction type Switching of first 60 degree chopping control Initial: First 60-degree PWM Timeout counts (msec) Stop judgement counter [ms]...
  • Page 38 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-19 Configuration Options Configuration Options (rm_motor_120_control_hall.h) Contents Option name Start reference voltage (V) Reference voltage for start-up [V] Initial: 5.8 Hall wait counts Wait counts of hall interrupts to start speed calculation...
  • Page 39 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Table 3-20 Configuration Options [1/2] Configuration Options (rm_motor_120_driver.h) Option name Contents 120 degree control type 120 degree energization control sensor type Initial: Hall (Please select HALL) PWM output port UP...
  • Page 40 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Figure 3-10 FSP configuration of ADC and PWM modulation driver for 120-degree conducting control (FSP3.5.0) R01AN6258EJ0100 Rev.1.00 Page 40 of 56 Dec.17.2021...
  • Page 41 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.4 Control flows (flow charts) 3.4.1 Main process Main process Initialization of FSP module Initialization of main variables User interface initialization Initialization of communication function for tools Reset process...
  • Page 42 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.4.2 50 [µs] Periodic interrupt (carrier periodic interrupt) handling Carrier cycle interrupt Three-phase current A/D conversion value acquisition Three-phase current offset removal Get inverter bus voltage value Motor stop detection Figure 3-12 50 [µs] Periodic Interrupt Handling...
  • Page 43 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.4.3 1 [ms] periodic interrupt handling 1msec cyclic interrupt [ INACTIVE ] system mode [ ACTIVE ] [INIT] [ DRIVE ] Run mode [ BOOT ] [ Processing ]...
  • Page 44 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3.4.4 Overcurrent interrupt handling The overcurrent detection interrupt is an interrupt that occurs when either an external overcurrent detection signal is input at POEG pin, or an output short circuit is detected by the GTETRGC output level comparison operation.
  • Page 45: Operating Environment

    Brushless DC Motor (TG-55L-KA 24V) On-chip debugging Emulator The RA6T1 CPU Card has an on-board debugger (J-Link OB), so there is no need to prepare an emulator. Table 4-2 lists the software requirements for building and debugging motor control software.
  • Page 46: Project Import

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 4.2 Project import The sample software can be imported into e2 studio by following the steps below. 1. File → Import Figure 4-1 File Menu 2. Select "Existing Projects into Workspace" and click the [Next] button.
  • Page 47 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 3. Select a project file. Click the Finish button to import the project. Figure 4-3 Project Import 4.3 Build and debug Please refer to “e2 studio User’s Manual Starting Guide (R20UT4204)”.
  • Page 48: Quick Start

    4.4 Operation outline of sample software 4.4.1 Quick start To operate the sample code without using the motor control development support tool "Renesas Motor Workbench", execute the quick start sample project according to the following procedure. (1) After the regulated power is turned on or reset, all LEDs 1 and 2 on the inverter board are off and the motor is stopped.
  • Page 49 ’Renesas Motor Workbench’ can be used. Please refer to ‘Renesas Motor Workbench User’s Manual’ for usage and more details. You can find ’Renesas Motor Workbench’ on Renesas Electronics Corporation website.
  • Page 50 The following is an example of operating the motor using the Easy function. Change the user interface to use Renesas Motor Workbench (1) Turn on "RMW UI". Figure 4-1 Procedure for changing to use Renesas Motor Workbench Change the user interface to use Renesas Motor Workbench (1) Press the “Run” button...
  • Page 51 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Processing when it stops (error) (1) Turn on "Reset" button. (2) Turn off “Reset” button Figure 4-4 Error clearing procedure R01AN6258EJ0100 Rev.1.00 Page 51 of 56 Dec.17.2021...
  • Page 52 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors 4.5.3 List of variables for Analyzer function Table 4-3 shows a list of input variables when using the Analyzer user interface. The input values to these variables will be reflected in the corresponding variables when the same values as g_u1_enable_write are written to com_u1_enable_write.
  • Page 53 4.5.4 Operation Example for Analyzer Following example shows motor driving operation using Analyzer. Operation is using “Control Window” as shown in Figure 4-4. Regarding specification of “Control Window”, refer to ‘Renesas Motor Workbench User’s Manual’. • Change the user interface to use Analyzer ①...
  • Page 54 RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors • Error cancel operation Enter “3” in the [Write] box of “com_u1_mode_system”. ① Click the “Write” botton. ② Figure 4-7 Procedure – Error cancel operation R01AN6258EJ0100 Rev.1.00 Page 54 of 56...
  • Page 55: Reference Document

    120-degree conducting control of permanent magnetic synchronous motor using hall sensors 5. Reference document RA6T1 Group User’s Manual: Hardware (R01UH0897) RA Flexible Software Package Documentation 120-degree conducting control of permanent magnetic synchronous motor (Algorithm) (R01AN2657) Renesas Motor Workbench User’s Manual (R21UZ0004) Evaluation System for BLDC Motor User’s Manual (R12UZ0062)
  • Page 56: Revision Record

    RA6T1 120-degree conducting control of permanent magnetic synchronous motor using hall sensors Revision Record Descriptions Rev. Data of issue Page Summary — 1.00 2021.12.17 First edition issued. R01AN6258EJ0100 Rev.1.00 Page 56 of 56 Dec.17.2021...
  • Page 57: General Precautions In The Handling Of Microprocessing Unit And Microcontroller Unit Products

    Unit Products The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
  • Page 58: Corporate Headquarters

    Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.

This manual is also suitable for:

R7fa6t1ad3cfp

Table of Contents