Hello, everyone.
My name's Shang-Chuan Lee.
I'm the Application Engineer based in Plano, Texas office.
With me, Arun is a Senior Team Lead from development side,
focus on SoC Blockset.
So in this video, Arun and I would
like to share how to simulate and implement
FOC motor controller on the TI C2000 dual core MCUs.
So we will show you how to control our dynamometer motor
drives and power electronics with a dual core
microcontrollers.
So we will use Motor Control Boxset and SoC Blockset
set to simulate our sensorless field-orientation control
and partition controls across CPUs.
And, finally, we will generate code for real-time testing
on the embedded processor.
So here are some key takeaways from this demo.
With properly petitioning in place, motor and power
electronics control algorithm run on dual CPUs
can achieve higher control bandwidth,
and can be used for safety-critical motor drive
applications.
Second of all, engineers can use SOC Blockset
to build models to achieve dual core motor control algorithms
and perform simulations both on desktop and real time
by deploying the code to embedded processors,
and then quickly assess the performance of motor drive
systems.
And each of the applications require
designers to determine how to schedule task exectuion
and how to manage inter-processor communication
between CPU1 and CPU2.
So here is how our demo show you how
we can control PMSM dual motor setup in real time.
Just at a very high level, this example
use field-orientation control to control
two three-phase permanent magnet synchronous motors
couple in a dyno setup.
So on the left-hand side, motor one
runs in a cross loop speed control mode.
And the right-hand side, motor two
runs in [INAUDIBLE] mode and load motor 1.
So you can use this example to test
a motor under different load conditions.
So, as you can see, two motors that are connect back to back,
and the motors are driven by a dual core PIC 2000
controller [INAUDIBLE].
And here we also have a host model over here
in order to have a serial communication
with the controller board.
So, now, let me quickly start with motors.
So, as you can see, we are starting with the speed command
300 RPM to motor 1.
And then we will incrementally increase the motor speed.
And now on the low side, the motor two is 0 torque load.
So notice that on the back, we also have a power supply
to give 24 DC bus voltage.
And on the oscilloscope here, we can observe the speed feedback
in real time.
And also we can observe the current feedback.
Just like here, this is the load we are showing you.
And here is the current feedback in the sinusoidal wave,
because it's a three-phase current.
So this demo really resemble the way customer test their motor
drive system in a dyno setup.
And here we're just showing you two identical PMSM.
But, of course, we can swap into different types
of motor such as induction motors,
or any other type of motor for testing as a load.
So now the question is, how do we
set up multicore architecture in Simulink
for simulation and code generation?
So the answer is by using SoC Blockset.
So with SoC Blockset, what we provide
is a complete MBD workflow for multicore microcontroller,
from desktop simulation to implementation
on that embedded hardware.
And one of the key features of SoC Blockset
is to simulation hardware component and device driver
behavior in Simulink, which helps uncover implementation
issue before customer deploy the code into the hardware.
And on top of that, we enhance our device profiling
with streaming test execution and CPU utilization
information.
Now Arun will show you a deep-dive dual-core CPUs
for motor control algorithms using SoC Blockset.
Let's look at this multicore example from a SoC Blockset.
SoC Blockset provides complete MBD workflows
for multicore MCUs with a single model from simulation
to implementation on hardware.
Both CP1 and CP2 are modeled in one top model,
which enables interactions between them
and with the plant.
Plant consists of two motors coupled in a dyno setup.
Motor 1 is a device in the test.
And motor 2 is physically coupled with motor 1.
And motor 2 acts as a load to motor 1.
This is a classical test setup in a motor control.
Inputs to the plants are [INAUDIBLE] signals
or average duty cycle based on the inverter models simulation
fidelity.
Plant outputs are the phase currents.
Two phase currents, [INAUDIBLE],, are senses
by [INAUDIBLE] of the MCU.
ETP model contains a task manager block connected
to a model reference block.
Model reference block represents algorithm
to be run on an appropriate core.
Task manager block schedules algorithm both in simulation
and code generation.
Another task manager block is used
to schedule the second core.
SoC BlockSet can simulate concurrent task simulation
for multicores with this task manager blocks.
FOC technique involves two control loops,
an outer slower loop to regulate the speed,
and inner faster loop to regulate the currents.
CP1 runs speed control for motor 1,
and CP2 runs stat control for motor 2.
[INAUDIBLE] algorithms are available in the motor control
blockset.
This example uses motor control blockset features
like centralized motor pushing estimator,
Park and Clarke transforms, space vector PWM generator.
You can set up your simulation models
with the all timing information like task execution
time, delays due to data exchange between codes,
sensor delays like ADC acquisition time
or conversion time.
ADC PWM synchronization are modeled in this example.
PWM triggers ADC status conversion.
And once ADC result is ready, ADC
posts an interrupt to schedule an algorithm.
The model references are connected
through interprocess data channel blocks, or IPC blocks.
The IPC blocks manages the data exchanges
across homogeneous and heterogeneous codes.
Now, let's look at the results.
Row 1 results are from hardware using external mode and row 2
from simulation first few seconds,
motor 1 runs in open loop control
to allow position estimated to work accurately.
At 1.5 second, observe motor speed following
the desired 50% rated RPM.
At 3 second motor 2 is started with the desired reference
[INAUDIBLE],, loading the motor 1 immediately.
Observe motor 1 maintaining the desired speed,
proving the robustness of the speed control.
As discussed, you can observe the diagnostic information
like CPU utilization and task execution.
Speed loop runs every 1 millisecond.
When tasks are running, CPU utilization is showing idle.
ADC runs every 50 microseconds.
Visualize the task duration of ADC interrupt tasks
and the periodic information.
For code generation, go to the system [INAUDIBLE] tab,
click on Configure, Build, and Deploy,
and follow the instructions provided
inside the [INAUDIBLE].
Here is the [INAUDIBLE] demo.
I have the model set up for the external mode.
External mode is in a connect state.
And there's the camera showing the dyno setup.
And we will visualize the logs in the SDI.
Let me start the external mode.
You can see the motor spinning.
But it goes to the closed loop and there is a load acting.
That's the end of the demo.