SlideShare ist ein Scribd-Unternehmen logo
1 von 30
The World Leader in High Performance Signal Processing Solutions

Model-Based Design For
Motor Control Development
Paul Crook – Analog Devices
Topics
 Developing

motor control applications using modelbased design and automatic code generation
Hardware platform
 Model-Based Design overview
 Modeling of motor control systems
 Simulation and automatic code generation
 Running generic C-code on embedded platform
 When to use MBD and when to use “traditional” design
methods


2
ADI Demo Platforms

Motor Drive hardware
 3 phase PM motor
 PC with MATLAB®, Simulink®, and IAR Embedded Workbench


3
HW Platform

100V-250V AC input with PFC, 5A
 Isolated current, position, voltage and diagnostic feedback
 3-phase, 0.55kW, permanent magnet synchronous motor


4
ADSP-CM40x  Embedded Target
 Key

Points

ARM CORTEX M4F
 240MHz
 Two 16-bit ADCs
 380ns conversion
time
 SINC filter
 384kB SRAM
 2MB Flash
 20 DMA channels
 Peripherals for
motor control
 Communication
interfaces


5
MODEL-BASED DESIGN

6
Why Model-Based Design?
•
•
•
•

7

Requirements Development
System Simulation
Automatic Code Generation
Continuous Verification
The Traditional Design Process
Requirements Phase

Design Phase

Realization Phase

Testing Phase

8
Traditional Design of a Multi-Domain System
Research & Requirements

Hardware

Software

Mechanical

Requirements

Requirements

Requirements

Design

Design

Design

Realization

Realization

Realization

Testing

Testing

Testing

Integration, Test & Certification
9
The Cost of a Traditional Design Process

Source: ROI for IV&V, NASA

10
Model-Based Design
RESEARCH

• Model multi-domain systems

REQUIREMENTS

• Explore and optimize system
behavior in floating point and fixed
point

DESIGN

Environment Models

Algorithms

IMPLEMENTATION

TEST & VERIFICATION

Physical Components

• Collaborate across teams and
continents
• Generate efficient code
• Explore and optimize
implementation tradeoffs

C, C++

ARM

• Automate regression testing
• Detect design errors
• Parameter tuning

INTEGRATION

11

• Support certification and standards
Model-Based Design for Embedded System
Development
Executable models
- Unambiguous
-“One Truth”

Executable
Specifications

Simulation
- Reduces “real” prototypes
- Iterative “what-if” analysis

Design
with
Simulation

Models

Continuous
Test and
Verification

Automatic
Code Generation

Automatic code generation
12

- Minimizes coding errors

Test with Design
- Detects errors earlier
Steps in MBD approach
1. Plant modeling
- Motor, load, power electronics etc.

2. Interface modeling
- Sensors, device drivers

3. Controller modeling
- Field oriented control of 3 phase PM motor

4. Analysis and synthesis
- The models created in step 1-3 are used to identify dynamic
characteristics of the plant model.
- Tuning and configuration of system

5. Validation and test
- Offline simulation and/or real-time simulation
- Time response of the dynamic system is investigated

6. Deployment to embedded target
- Automatic code generation
- Test and verification
13
Steps in MBD approach
System Model
Test
Signals

Controller
Model

Motor/inverter
Model

Verify

PC

Code
Generation

System
Embedded Controller

Motor/inverter

Target

HW

Motor Drive System

 Simulation

of Controller and Plant model
 Off-line development of algorithms without access to HW
 Code generation and deployment to embedded controller
 Comparison between simulation and actual implementation

14
Model complexity
 What

is a good model?

 Represent

the states of interest
 Supports automatic code generation
 Execute fast
 Use existing (trusted) libraries
 Reusable across platforms

Right balance

Too little
5

15

?

Too much
Model complexity
 Understanding

strengths and weaknesses of tools is critical
when defining model scope

Strength

Weakness
16

- Solving differential equation
- Time domain modeling
- Visualization
- Target specific setup
- Managing system resources
- Time scheduling

- Register setup and control
- Managing System resources
- Time scheduling
- Real time control systems
- Debugging and test
- Visualization
Interfacing to Embedded Target
 SW

architecture

C-code needs to be tied to embedded platform
 Utilizing strength of multiple environments
 Graphical environment for application code development
 “Classic” C-code for target specific control
Platform
independent

 Generic

Control Algorithm

Platform
dependent

HW interface layer

Embedded Platform
17
Interfacing Embedded Target

 Two

platforms – one implementation

 Common

control algorithm for Simulation and Embedded system
 Platform specific device drivers or behavioral models
 Debug algorithm using simulation and test on embedded platform
18
Drive system feedback and control

Feedback

19
Motor Control Application Program

Power Inverter and Motor

Device Driver

Auto
code

MC Algorithm

MC Application
Firmware
20

MC „C‟ code
CC & Link Device drivers
Application code

Sensors, interfaces and
Device Drivers
AC Motor Algorithm (Field Oriented Control)







21

Shaft position sensor measures rotor magnet (flux) position – velocity is calculated.
Two/three motor currents measured (two is enough).
Clarke-Park transfer calculate Torque (Iq) and Flux (Id) components of current.
Speed loop generates Iq reference; Id reference set to zero for PMSM.
Current loops and Field alignment generates a,b,c voltage commands.
Field oriented control

22
Simulation
Simulink scopes

Code debugging

Data analysis in MATLAB
Magnitude [dB]

0
-50
-100
-150
-200
-250

0

1000

2000
3000
Frequency [kHz]

4000

5000

0

1000

2000
3000
Frequency [kHz]

4000

5000

Phase [Degrees]

0
-1000
-2000

-3000

23
Generating C-code

24
Building and Linking – IAR EWB

25
Building and Linking
ARM Library

Motor Control

- M3/M4 support

- FOC functions

Matlab/Simulink
Legacy code

Device Drivers

- Existing code

- Functional model
C-code

Device drivers

System resources

- SW enablement
package

- Allocation & setup
C-code

Workbench

Application code
- State machines

Scheduling
Executable

CM40x

26

C-code

- IRQs/RTOS
Running target
 MATLAB

GUI + embedded engine
 Streaming data back to MATLAB
Captured runtime data

Duty-cycle

1000
500
0
-500
-1000

Phase current

4

0

20

40

60

80

100

120

140

160

180

200

0

20

40

60

80

100

120

140

160

180

200

0

20

40

60

80
100
120
Sample number

140

160

180

200

x 10

4

3.5
3
2.5

Rotor angle

8
6
4
2
0

27
Sampling domains

10 kHz

1 kHz

28
Summary
 Model-Based

Design
 System modeling and simulation
 Automatic code generation
 Modeling of motor control systems
 Electronics/mechanical
 Interfaces
 Control algorithm
 Interfacing

generic C-code to embedded target

 Use

of different environments
 Device drivers
 Debugging
 Off-line
 In

29

real-time

and test
Questions

30

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Hardware in loop simulation
Hardware in loop simulationHardware in loop simulation
Hardware in loop simulation
 
Simulink Stateflow workshop
 Simulink Stateflow workshop Simulink Stateflow workshop
Simulink Stateflow workshop
 
Autosar fundamental
Autosar fundamentalAutosar fundamental
Autosar fundamental
 
UDS Protocol Stack | Manual Guide | Fact Sheet
UDS Protocol Stack | Manual Guide | Fact SheetUDS Protocol Stack | Manual Guide | Fact Sheet
UDS Protocol Stack | Manual Guide | Fact Sheet
 
Software defined vehicles,automotive standards (safety, security), agile cont...
Software defined vehicles,automotive standards (safety, security), agile cont...Software defined vehicles,automotive standards (safety, security), agile cont...
Software defined vehicles,automotive standards (safety, security), agile cont...
 
AUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackAUTOSAR 403 CAN Stack
AUTOSAR 403 CAN Stack
 
AUToSAR introduction
AUToSAR introductionAUToSAR introduction
AUToSAR introduction
 
Rhapsody and mechatronics, multi-domain simulation
Rhapsody and mechatronics, multi-domain simulationRhapsody and mechatronics, multi-domain simulation
Rhapsody and mechatronics, multi-domain simulation
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Autosar software component
Autosar software componentAutosar software component
Autosar software component
 
What is AUTOSAR MCAL? Learn about the software module architecture and device...
What is AUTOSAR MCAL? Learn about the software module architecture and device...What is AUTOSAR MCAL? Learn about the software module architecture and device...
What is AUTOSAR MCAL? Learn about the software module architecture and device...
 
13090016_vectorcast.ppt
13090016_vectorcast.ppt13090016_vectorcast.ppt
13090016_vectorcast.ppt
 
Communication stack
Communication stackCommunication stack
Communication stack
 
System Engineering Unit-3
System Engineering Unit-3System Engineering Unit-3
System Engineering Unit-3
 
Automative basics v3
Automative basics v3Automative basics v3
Automative basics v3
 
Introduction to ASPICE
Introduction to ASPICEIntroduction to ASPICE
Introduction to ASPICE
 
engine control unit (ECU)
engine control unit (ECU)engine control unit (ECU)
engine control unit (ECU)
 
UDS PPT
UDS PPTUDS PPT
UDS PPT
 
Under the Hood: Model-Based Development in the Automotive Industry by Darren ...
Under the Hood: Model-Based Development in the Automotive Industry by Darren ...Under the Hood: Model-Based Development in the Automotive Industry by Darren ...
Under the Hood: Model-Based Development in the Automotive Industry by Darren ...
 
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan KController Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
 

Andere mochten auch

Collaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping StudyCollaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping Study
Davide Ruscio
 

Andere mochten auch (12)

Toward automatic Model-In-the-Loop testing of Electronic Vehicle Information ...
Toward automatic Model-In-the-Loop testing of Electronic Vehicle Information ...Toward automatic Model-In-the-Loop testing of Electronic Vehicle Information ...
Toward automatic Model-In-the-Loop testing of Electronic Vehicle Information ...
 
Collaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping StudyCollaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping Study
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
ASME Webinar: Model-Driven Innovation in Machine Design
ASME Webinar: Model-Driven Innovation in Machine DesignASME Webinar: Model-Driven Innovation in Machine Design
ASME Webinar: Model-Driven Innovation in Machine Design
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML Models
 
TextUML Toolkit
TextUML ToolkitTextUML Toolkit
TextUML Toolkit
 
How To Improve PID
How To Improve PIDHow To Improve PID
How To Improve PID
 
Evolution in the Large and in the Small in Model-Driven Development
Evolution in the Large and in the Small in Model-Driven DevelopmentEvolution in the Large and in the Small in Model-Driven Development
Evolution in the Large and in the Small in Model-Driven Development
 
V diagram por inverter control
V diagram por inverter controlV diagram por inverter control
V diagram por inverter control
 
Test automation
Test automationTest automation
Test automation
 
Model Based Design of Hybrid and Electric Powertrains
Model Based Design of Hybrid and Electric PowertrainsModel Based Design of Hybrid and Electric Powertrains
Model Based Design of Hybrid and Electric Powertrains
 
FPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC MotorFPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC Motor
 

Ähnlich wie Model-Based Design For Motor Control Development

Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E AFuture Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
GlobalLogic Croatia
 
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
Electromate
 

Ähnlich wie Model-Based Design For Motor Control Development (20)

Mechatronics design team project v2
Mechatronics design team project v2Mechatronics design team project v2
Mechatronics design team project v2
 
Webinar on Latency and throughput computation of automotive EE network
Webinar on Latency and throughput computation of automotive EE networkWebinar on Latency and throughput computation of automotive EE network
Webinar on Latency and throughput computation of automotive EE network
 
OPAL-RT RT13 Conference: Rapid control prototyping solutions for power electr...
OPAL-RT RT13 Conference: Rapid control prototyping solutions for power electr...OPAL-RT RT13 Conference: Rapid control prototyping solutions for power electr...
OPAL-RT RT13 Conference: Rapid control prototyping solutions for power electr...
 
PLC AND SCADA
PLC AND SCADA PLC AND SCADA
PLC AND SCADA
 
Automation(plc&scada)
Automation(plc&scada)Automation(plc&scada)
Automation(plc&scada)
 
Inception Institute of Industrial Training Brochure 2014 by APRM
Inception Institute of Industrial Training Brochure 2014 by APRMInception Institute of Industrial Training Brochure 2014 by APRM
Inception Institute of Industrial Training Brochure 2014 by APRM
 
Can based collision aviodance system for automobiles
Can based collision aviodance system for automobilesCan based collision aviodance system for automobiles
Can based collision aviodance system for automobiles
 
Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E AFuture Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
Future Intelligent Mobility with Adaptive AUTOSAR - Transforming Vehicle E/E A
 
PCB Virtual Prototyping with PSpice
PCB Virtual Prototyping with PSpicePCB Virtual Prototyping with PSpice
PCB Virtual Prototyping with PSpice
 
Ch1
Ch1Ch1
Ch1
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Psim brochure press
Psim brochure pressPsim brochure press
Psim brochure press
 
15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA
 
Improving Dependability of Embedded Software System
Improving Dependability of Embedded Software SystemImproving Dependability of Embedded Software System
Improving Dependability of Embedded Software System
 
SHERLOG DFR 2016
SHERLOG DFR 2016SHERLOG DFR 2016
SHERLOG DFR 2016
 
Automotive 2017
Automotive 2017Automotive 2017
Automotive 2017
 
QGen GNAT Industrial User Day
QGen GNAT Industrial User DayQGen GNAT Industrial User Day
QGen GNAT Industrial User Day
 
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
 
Wfcs2019
Wfcs2019Wfcs2019
Wfcs2019
 
Hardware-Software allocation specification of IMA systems for early simulation
Hardware-Software allocation specification of IMA systems for early simulationHardware-Software allocation specification of IMA systems for early simulation
Hardware-Software allocation specification of IMA systems for early simulation
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Model-Based Design For Motor Control Development

  • 1. The World Leader in High Performance Signal Processing Solutions Model-Based Design For Motor Control Development Paul Crook – Analog Devices
  • 2. Topics  Developing motor control applications using modelbased design and automatic code generation Hardware platform  Model-Based Design overview  Modeling of motor control systems  Simulation and automatic code generation  Running generic C-code on embedded platform  When to use MBD and when to use “traditional” design methods  2
  • 3. ADI Demo Platforms Motor Drive hardware  3 phase PM motor  PC with MATLAB®, Simulink®, and IAR Embedded Workbench  3
  • 4. HW Platform 100V-250V AC input with PFC, 5A  Isolated current, position, voltage and diagnostic feedback  3-phase, 0.55kW, permanent magnet synchronous motor  4
  • 5. ADSP-CM40x  Embedded Target  Key Points ARM CORTEX M4F  240MHz  Two 16-bit ADCs  380ns conversion time  SINC filter  384kB SRAM  2MB Flash  20 DMA channels  Peripherals for motor control  Communication interfaces  5
  • 7. Why Model-Based Design? • • • • 7 Requirements Development System Simulation Automatic Code Generation Continuous Verification
  • 8. The Traditional Design Process Requirements Phase Design Phase Realization Phase Testing Phase 8
  • 9. Traditional Design of a Multi-Domain System Research & Requirements Hardware Software Mechanical Requirements Requirements Requirements Design Design Design Realization Realization Realization Testing Testing Testing Integration, Test & Certification 9
  • 10. The Cost of a Traditional Design Process Source: ROI for IV&V, NASA 10
  • 11. Model-Based Design RESEARCH • Model multi-domain systems REQUIREMENTS • Explore and optimize system behavior in floating point and fixed point DESIGN Environment Models Algorithms IMPLEMENTATION TEST & VERIFICATION Physical Components • Collaborate across teams and continents • Generate efficient code • Explore and optimize implementation tradeoffs C, C++ ARM • Automate regression testing • Detect design errors • Parameter tuning INTEGRATION 11 • Support certification and standards
  • 12. Model-Based Design for Embedded System Development Executable models - Unambiguous -“One Truth” Executable Specifications Simulation - Reduces “real” prototypes - Iterative “what-if” analysis Design with Simulation Models Continuous Test and Verification Automatic Code Generation Automatic code generation 12 - Minimizes coding errors Test with Design - Detects errors earlier
  • 13. Steps in MBD approach 1. Plant modeling - Motor, load, power electronics etc. 2. Interface modeling - Sensors, device drivers 3. Controller modeling - Field oriented control of 3 phase PM motor 4. Analysis and synthesis - The models created in step 1-3 are used to identify dynamic characteristics of the plant model. - Tuning and configuration of system 5. Validation and test - Offline simulation and/or real-time simulation - Time response of the dynamic system is investigated 6. Deployment to embedded target - Automatic code generation - Test and verification 13
  • 14. Steps in MBD approach System Model Test Signals Controller Model Motor/inverter Model Verify PC Code Generation System Embedded Controller Motor/inverter Target HW Motor Drive System  Simulation of Controller and Plant model  Off-line development of algorithms without access to HW  Code generation and deployment to embedded controller  Comparison between simulation and actual implementation 14
  • 15. Model complexity  What is a good model?  Represent the states of interest  Supports automatic code generation  Execute fast  Use existing (trusted) libraries  Reusable across platforms Right balance Too little 5 15 ? Too much
  • 16. Model complexity  Understanding strengths and weaknesses of tools is critical when defining model scope Strength Weakness 16 - Solving differential equation - Time domain modeling - Visualization - Target specific setup - Managing system resources - Time scheduling - Register setup and control - Managing System resources - Time scheduling - Real time control systems - Debugging and test - Visualization
  • 17. Interfacing to Embedded Target  SW architecture C-code needs to be tied to embedded platform  Utilizing strength of multiple environments  Graphical environment for application code development  “Classic” C-code for target specific control Platform independent  Generic Control Algorithm Platform dependent HW interface layer Embedded Platform 17
  • 18. Interfacing Embedded Target  Two platforms – one implementation  Common control algorithm for Simulation and Embedded system  Platform specific device drivers or behavioral models  Debug algorithm using simulation and test on embedded platform 18
  • 19. Drive system feedback and control Feedback 19
  • 20. Motor Control Application Program Power Inverter and Motor Device Driver Auto code MC Algorithm MC Application Firmware 20 MC „C‟ code CC & Link Device drivers Application code Sensors, interfaces and Device Drivers
  • 21. AC Motor Algorithm (Field Oriented Control)      21 Shaft position sensor measures rotor magnet (flux) position – velocity is calculated. Two/three motor currents measured (two is enough). Clarke-Park transfer calculate Torque (Iq) and Flux (Id) components of current. Speed loop generates Iq reference; Id reference set to zero for PMSM. Current loops and Field alignment generates a,b,c voltage commands.
  • 23. Simulation Simulink scopes Code debugging Data analysis in MATLAB Magnitude [dB] 0 -50 -100 -150 -200 -250 0 1000 2000 3000 Frequency [kHz] 4000 5000 0 1000 2000 3000 Frequency [kHz] 4000 5000 Phase [Degrees] 0 -1000 -2000 -3000 23
  • 25. Building and Linking – IAR EWB 25
  • 26. Building and Linking ARM Library Motor Control - M3/M4 support - FOC functions Matlab/Simulink Legacy code Device Drivers - Existing code - Functional model C-code Device drivers System resources - SW enablement package - Allocation & setup C-code Workbench Application code - State machines Scheduling Executable CM40x 26 C-code - IRQs/RTOS
  • 27. Running target  MATLAB GUI + embedded engine  Streaming data back to MATLAB Captured runtime data Duty-cycle 1000 500 0 -500 -1000 Phase current 4 0 20 40 60 80 100 120 140 160 180 200 0 20 40 60 80 100 120 140 160 180 200 0 20 40 60 80 100 120 Sample number 140 160 180 200 x 10 4 3.5 3 2.5 Rotor angle 8 6 4 2 0 27
  • 29. Summary  Model-Based Design  System modeling and simulation  Automatic code generation  Modeling of motor control systems  Electronics/mechanical  Interfaces  Control algorithm  Interfacing generic C-code to embedded target  Use of different environments  Device drivers  Debugging  Off-line  In 29 real-time and test

Hinweis der Redaktion

  1. Welcome (30 mins)Introduce selfIntroduce topic – utilising model based design for motor control development and featuring our latest mixed signal processor aimed at these applications – the ADSP-CM40x
  2. Picture of the development platformPM motor110/220V power boardMCU development boardEmulatorIAR Embedded WorkbenchMatlab Simulink
  3. Block diagram of the hardware400W (0.5 HP) PM motorDriven by 3 phase driveIGBT moduleDriven by PWM signals Isolated measurment of DC link voltage and currentPFC circuitryOptions for phase current sensing:HEShunt via isolated sigma delta modulatorsPosition feedback optionsResolver via RDCEncoderADSP-CM40xARM Cortex M414 bit dual simultaneous sampling ADC4 channels of sinc filters for glueless interfacing to isolated sigma delta modulatorsComminations interfaces – CAN, RS485 and Rs232
  4. A little more detail on the MCU….
  5. Now moving on to discuss the development tool chain and, specifically MBD related to this application
  6. So what are the advantages to taking a MBD approach to development:The method allows clear and early inclusion of the system requirements within the modelPrior to the availability of hardware, system simulationAutomatic code generation from the modelThe ability to continuously verify results obtained from the hardware against the those obtained for the model
  7. The traditional design sequence
  8. This traditional design sequence can be expanded to encompass each aspect of the system:HardwareSwMechanicalFinally there is the need for integration and system verification testing
  9. Chart shows relative costs of defects found at various stages of developmentNote how costly it can be if issues with the requirements are identified during the testing phase….
  10. Diagram illustrates the flow of implementation using MBD:Model can incorporate mechanical, hw and sw systems allowing collaboration across multi-disciplinary teamsThe effect of different degrees of precision on system performance can be exploredCode can be automatically and efficiently generated from this model for the target hardwareThe effects of modification to the model can be easily explored bpthsithin the simulation environment and within the target system
  11. Adding further detail:Requirements specifications can be accurately and unambiguously captured within the modelSimulation allows us to conduct what if scenario testingFrom the model we can generate code which minimizies errors which may be introduced from hand codingThe model based approach allow coninuous testing and verification agains requirements
  12. Here we have the standard ‘V’ model of project development.The model for this motor control application was developed in the following sequence:
  13. Here we show the discrete models for the controller and plant.The controller algorithms can be developed without access to hardware and code automatically generated for the embedded targetThe results from both the simulation and implementation on target hardware can then be compared.
  14. Results are only as good as the modelUse of libraries is essential – if everything has to be developed from the ground up the work is significant
  15. The scope of the model should be confined to exploit the strengths of the modelling environment:Algorithm developmentVisualisationTasks such as time scheduling and management of systm resources are bedt handled outside of the model
  16. Architecture is similar to “normal” systemThe development sequence and development method is different
  17. Simulation, debugging, development -> PC platformSystem test, production code -> embedded platformOne system needs to run on two platformsSimulation environment has functional model of device drivers (type, interface)
  18. Model must reflect the real systemExpected to be a clear link between system block diagram and model
  19. Electric and electromechanicalMeasurement systemDevice driversControl algorithmCode generation for SILCode generation for embedded target
  20. Diving down from top level into Motor Control AlgorithmFOC of 3 phase PM motor
  21. Modeling technique relates to nature of systemDifferential equationsState-machinesContinuous/discrete timeTime/frequency domainDemo program demonstrates how to use all common modeling techniquesStandard Simulink blocksSimScape modelsMatlab scriptsLegacy C-code
  22. Time and frequency domain analysis
  23. Parts or all of the model can be build into C-codeExtensive configuration optionOptimization and cross-optimizationStatic testAdvisories
  24. Two sampling domains