designing the controller for an electromechanical …...armature current + - 12v up up down down v-...
TRANSCRIPT
![Page 1: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/1.jpg)
1© 2015 The MathWorks, Inc.
Designing the Controller for an
Electromechanical System Using a
Power Window Example
Vivek Raju
Application Engineer – Control Design
MathWorksDC Motor
![Page 2: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/2.jpg)
2
Power Window ModelingSystem Configuration
Armature Current
+- 12V
Up
Up Down
Down
V+V-
H-BridgeDC Motor
s1 s2
s3
Control SystemMechanism
Switches
![Page 3: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/3.jpg)
3
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 4: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/4.jpg)
4
Traditional development processes
Embedded
Software
C/C++
Electrical
Components
EDA
RESEARCH REQUIREMENTS
SPECIFICATIONS
DESIGN AND IMPLEMENTATION
Mechanical
Components
MCAD/
MCAE
Embeddable
Algorithms
Algorithm
Design
DESIGN AND IMPLEMENTATION
INTEGRATION AND TEST
Requirement Documents
Difficult to analyze
Difficult to manage changes
Paper Specifications
Easy to misinterpret
Difficult to integrate with design
Physical Prototypes
Incomplete and expensive
No system-level testing
Manual Coding
Time-consuming and introduces defects
Limited portability across targets
Traditional Testing
Design & integration issues found late
Limited traceability
![Page 5: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/5.jpg)
5
Model-Based Design Workflow
Testing algorithms against
requirements is done by simulating
the model.
Requirements are linked to the
model.
Detail is added from specific
domains to refine the model.
Automatically generate code from the
simulation model for implementing
directly on production targets:
• Microcontrollers
• FPGAs
• PLC IDEs
INTEGRATION
REAL-TIME TESTING
Structured
TextVHDL, VerilogC, C++
MCU DSP FPGA ASIC PLC, PAC
DESIGN
Environmental Models
Signal Processing & Control Algorithms
Mechanical Electrical
RESEARCH REQUIREMENTS
TE
ST
& V
ER
IFIC
AT
ION
![Page 6: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/6.jpg)
6
All the challenges can be
addressed by Model-Based
Design
Let us explore!!!
![Page 7: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/7.jpg)
7
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 8: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/8.jpg)
8
Requirements for the controller design
DESIGN
REQIREMENTS
Control
Algorithms
![Page 9: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/9.jpg)
9
What is Simulink®? What
applications can it simulate?
Block-diagram environment
Platform for Model-Based Design
Model, simulate, and analyze multi-
domain systems
Accurately design, simulate,
implement, and test:
– Control systems
– Signal processing systems
– Communications systems
– And other dynamic systems
![Page 10: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/10.jpg)
10
What is Simulink?
![Page 11: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/11.jpg)
11
What is Stateflow?
Extend Simulink with state charts and flow graphs
Design supervisory control, scheduling, and mode logic
Model state discontinuities and instantaneous events
![Page 12: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/12.jpg)
12
Design Control Logic using Stateflow
![Page 13: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/13.jpg)
13
Up Signal
Down SignalDriver
Up/Down
Obstacle Flag
Passenger
Up/Down
EndStop Flag
No Driver Input
Driver Down
Down
Driver Up
Up
No Passenger
Input
No Action
Passenger
Down
Down
Passenger
Up
Up
Control Strategy of Power WindowConcept Design of Window Control For Passenger
Down S/W Up S/W
EndStop /
No Input
Up S/WDown S/W
EndStop/
No Input
Emergency
Down
Down
Obstacle
![Page 14: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/14.jpg)
14
Modeling Power Window ControllerStateflow
Up Signal
Down SignalDriver
Up/Down
Obstacle Flag
Passenger
Up/Down
EndStop Flag
![Page 15: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/15.jpg)
15
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 16: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/16.jpg)
16
Verifying the control logic against a dynamic
system
DESIGN
REQIREMENTS
Control
Algorithms
Multi-Doman
Plant Model
![Page 17: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/17.jpg)
17
Simscape
Power Window ModelingSystem Configuration
Armature Current
+- 12V
Up
Up Down
Down
V+V-
H-BridgeDC Motor
s1 s2
s3
Control SystemSimMechanics
SimElectronicsSimElectronics
SimElectronics
Mechanism
Switches
![Page 18: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/18.jpg)
18
Session on Plant modeling
![Page 19: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/19.jpg)
19
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 20: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/20.jpg)
20
Model-Based Design lets you verify the design
using real-time simulation
REAL-TIME TESTING
Structured
TextVHDL, VerilogC, C++
MCU DSP FPGA ASIC PLC, PAC
DESIGN
Environmental Models
Signal Processing & Control Algorithms
Mechanical Electrical
RESEARCH REQUIREMENTS
![Page 21: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/21.jpg)
21
Automatically generate C code
![Page 22: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/22.jpg)
22
Code Generation Capabilities
Embedded Coder (C)
DSP & µC FPGA & ASIC
HDL Coder
(Verilog or VHDL Code)
PLCPLC Coder
(Structured Text)
![Page 23: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/23.jpg)
23
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 24: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/24.jpg)
24
Verify the model as well as the generated code
TE
ST
& V
ER
IFIC
AT
ION
REAL-TIME TESTING
Structured
TextVHDL, VerilogC, C++
MCU DSP FPGA ASIC PLC, PAC
DESIGN
Environmental Models
Signal Processing & Control Algorithms
Mechanical Electrical
RESEARCH REQUIREMENTST
ES
T &
VE
RIF
ICA
TIO
N
![Page 25: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/25.jpg)
25
Functional testing (black-box)
Structural testing (white-box)
Design
Model Verification and Validation
Simulate and validate
controller responseReview functional
behavior
Structural coverage
report
Detect unreachable
design logic
![Page 26: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/26.jpg)
26
Session on Verification and Validation
![Page 27: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/27.jpg)
27
What are the challenges?
Designing the control logic based on the
requirements
Verifying the behaviour of a Multi-Domain System
Reduce the cost and the development time involved
in the project
Verifying the control logic for the set of
requirements
Effective team collaboration
![Page 28: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/28.jpg)
28
Consolidate File Views
Combined Project Files and
All Files View
Easily add and remove files
from the project
Full drag and drop support
File actions tied to project
status: creation, deletion and
move.
Consolidated File View
» sldemo_slproject_airframe_git
Files Node
![Page 29: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/29.jpg)
29
Improved dependency viewer
Easily find tools on
the new toolstrip
Expand files to see which
blocks have dependencies
Popup makes the viewer easy
to use even when zoomed out
Improved edge routing makes
it easier to interpret large projects
![Page 30: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/30.jpg)
30
Rolled Up Source Control Status
Easy to locate changes in file
view.
Tooltip summarized what
changes are in the folder.
Fully recursive
Rolled up source control
status is shown for folders.
» Sldemo_slproject_airframe_git
Screen shot of the feature in
action
![Page 31: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/31.jpg)
31
Toyota Uses MathWorks Tools to Increase
Quality, Reduce Costs, and Speed Time to
Market of New Vehicles
ChallengeSpeed up design, increase quality, and reduce R&D
costs by finding an alternative to traditional design methods
SolutionUse MathWorks tools for control design to prototype,
model, test, and refine control strategies in an integrated
design environment
Results Deliver a better product to market faster — and at a
lower cost
Reduce time to embedded code
Forge a pathway to innovation
“MATLAB, Simulink, and
Stateflow… have become the de
facto standard at Toyota for
simulation, data processing, and
controls design. It would be
impossible to list all of the
applications for these tools at
Toyota.”
Akira Ohata
Toyota
Link to user story
![Page 32: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/32.jpg)
32
ChallengeSpeed the development and certification
of a power electronics control system for a
distributed power storage system
SolutionUse Model-Based Design with MATLAB and Simulink
to run simulations of power electronics, the electrical
grid, and controller; generate production
microcontroller code; and achieve certification
Results Six months of development time saved
Thousands of dollars in board spin costs saved
System fully operational days after hardware
becomes available
Stem Accelerates Development of
Power Electronics Control Systems with
Model-Based Design
A commercial installation of Stem’s
PowerStore energy system.
Link to user story
“With Model-Based Design we
saw exactly how our controller
would work with the hardware
even while the hardware was
being developed. After we had the
hardware, refinements were easy
because the simulations matched
what we saw on the scope, and
that gave us tremendous
confidence in the design.”
David Erhart
Stem
![Page 33: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/33.jpg)
33
Q&A with Stem on the Advantages of Model-
Based Design
![Page 34: Designing the Controller for an Electromechanical …...Armature Current + - 12V Up Up Down Down V- V+ H-Bridge DC Motor s1 s2 s3 Control System SimMechanics SimElectronics SimElectronics](https://reader034.vdocuments.mx/reader034/viewer/2022042018/5e760396b3bd7a2f5a5c5ee7/html5/thumbnails/34.jpg)
34
Thank you
Any Questions?