Sensorless Vector Control for Permanent Magnet Synchronous Motor
(Implementation)
Abstract
This application note aims at explaining sensorless vector control software for a permanent magnet synchronous motor,
by using functions of RX24T/RX24U. The explanation includes, how to use the library of ‘Renesas Motor Workbench’
tool, that is support tool for motor control development.
The target software of this application note is only to be used as reference and Renesas Electronics Corporation does not
guarantee the operations. Please use them after carrying out a thorough evaluation in a suitable environment.
Operation Checking Device
Operations of the target software of this application note are checked by using the following devices.
- RX24T (R5F524TAADFP)
- RX24U (R5F524UEADFB)
Target Software
The target software of this application note is as follows.
- RX24T_MRSSK_SPM_LESS_FOC_CSP_RV110 (IDE:CS+)
- RX24T_MRSSK_SPM_LESS_FOC_E2S_RV110 (IDE:e
- RX24U_MRSSK_SPM_LESS_FOC_CSP_RV110 (IDE:CS+)
- RX24U_MRSSK_SPM_LESS_FOC_E2S_RV110 (IDE:e
RX24T/RX24U Sensorless vector control software for ‘24V Motor Control Evaluation System for RX23T’ and
‘RX24T/RX24U CPU Card’
2
studio)
2
studio)
Reference
- RX24T Group User’s Manual: Hardware (R01UH0576EJ0200)
- RX24U Group User’s Manual: Hardware (R01UH0658EJ0100)
- Application note: ‘Sensorless vector control for permanent magnet synchronous motor (Algorithm)’
(R01AN3786EJ0101)
- Renesas Motor Workbench V.1.00 User’s Manual (R21UZ0004EJ0100)
- Renesas Solution Starter Kit 24V Motor Control Evaluation System for RX23T User’s Manual (R20UT3697EJ0120)
- RX24T CPU Card User’s Manual (R20UT3696EJ0110)
- RX24U CPU Card User’s Manual (R12TU0018EJ0100)
R01AN3788EJ0110 Rev.1.10 Page 1 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
2. System Overview ............................................................................................................................. 4
3. Descriptions of the Control Program .......................................................................................... 10
4. Motor Control Development Support Tool ‘Renesas Motor Workbench’ ................................ 27
R01AN3788EJ0110 Rev.1.10 Page 2 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
Microcontroller
Evaluation board
Motor
(Note 3)
RX24T/RX24U
R5F524UEADFB)
CS+ version
e2studio version
Toolchain version
(Note 4)
1. Overview
This application note explains how to implement the sensorless vector control software of permanent magnet
synchronous motor (PMSM) using the RX24T/RX24U microcontroller. The explanation includes, how to use the
library of ‘Renesas Motor Workbench’ tool, that is support tool for motor control development.
Note that the software uses the algorithm described in the application note ‘Sensorless vector control for permanent
magnet synchronous motor (Algorithm)’.
1.1 Development Environment
Table 1-1 and Table 1-2 show development environment of the software explained in this application note.
Table 1-1 Hardware Development Environment
(R5F524TAADFP/
24V inverter board & RX24T/RX24U CPU Card
(Note 1)
TG-55L
Table 1-2 Software Development Environment
V8.03.00 2020-04 CC-RX: V3.02.00
For purchase and technical support, contact sales representatives and dealers of Renesas Electronics Corporation.
Notes:1. 24V inverter board & RX24T CPU Card (RTK0EM0009C03402BJ) / RX24U CPU Card
(RTK0EMX590C02000BJ) are products of Renesas Electronics Corporation.
2. TG-55L is the product of TSUKASA ELECTRIC.
TSUKASA ELECTRIC (http://www.tsukasa-d.co.jp/
)
3. Motors conforming to the inverter specifications listed in chapter 2 of Renesas Solution Starter Kit 24V
Motor Control Evaluation System for RX23T User’s Manual (R20UT3697EJ0120) can be connected to
the product. When using motors other than the one included with the product, make sure to check
the motor specifications carefully.
4. If the same version of the toolchain (C compiler) specified in the project is not in the import
destination, the toolchain will not be selected and an error will occur.
Check the selected status of the toolchain on the project configuration dialog.
For the setting method, refer to FAQ 3000404.
FAQ 3000404: Program ""make"" not found in PATH error when attempting to build an imported
project (e² studio)
(Note 2)
R01AN3788EJ0110 Rev.1.10 Page 3 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
RX24T/RX24U
A/D converter input
Bus voltage
Rotation speed command
MTU3 output
Over current detection
V
dc
GND
Power supply circuit
DC 24 V input
U port
W port
V port
HU port
HW port
HV port
GND port
V
cc
port
VR1
Switch input
Motor rotation start/stop
Error reset
LED output
LED1 LED2
Over current detection
input
U
p
V
p
W
p
V
n
U
n
W
n
Inverter circuit
Phase current
detection
OC
V
u
VvV
w
I
u
I
w
ENC_Z port
ENC_A port
ENC_B port
GND port
V
cc
port
P80
P81
P64 / AN204
P53 / AN209
PA2
PA1
P71 / MTIOC3B (U
p
)
P72 / MTIOC4A (V
p
)
P73 / MTIOC4B (W
p
)
P74 / MTIOC3D (U
n
)
P75 / MTIOC4C (V
n
)
P76 / MTIOC4D (W
n
)
P70 / POE0#
PMSM
P44 / AN100
IU_AIN
Phase
current
P46 / AN102
IW_AIN
SW1SW2
2. System Overview
Overview of this system is explained below.
2.1 Hardware Configuration
The hardware configuration is shown below.
R01AN3788EJ0110 Rev.1.10 Page 4 of 31
Oct. 01. 2020
Figure 2-1 Hardware Configuration Diagram
RX24T/RX24USensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
Item
Interface component
Function
Rotation speed
Variable resistor (VR1)
Reference value of rotation speed input
(analog value)
START/STOP
Toggle switch (SW1)
Motor rotation start/stop command
ERROR RESET
Toggle switch (SW2)
Command of recovery from error status
LED1
Yellow green LED
- At the time of motor rotation: ON
- At the time of stop: OFF
LED2
Yellow green LED
- At the time of error detection: ON
- At the time of normal operation: OFF
RESET
Push switch (RESET1)
System reset
R5F524TAADFP/ R5F524UEADFB
port name
Function
P64 / AN204
Inverter bus voltage measurement
P53 / AN209
For rotation speed command value input (analog value)
P80
START/STOP toggle switch
P81
ERROR RESET toggle switch
PA2
LED1 ON/OFF control
PA1
LED2 ON/OFF control
P44 / AN100
U phase current measurement
P46 / AN102
W phase current measurement
P71 / MTIOC3B
PWM output (Up)
P72 / MTIOC4A
PWM output (Vp)
P73 / MTIOC4B
PWM output (Wp)
P74 / MTIOC3D
PWM output (Un)
P75 / MTIOC4C
PWM output (Vn)
P76 / MTIOC4D
PWM output (Wn)
P70 / POE0#
PWM emergency stop input at the time of over-current detection
2.2 Hardware Specifications
2.2.1 User Interface
List of user interfaces of this system is given in Table 2-1.
Table 2-1 User Interfaces
List of port interfaces of this system is given in Table 2-2.
Table 2-2 Port Interfaces
R01AN3788EJ0110 Rev.1.10 Page 5 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
12-bit A/D Converter
CMT
MTU3
POE3
- Rotation speed command value
- Inverter bus voltage measurement
2.2.2 Peripheral Functions
List of the peripheral functions used in this system is given in Table 2-3.
Table 2-3 List of the Peripheral Functions
input
- Current of each phase U and W
measurement
1 [ms] interval timer
Complementary
PWM output
Set PWM output ports to
high impedance state to stop
the PWM output.
(1) 12-Bit A/D Converter (S12ADF)
U phase current (Iu)
using the single scan mode (use hardware trigger). The sample-and-hold function is used for U phase current (Iu)
W phase current (Iw), inverter bus voltage (Vdc) and rotation speed reference are measured by
,
and W
phase current (Iw) measurement.
(2) Compare Match Timer (CMT)
The channel 0 of the compare match timer is used as 1 [ms] interval timer.
(3) Multi-Function Timer Pulse Unit 3 (MTU3)
On the channel 3 and 4, output (active level: high) with dead time is performed by using the complementary PWM
mode.
(4) Port Output Enable 3 (POE3)
PWM output ports are set to high impedance state when an over-current is detected (when a falling edge of the POE0#
port is detected) or when an output short circuit is detected.
R01AN3788EJ0110 Rev.1.10 Page 6 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
middle
driver
user_interface
application
main
ics
board
interface
common
control
inverter
mcu
ICS_RX24T/RX24U.obj : Communication library for GUI tool
ICS_RX24T/RX24U.h : Function definition for GUI tool
(Project Folder)
config
r_mtr_parameter.h : Various parameter definition
r_mtr_common.h : Common definition
r_mtr_transform.h, r_mtr_transform.c : Function definition for coordinate transform
r_mtr_driver_access.h, r_mtr_driver_access.c : User access function definition
r_mtr_board.h, r_mtr_board.c : Function definition for board UI
r_mtr_ics.h, r_mtr_ics.c : Function definition for Analyzer
(Note1)
UI
r_mtr_ctrl_mrssk.h, r_mtr_ctrl_mrssk.c : Function definition depends on inverter board
r_mtr_interrupt.c : Interrupt function definition
r_mtr_config.h : Common definition for software configuration
Note 1: Regarding the specification of Analyzer function in the motor control development support tool
2.3 Software Configuration
2.3.1 Software File Configuration
Folder and file configuration of the software are given below.
main.h, main.c : main function
r_mtr_filter.h, r_mtr_filter.c : Function definition for general purpose filters
r_mtr_fluxwkn.h, r_mtr_fluxwkn.c : Function definition for flux weakening control
r_mtr_mod.h, r_mtr_mod.c : Function definition for modulation
r_mtr_pi_control.h, r_mtr_pi_control.c : Function definition for PI control
r_mtr_statemachine.h, r_mtr_statemachine.c : Function definition for state transition
r_mtr_volt_err_comp.h, r_mtr_volt_err_comp.obj : Function definition for
voltage error compensation
r_mtr_ctrl_gain_calc.obj : Function definition for calculation of control gains
r_mtr_foc_action.c : Action function definition
r_mtr_interrupt_carrier.c : Carrier interrupt function definition
r_mtr_interrupt_1ms.c : 1[ms] interrupt function definition
r_mtr_foc_control_less_foc.h, mtr_foc_control_less_foc.c : Function definition for vector control
r_mtr_foc_current.h, r_mtr_foc_current.c : Function definition for current control
r_mtr_foc_speed.h, r_mtr_foc_speed.c : Function definition for speed control
r_mtr_bemf_observer.h, r_mtr_bemf_observer.obj: Function definition for BEMF observer
r_mtr_opl_damp_ctrl.h, r_mtr_opl_damp_ctrl.obj : Function definition for
r_mtr_opl2less.h, r_mtr_opl2less.obj : Function definition for sensorless switching control
r_mtr_ctrl_rx24t/rx24u.h, r_mtr_ctrl_rx24t/rx24u.c : Function definition depends on MCU
r_mtr_ctrl_mcu.h : Common definition depends on MCU
auto_generation : Folder for auto generation files
r_mtr_motor_parameter.h : Configuration definition for motor parameters
r_mtr_inverter_parameter.h : Configuration definition for inverter parameters
r_mtr_control_parameter.h : Configuration definition for control parameters
openloop damping control
‘Renesas Motor Workbench’, please refer to the chapter 4.The identifier ‘ics/ICS (ICS is previous
motor control development support tool ‘In Circuit Scope’) is attached to the name of folders, files,
functions, variables related to ‘Renesas Motor Workbench’.
Figure 2-2 Folder and File Configuration
R01AN3788EJ0110 Rev.1.10 Page 7 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
Module configuration of the software is described below.
R01AN3788EJ0110 Rev.1.10 Page 8 of 31
Oct. 01. 2020
Figure 2-3 Module Configuration
RX24T/RX24USensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
Item
Content
Control method
Vector control
Position detection method
Sensorless
Motor rotation start/stop
Determined depending on the level of SW1 (‘Low’: rotation start, ‘High’: stop) or
input from Analyzer
Input voltage
DC 24 [V]
Carrier frequency (PWM)
20 [kHz]
Dead time
2 [μs]
Control period
Current control / Position and speed estimation: 100 [μs]
Speed control:1 [ms]
Interrupt occupancy
Less than 50 [%]
Rotation speed control
CW: 0 [rpm] to 2650 [rpm]
CCW: 0 [rpm] to 2650 [rpm]
Natural frequency
Current control system: 300 [Hz]
Position estimation system: 50 [Hz]
Optimization setting
Optimization level
2(-optimize=2) (default setting)
Optimization method
Size priority(-size) (default setting)
ROM/RAM size
ROM: 15.0KB
RAM: 4.4KB
Processing stop for
- Disables the motor control signal output (six outputs), under any of the
output ports are set to high impedance state.
2.4 Software Specifications
Table 2-4 shows basic software specification of this system. For details of the sensorless vector control, refer to the
application note ‘Sensorless vector control for permanent magnet synchronous motor (Algorithm)’.
Table 2-4 Basic Specifications of Sensorless Vector Control Software
(twice the carrier period)
range
of each control system
of compiler
protection
Speed control system: 5 [Hz]
BEMF estimation system: 1000 [Hz]
following conditions.
1. Current of each phase exceeds 0.89 [A] (monitored every 100 [μs])
2. Inverter bus voltage exceeds 28 [V] (monitored every 100 [μs])
3. Inverter bus voltage is less than 14 [V] (monitored every 100 [μs])
4. Rotation speed exceeds 3000 [rpm] (monitored every 100 [μs])
- When an external over-current signal is detected (when a falling edge of the
POE0# port is detected) or when the output short circuit is detected, the PWM
R01AN3788EJ0110 Rev.1.10 Page 9 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
Item
Conversion ratio (Reference: A/D conversion value)
Channel
CW
0 rpm to 2700 rpm: 0800H to 0FFFH
CCW
0 rpm to 2700 rpm: 07FFH to 0000H
Item
Conversion ratio
(Inverter bus voltage: A/D conversion value)
Channel
Inverter bus voltage
0 [V] to 111 [V]: 0000H to 0FFFH
AN204
Item
Conversion ratio
(U, W phase current: A/D conversion value)
Channel
Iu: AN100
Iw: AN102
3. Descriptions of the Control Program
The target software of this application note is explained here.
3.1 Contents of Control
3.1.1 Motor Start/Stop
The start and stop of the motor are controlled by input from Analyzer function of ‘Renesas Motor Workbench’ or SW1
switch of RSSK board.
A general-purpose port is assigned to SW1. The port is read within the main loop. When the port is at a ‘Low’ level, the
software determines that the motor should be started. Conversely, when the level is switched to ‘High’ level, the
software determines that the motor should be stopped.
3.1.2 A/D Converter
(1) Motor Rotation Speed Reference
The motor rotation speed reference can be set by Analyzer input or A/D conversion of the VR1 output value (analog
value). The A/D converted VR1 value is used as rotation speed command value, as shown below.
Table 3-1 Conversion Ratio of the Rotation Speed Reference
Rotation speed reference
(2) Inverter Bus Voltage
Inverter bus voltage is measured as given in Table 3-2.
It is used for modulation factor calculation and over-voltage detection (when an abnormality is detected, PWM is
stopped).
(3) U, W Phase Current
The U and W phase currents are measured as shown in Table 3-3 and used for vector control.
U, W phase current -10 [A] to 10 [A]: 0000H to 0FFFH
Table 3-2 Inverter Bus Voltage Conversion Ratio
Table 3-3 Conversion Ratio of U and W Phase Current
(Note)
AN209
Note: For more details of A/D conversion characteristics, refer to ‘RX24T Group User’s Manual: Hardware’,
‘RX24U Group User’s Manual: Hardware’.
R01AN3788EJ0110 Rev.1.10 Page 10 of 31
Oct. 01. 2020
RX24T/RX24U Sensorless Vector Control for Permanent Magnet Synchronous Motor (Implementation)
UV
W
ωt
ωt
ωt
ωt
Modulation wave
: command voltage
Carrier wave (triangular wave): PWM timer count
U phase switching
waveform
V phase switching
waveform
Voltage between U – V lines
(U phase waveform) ー
(V phase waveform)
3.1.3 Modulation
The target software of this application note uses pulse width modulation (hereinafter called PWM) to generate the input
voltage to the motor. And the PWM waveform is generated by the triangular wave comparison method.
(1) Triangular Wave Comparison Method
The triangular wave comparison method is used to output the voltage command value. By this method, the pulse width
of the output voltage can be determined by comparing the carrier waveform (triangular wave) and voltage command
value waveform. The voltage command value of the pseudo sinusoidal wave can be output by turning the switch on or
off when the voltage command value is larger or smaller than the carrier wave respectively.
Figure 3-1 Conceptual Diagram of the Triangular Wave Comparison Method
R01AN3788EJ0110 Rev.1.10 Page 11 of 31
Oct. 01. 2020
Loading...
+ 23 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.