Short Overview
RL78 Motor Control
YRMCKITRL78G14 Starter Kit
Renesas Electronics Europe
David Parsons Application Engineering
Industrial Business Group
July 2012
© 2012 Renesas Electronics Europe. All rights reserved.
Renesas MCU for 3-phase Motor Control
Control Method
Brushless AC
Vector
Control
180°
Sensorless 
1 or 3 shunts
Sensored 
 Hall, encoder…
Brushless DC
120°
Trapezoidal
Control
Induction AC
Vector 180°
Control
Sensorless 
 Back EMF
Sensored 
 Hall, encoder…
Sensorless 
 1 or 3 shunts
Sensored 
 Hall, encoder…
180°
V/f
Control
Sensored 
 Tacho, Hall,
encoder…
Renesas MCU portfolio covers all 3-phase MC requirements
2
© 2012 Renesas Electronics Europe. All rights reserved.
STEP1
U
V
W
STEP2
STEP3
STEP4
STEP5
STEP6
STEP1
STEP2
STEP3
RL78/G14: 16-bit MCU for Motor Control
 On Chip Features
Memory
Program Flash

1% Internal Clock (64MHz)

32MHz CPU
– Including MUL/DIV/MAC instructions
– Barrel Shifter

Motor Control
– 16bit Motor Control Timer
up to 64KB
SRAM
up to 5.5KB
Data Flash
up to 4KB
System
DTC
Interrupt Controller
4 Levels, 20 pins
Clock system
External Clock
32.768KHz
Internal OCO
up to 64MHz
POR, LVD
MUL/DIV/MAC
Debug
Single-Wire
Power Management
HALT
RTC, DMA Enabled
SNOOZE
Serial, ADC Enabled
STOP
SRAM On
Analog
20MHz
External Clock
2 x Timer Array
16-bit, 4ch
Interval Timer
12-bit, 1ch
Internal LOCO
Window WDT
Clock
RTC
15KHz
Monitoring
17-bit , 1ch
Calendar
Internal Vref.
Temp. Sensor
2 x I 2C
RAM
1 x I 2C
ADC
Self-diagnostic
SFR
Motor Control
3ph MC Timer RD
16-bit with dead time
Memory
CRC
Multi-Master
2 x CSI/SPI
7-, 8-bit
3 x UART
7-, 8-, 9-bit
protection
Encoder Timer RG
16-bit, 1ch
•
•
1 x LIN
1ch
Event Link Controller (ELC)
Data Transfer Controller (DTC)
 10-bit A/D
– Analogue comparator (Larger Devices)
– Internal temperature sensor
– Internal Voltage reference
Communications
Master / Slave
64MHz Motor Control 3-Phase timer (RD)
Timer for H/W encoder (RJ)
ADC trigger
– H/W support
ADC
10-bit, 12ch
Safety
Parity Check/protection
•
•
•
Timers

H/W safety and self test:
– Flash ECC, RAM Parity, HW CRC,
Clock Monitor
– Windowed WDT, A/D self test,
RAM/SFR write protect,
– Window Watchdog with separate clock
– Hardware Shutdown (INTP0)
Timer RJ
16-bit , 1ch
ELC
3
Used in the motor control kit
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14: Typical Applications
 Typical application fields include:




4
Small Appliances
Fans and Blowers
Pumps
Power Tools
Typical application Block Diagram
© 2012 Renesas Electronics Europe. All rights reserved.
5
© 2012 Renesas Electronics Europe. All rights reserved.
RL78 F.O.C Sensorless Algorithm
Inverse
Park
Transform
Current
Control Loop
Reference
Current (Id)
0 [Idref]
Id PI
+
(d, q) →
(, )
Vd
Vq
HV
DC Bus
Inverse
Clark
Transform
(, ) →
(u, v, w)
V
V
3
PWM Modulation
ref
Speed PI
+
Iqref
+
Current Reading
(z-1)
Iq PI
z-1
z-1
z-1
Motor
Phase
inverter
z-1
-
-
Reference
Speed
i U, i V, i W
z-1
est
Speed Control Loop
Speed estimation
Idmea
Iqmea
est
(, ) →
(d, q)
Flux Phase
estimation
Imea
(u, v, w) →
(, )
I mea
Park
Transform
Clark
Transform
© 2012 Renesas Electronics Europe. All rights reserved.
Iumea
Ivmea
Iwmea
RL78/G14 F.O.C Software Overview
Main Program
Run Self Test Programs
Data Flash parameters upload
A/D channels offset reading
Peripheral initialization
Variable initialization
Interrupt enabling
Main loop
synchronization
NO
cnt_int == 0 ?
YES
cnt_int = NUM_INT
125uS Control Interrupt
Motor Control Processing
Main loop body
Speed ramp management
Communication management
General board management
Parameters modification management
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 F.O.C Software Overview

Sensorless FOC algorithm


Signed integer 16 and 32bit variables
Low level assembler maths functions




Shift and Add
Multiply and Shift
Divide
Multiply and Divide
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 – F.O.C Software Organisation
Modules
Function Descriptions
C Modules
hwsetup.c
stl_support.c
main.c:
userif.c
par_tab.c
globalvar.c
The basic hardware initialisation
Support routines for the self test functions
The main program loop
Communication routines (i.e. GUI)
The Parameter management routines definitions and tables
Global variable definitions
Assembler Modules
self-test
multiply.s87
cstartup.s87
IEC assembler Self test routines (RAM, FLASH, Registers and Clock)
Combined assembler maths functions
Customised start up file for March C RAM test
Library Module
MCRP08_RL78_Lib.r87
Motor Control Library Module
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 – F.O.C Software Organisation-Cont
Modules
Function Descriptions
Header Files
customise.h
const_def.h
mcrplib.h
par_tab.h
hwsetup.h
globalvars.h
multiply.h
mask.h
userif.h
Basic parameters, not modifiable through the GUI
Definition of the basic numerical constants
Motor control library definitions, references and function prototypes
Parameter definitions, function prototypes and references
Hardware definitions, references and function prototype (low_level_init)
Global variable definitions and references
Assembler Maths function references
General support definitions and references
General support definitions, references and function prototypes
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 F.O.C - Software/GUI Parameter List
Index
Parameter Description
Unit
1
00 Default Parameter Setting
Number
2
01 Minimum Speed
RPM
3
02 Maximum Speed
RPM
4
03 Acceleration
RPM/s
5
04 Deceleration
RPM/s
6
05 Polar Couples
Number
7
06 Start Up Current
Apeak / 10
8
07 Maximum “q” current
Apeak / 10
9
08 Stator Resistance
Ohm/10
10
09 Synchronous Inductance
11
10 Start Up Time
12
11 Current Loop Kp
Number
13
12 Current Loop Ki
Number
14
13 Speed Loop Kp
Number
15
14 Speed Loop Kp
Number
16
15 Free
--
17
16 Free
--
18
17 Pi Tuning Trigger
19
18 Free
--
20
19 Free
--
© 2012 Renesas Electronics Europe. All rights reserved.
Henry/10000
mS
Number
•Timer RD
•Interrupt Culling (ELC and Timer RJ)
•Hardware Shutdown (INTP0 pin and HW control)
12
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 Example - Automatic Interrupt Culling
Timer RD: complementary PWM
TRD1
Underflow
Event Link Controller
Timer Event
Input Trigger
Timer RJ – event counter
Complementary PWM
Timer RD is set to operate in
Complementary 3-phase mode:
PWM can be set up to 24KHz
ELC is set to trigger external
count in Timer RJ or TAU,
when timer RD underflows
Interrupt is not generated, so
ISR is not accessed
Event Counter
Timer is set to external event count mode.
Timer counts down on each ELC trigger.
When the count reaches zero the interrupt
is generated. (The event count value is
reloaded automatically)
This is the Control Loop Interrupt
13
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 Example - Automatic Interrupt Culling
Timer RD
TRD1
Underflow
Example Shown
• Timer RD set to 24KHz PWM frequency
• Timer RJ/ TAU set to Event counter
- 24KHz / 3 = 8KHz
• ELC set to trigger Timer RJ (event count) every
TRD1 underflow
Timer RJ/TAU Interrupt
i.e. Control Loop Interrupt
Timer RJ or TAU (CH0 or CH1)
14
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 – Hardware Shutdown
INTP0 Interrupt: RD Software Shutdown
I/O Port Pin P137 – INTP0
Complementary PWM
External Over Current Interrupt
Hardware Output PWM Shutdown
15
© 2012 Renesas Electronics Europe. All rights reserved.
16
© 2012 Renesas Electronics Europe. All rights reserved.
Self Test / Safety Functions – RL78/G14
Run @ Start Up
User Protection Options (Optional)
Register Tests
(Software)
Watchdog
RAM Test
(Software)
Flash and Data Flash ECC
CRC
(Hardware)
RAM Parity
System Clock Test
Illegal Access Protection
(Hardware Detection)
(Option - clock cannot be stopped
Set in Option Byte)
Always On
(Hardware Parity generator/checker)
(Software or Hardware)
SFR Protection
(SFR write protect)
RAM area Protection
(RAM area write protect)
17
© 2012 Renesas Electronics Europe. All rights reserved.
18
© 2012 Renesas Electronics Europe. All rights reserved.
RL78/G14 Motor control Kit – Board details
PATCH AREA
INTERNAL POWER STAGE
Motor Connector
External Power
Connectors
STEP-DOWN 12V
STEP-DOWN 5V
HALL SENSORS
INTERFACE
EXTERNAL
POWER STAGE
INTERFACE
STEP_UP
G14
78K0/USB
Renesas Parts used
• RL78G14 (R5F104LE or 104PJ)
RL78G14
MICROCONTROLLER
•
•
•
•
64pin or 100pin
ENCODER
INTERFACE
RL78G14
MICROCONTROLLER
ISOLATION
COMMUNICATION
connections
© 2012 Renesas Electronics Europe. All rights reserved.
78K0/USB (uPD78F0730)
Power MosFets - RJK0654
Analogue Comparator - HAT1631
EEPROM - R1EX240
RL78/G14 MC Kit - PC Control GUI
Motor Operation graphs
- Speeds, Currents and Voltages
Function Tabs
Property Monitor where motor
parameters can be analysed
Motor Control
- Start , Stop, Speed
and Direction
DEMO Mode
- Speed, Currents, Voltages, Torque
- Operation and Parameters can be saved
to Excel file
Motor Tuning Parameters
© 2012 Renesas Electronics Europe. All rights reserved.
System Parameters
RL78/G14 Motor control Kit Resources
Resource
Usage
Value
Notes
Device
R5F104LE (64KB (F), 5.5KB (R) 4KB (DF)
R5F104PJ (256KB (F), 24KB (R), 8KB (DF)
64pin
100pin
Dual footprint supported
Flash
Memory
Source Code
13KB
Includes




Motor control algorithm
GUI serial interface
Data Flash interface
IEC Self test code
Constants
2KB
RAM
Memory
All variables
2KB
Timing
Control Loop Interrupt
8KHz
(125uS)
Includes
Control loop execution time
86uS
70% CPU used
Includes
 Motor Control Algorithm
 Reference CRC table
 Data Flash Library
Includes
 Motor control algorithm
 Data Flash Library
 Self Test variables
© 2012 Renesas Electronics Europe. All rights reserved.
 Motor Control Algorithm
 Data Flash interface
 GUI interface
Renesas Electronics Europe
© 2012 Renesas Electronics Europe. All rights reserved.
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising