* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download 7L02I_Pocs_RL78_Motor_Lab - Renesas e
Survey
Document related concepts
Brushless DC electric motor wikipedia , lookup
Voltage optimisation wikipedia , lookup
Distributed control system wikipedia , lookup
Opto-isolator wikipedia , lookup
Resilient control systems wikipedia , lookup
Electronic engineering wikipedia , lookup
Printed electronics wikipedia , lookup
Power electronics wikipedia , lookup
Induction motor wikipedia , lookup
Control theory wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Control system wikipedia , lookup
Brushed DC electric motor wikipedia , lookup
Stepper motor wikipedia , lookup
Transcript
Sensorless Vector Control with RL78G14 John Pocs, Applications Engineering Manager Class ID: 7L02I Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. John Pocs Sr. Application Engineering Manager Application focus: motor control, PFC Support Renesas MCUs, Rx, V850, RL78 20+ years embedded system development, application and industrial experience 16 yrs with Renesas Electronics/ NEC Electronics – Hardware, firmware, development tools, applications 8 yrs with Electronics Detection Systems – Life safety, security systems and CCTV 5 yrs with Anina (Romania) Power Generation Plant – Power generator, plant automation, power inverters Knowledge in 8/16/32-bit MCUs MSEE – San Francisco State University Diploma Engineer in Industrial Electronics from Polytechnic Institute Iasi - Romania 2 © 2012 Renesas Electronics America Inc. All rights reserved. Renesas Technology & Solution Portfolio 3 © 2012 Renesas Electronics America Inc. All rights reserved. Microcontroller and Microprocessor Line-up 2010 2013 1200 DMIPS, Superscalar 32-bit Automotive & Industrial, 65nm 600µA/MHz, 1.5µA standby 1200 DMIPS, Performance Automotive, 40nm 500µA/MHz, 35µA deep standby 500 DMIPS, Low Power Automotive & Industrial, 90nm 600µA/MHz, 1.5µA standby 165 DMIPS, FPU, DSC Industrial, 40nm 242µA/MHz, 0.2µA standby 165 DMIPS, FPU, DSC Industrial, 90nm 242µA/MHz, 0.2µA standby 8/16-bit 25 DMIPS, Low Power Industrial, 90nm 1mA/MHz, 100µA standby Industrial & Automotive, 150nm 190µA/MHz, 0.3µA standby 44 DMIPS, True Low Power 10 DMIPS, Capacitive Touch Industrial & Automotive, 130nm 144µA/MHz, 0.2µA standby Industrial Automotive, 130nm Wide Format&LCDs 350µA/MHz, 1µA standby 4 Embedded Security, ASSP © 2012 Renesas Electronics America Inc. All rights reserved. Enabling the Smart Society Energy efficiency is key to a Smart Society Energy harvesting Home Automation Smart Metering Industrial Motors Motor control is key to efficient energy management 5 © 2012 Renesas Electronics America Inc. All rights reserved. Agenda Introduction to the Field Oriented Control (FOC) with Sensorless Speed and Position Detection Challenges to implement SVC on 16-bit MCUs RL78G14 special features Implementation with RL78G14 Introduction to the RL78G14 kit Lab procedure 6 Setup Sensorless Vector Control Demo Sample motor currents and DC bus voltage Drive motor in open loop Understand sensorless position and speed estimation Drive motor by closing the speed loop Tune motor operation © 2012 Renesas Electronics America Inc. All rights reserved. Sensorless Vector Control Loop Inverse Park transform Commanded speed r* r r Actual speed iq * Speed Regulator id 0 * id iq iq PI Regulator Uq * U d,q to id PI Regulator Ud , T 1 ( ) * U PWM1~6 * , * to a, b, c iq Clarke transform to d,q i T ( ) r a,b,c to i , Speed Estimation Computation intensive operations © 2012 Renesas Electronics America Inc. All rights reserved. ia , id Voltage Source 3-phase Inverter SIN PWM Motor Model Based Flux and Position Observer Park transform 7 DC Bus Inverse Clarke transform ib 3-phase PMSM Examples of control equations Phase voltages: νa, νb, νc – ia, ib, ic phase currents – Rs stator resistance – λ magnetic flux linkage Clark transformation – 3-phase to 2-phase in stator frame Park transformation – ω – L 8 angular speed mutual inductance © 2012 Renesas Electronics America Inc. All rights reserved. Challenges of 16-bit MCUs for Motor Control Most 16-bit MCUs are CISC architecture Good code density (smaller memory needed) Execution time may not be fast enough for real-time control Representation of quantities is range limited 0 to 65536 unsigned -32768 to 32768 signed Without FPU scaling needs to be used Scaling limitation Multiply-Accumulate (MAC) operation: a = a + (b * c) d=b*c a=a+d Can the 16-Bit MCUs do field oriented sensorless control? Yes with the right performance and peripherals! 9 © 2012 Renesas Electronics America Inc. All rights reserved. RL78G14: 16-bit MCU for Motor Control 16-Bit CISC CPU Core Memory Program Flash up to 64KB SRAM up to 5.5KB Data Flash up to 4KB System DTC Interrupt Controller 4 Levels, 20 pins Clock system Analog 20MHz External Clock 32.768KHz Internal OCO up to 64MHz Motor Control Support Timers External Clock 2 x Timer Array 16-bit, 4ch ADC 10-bit, 12ch Interval Timer 12-bit, 1ch Internal Vref. POR, LVD Internal LOCO 15KHz Window WDT 17-bit , 1ch Temp. Sensor MUL/DIV/MAC Clock Monitoring RTC Calendar Communications Debug Single-Wire Safety Power Management Parity Check/protection HALT RTC,DMA Enabled ADC Self-diagnostic SNOOZE Serial,ADC Enabled SFR protection STOP SRAM On Memory CRC RAM 2 x I2C Master / Slave Motor Control 3ph MC Timer RD 16-bit with dead time Encoder Timer RG 16-bit, 1ch Timer RJ 16-bit , 1ch ELC 10 © 2012 Renesas Electronics America Inc. All rights reserved. 41 DMIPS @32MHz 3-stage pipelined Harvard architecture MUL/DIV/MAC instructions 16-Bit Barrel Shifter 1 x I2C Multi-Master 2 x CSI/SPI 7-, 8-bit 3 x UART 7-, 8-, 9-bit 1 x LIN 1ch 16-Bit Motor Control Timers – 64MHz / 1% Internal Clock – RD for 3-Phase PWM – RJ for interrupt culling – RG for quadrature encoder ADC trigger Event Link Controller (ELC) Data Transfer Controller (DTC) Hardware Safety – Independent Watchdog – Hardware shutdown Self-test o Flash ECC, RAM Parity, H/W CRC, WDT, A/D, RAM/SFR write protect, Clock monitor High Performance Optimized Architecture 16-bit CPU core with pipelining Efficient instruction execution – 86% in 1-2 cycles Single cycle multiplication (HW math assist) Data transfer controller (up to 24 channels) HW math assist 16-bit barrel shifter multiply signed & unsigned multiply/accumulate signed & unsigned 11 © 2012 Renesas Electronics America Inc. All rights reserved. Operation Clock cycles shift/rotate by n (n = 1-15) 1 16 x 16 = 32 Bit result 2 16 x 16 + 32 = 32 Bit result 3 Motor Timer RD Timer RD Registers TRDGRA0 Waveform Control TRDIOC0 PERIOD RD0 U TRDGRD0 TRDGRB0 DUTY 1 /U V TRDGRC1 TRDGRA1 DUTY 2 /V TRDIOB0 TRDIOD0 TRDIOA1 TRDIOC1 RD1 W 12 TRDGRD1 TRDGRB1 Buffer Compare © 2012 Renesas Electronics America Inc. All rights reserved. DUTY 3 /W TRDIOB1 TRDIOD1 Complementary PWM Operation TRD0 Value in TRDGRA0 TRD1 Value in TRDGRB0 Value in TRDGRA1 Value in TRDGRB1 TRDIOB0 Output TRDIOD0 Output TRDIOA1 Output TRDIOC1 Output 13 U /U V /V TRDIOB1 Output W TRDIOD1 Output /W © 2012 Renesas Electronics America Inc. All rights reserved. Event Link Controller (ELC) ELC links Inputs and Outputs of internal peripherals Performance benefits: Reduces CPU load, interrupts, program size and power consumption Improves real-time operation CPU External analog input voltage Interrupt Controller External analog input voltage Interrupt Controller Comparator Comparator Timer ELC Timer A/D Standard processing 14 © 2012 Renesas Electronics America Inc. All rights reserved. A/D Processing with ELC ELC: 3cyc CPU Using Interrupt: > 9-16 cyc Enables direct control of I/O ports and built in event timers Data Transfer Controller (DTC) Data transfer between memory and registers without CPU use Reduced CPU overhead Memory, SFR CPU Memory, SFR CPU DTC DTC DTC unused DTC used DTC Performance (G14 64-pin) 15 Number of channels 24 ch Address space for transfer 64 KB Max. transmission time/ Block size 256 times / 512B Transmission target memory ⇔ memory memory ⇔ SFR Activation sources 31 © 2012 Renesas Electronics America Inc. All rights reserved. RL78/G14 Use for Motor Control Control loop cycle management PWM interrupt culling (skipping) – Timer RD: PWM frequency - 24KHz – Timer RJ: Event count mode Count down from 2 to 0 – ELC : – Control loop frequency set by Timer RJ underflow interrupt @8KHz Timer RD 16 Interrupt Controller Timer RD Input from Timer RD Output to Timer RJ Complementary PWM CPU ELC Timer RJ Timer RJ Event Link Controller TRD1 Underflow Trigger © 2012 Renesas Electronics America Inc. All rights reserved. Event Input Trigger Event Counter Software Flow – Main Loop Main loop synchronization cnt_init==0? Hardware and software Init cnt_init=NUM_INT Interrupt enabling Main loop body 125us Interrupt Speed ramp management Communication management 10ms Main loop General board management Parameter modification management 17 © 2012 Renesas Electronics America Inc. All rights reserved. Software Flow – Control Interrupt Phase current reading Park and Clarke transformations iu, iv, iw iα, iβ id, iq DC bus voltage reading Rotor phase angle calculation Current PI processing (idref, iqref), (idmea, iqmea), vdout, vqout Inverse Clarke and Park transformations vdout, vqout vαout, vβout, vuout, vvout, vwout PWM duty update Rotor phase estimation: θest Speed estimation: ωest Speed PI processing or Start up Main loop synchronization 18 © 2012 Renesas Electronics America Inc. All rights reserved. Physical quantities represented as 16-bit signed integers 19 32-Bit: -2147483648 to +2147483648 16-Bit: -32768 to +32768 sin(), cos(): (-1 to +1) x 16384 -16384 to +16384 Voltages (V): (0 to 511.9) x 64 32768 Currents (A): (0 to 32) x 1024 32768 Resistance (Ω): (0 to 128) x 256 32768 Inductance (Henry): (0 to 2) x 16384 32768 Magnetic flux (Weber): (0 to 8) x 4096 32768 © 2012 Renesas Electronics America Inc. All rights reserved. High Integration = Cost Reduction Reduce system BOM by eliminating external components Voltage Regulator (1.6V to 5.5V input) EEPROM IC Dedicated flash memory for data storage (Data Flash) Supply Regulator IC Voltage Monitoring REG Reset IC DATA FLASH RL78 CPU LVD SRAM POR WDT PERIPHERALS Internal Reset CODE FLASH OCO Accurate Internal Oscillators Temp. Sensor PERIPHERALS X1 Temp. IC 20 © 2012 Renesas Electronics America Inc. All rights reserved. Temperature Sensor 20mA port drive (no need for external transistors) IEC60730 in HW (Easier/quicker certification) Sensorless Vector Control Lab Agenda 21 Setup Sensorless Vector Control Demo Sample motor currents and DC bus voltage Drive motor in open loop Understand sensorless position and speed estimation Drive motor by closing the speed loop Tune motor operation © 2012 Renesas Electronics America Inc. All rights reserved. Introduction to the RL78G14 Kit 22 © 2012 Renesas Electronics America Inc. All rights reserved. RL78G14 Kit 23 © 2012 Renesas Electronics America Inc. All rights reserved. RL78G14 Board 24 © 2012 Renesas Electronics America Inc. All rights reserved. Lab Overview Lab Objectives Lab Materials 1. Get familiar with the RL78G14 starter kit and drive the motor. Please verify you have the following materials at your lab station. 2. Understand ADC sampling to measure motor currents and DC bus voltage. 3. Drive the motor in open loop. 4. Understand sensorless position and speed estimation. 5. Drive motor by closing the speed loop 6. Understand motor tuning RL78G14 Motor Control Evaluation Kit with E1 emulator, two USB cables, 24V DC power supply, control board and motor Laptop with the CD drive Skill Level 1. Familiar with motor control techniques Time to Complete Lab 100 Minutes 25 © 2012 Renesas Electronics America Inc. All rights reserved. 2. Familiar with sensorless vector control concepts 3. Familiar with IAR Embedded Workbench Enabling the Smart Society Energy efficiency is key to a Smart Society Energy harvesting Home Automation Smart Metering Industrial Motors Motor control is key to efficient energy management 26 © 2012 Renesas Electronics America Inc. All rights reserved. Questions? 27 © 2012 Renesas Electronics America Inc. All rights reserved. Start Lab Please refer to the lab handout Go ahead and start the lab 28 © 2012 Renesas Electronics America Inc. All rights reserved. Summary Introduced FOC with sensorless speed and position detection Challenges to implement SVC on 16-bit MCUs RL78G14 special features Implementation with RL78G14 Introduced the RL78G14 kit Lab procedure 29 Setup sensorless vector control demo Sampled motor currents and DC bus voltage Drove motor in open loop Examined sensorless position and speed estimation Drove motor by closing the speed loop Tuned motor operation © 2012 Renesas Electronics America Inc. All rights reserved. Please Provide Your Feedback… Please utilize the ‘Guidebook’ application to leave feedback or Ask me for the paper feedback form for you to use… 30 © 2012 Renesas Electronics America Inc. All rights reserved. Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved.