Motor Control and Drive
Motor Control and Drive
- Design Partners
- Control Products
- Driver Products
- Motor Types
- Motor Control Library
- Motor Control Simulation
- motorBench Development Suite
- Reference Designs
Microchip Motor Control Library Blockset, Revision 0.30b
The Microchip Motor Control Library Blockset contains a number of basic Simulink® blocks that can be used to jumpstart model-based design of motor control applications using Microchip dsPIC® Digital Signal Controllers in the dsPIC33F and dsPIC33E families.
These blocks include reference frame transforms, a proportional-integral controller, and trigonometric functions, all of which can be used with Embedded Coder® to generate efficient code on the dsPIC DSC that utilizes the Microchip Motor Control Library.
For simulation, you will need
- MATLAB® R2013a or later, 32-bit or 64-bit Windows
- Fixed-Point Designer™
For code generation, you will also need
- Simulink Coder™
- MATLAB Coder™
- Embedded Coder
This blockset includes only algorithmic blocks. Support for dsPIC® DSC peripherals is provided separately, with the MPLAB® 16-Bit Device Blocks for Simulink package
Compilation and programming of the code generated with this blockset requires an MPLAB® XC compiler and the MPLAB X IDE. At this time the Motor Control Library Blockset is compatible only with the XC16 v1.11 compiler.
- Download the Microchip Motor Control Library Blockset archive file.
- Unzip the archive file into a directory of your choice.
- Add this directory into the MATLAB search path.
Once you have done this, the Motor Control Library Blockset will appear in the Simulink Library Browser the next time you start MATLAB.
Documentation on each of the blocks is provided in the following section. These blocks may be placed in a Simulink model like any other Simulink block.
For best results in code generation, turn on Inline Parameters.
The Proportional-Integral controller block requires mchp_MC_PISTATE_T in the MATLAB base workspace to contain a particular structure definition. This can be automatically set up by creating the required structure in the Simulink model's InitFcn.
- In a Simulink model using the Motor Control Library Blockset, select File > Model Properties > Model Properties > Callbacks > InitFcn.
- Add the following statement to the model initialization function shown in the InitFcn dialog box:
- Save the Simulink model.
This only needs to be done once per new model file.
|Clarke:ab-to-alphabeta||Clarke transform (ab → αβ)
2 → 2 transform from per-phase measurements (ab) to stationary orthogonal (αβ) reference frame
|ClarkeInv:alphabeta-to-abc:input-swap||Inverse Clarke transform (αβ → abc)
2 → 3 transform from stationary orthogonal (αβ) reference frame to per-phase values (abc)
Legacy form with swapped inputs
|Park:alphabeta-to-dq||Park transform (αβ → dq)
2 → 2 transform from stationary orthogonal (αβ) reference frame to rotating (dq) reference frame
|ParkInv:dq-to-alphabeta||Inverse Park transform (dq → αβ)|
2 → 2 transform from rotating (dq) reference frame to stationary orthogonal (αβ) reference frame
|PI-controller:antiwindup||Proportional-integral controller with antiwindup|
|Sincos:table-interp||Sine and cosine calculation (table-based with interpolation)|
|Arctan2:CORDIC||Arctangent (xy → θ)|
Compute angle of input coordinates (x,y) using the CORDIC algorithm.
|SVM-generator:gain-and-phase-shift||Space vector modulation|
Legacy form, with gain and phase shift