We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X

Need Help?

Privacy Policy

Live Chat

Motor Control Library for dsPIC33 DSCs

The Motor Control Library is a collection of functions that you can use as building blocks for implementing Field Oriented Control (FOC) of 3-phase motor control applications on dsPIC® Digital Signal Controllers (DSCs). The library functions are designed to be used within any application framework to create high-performance, memory-efficient and flexible motor control designs. The block diagram to the right shows a typical usage scenario. The Motor Control Library is architected to enable a user application to call time-critical control loop functions in it and take advantage of the motor control peripherals available on the dsPIC33 DSCs to implement a design. The Motor Control Library is extensively used as a library in our source code for application note and it is integrated into our Motor Control Application Framework (MCAF) and motorBench® Development Suite.

The Motor Control Library hosts functions in two implementation variants:

  1. C - functions are declared with static and inline keywords.
  2. Assembly - functions are defined in a C-callable archive file with function interfaces defined in the motor_control.h file.

Library users may choose to use one or both or a mixture of these two implementation variants. Unused implementation variants of the library will not consume data or program memory on the target device.

Print

Elements of the Library


Interface Header File: motor_control.h

The interfaces to the Motor Control library are defined in the " motor_control.h " header file. Any C language source (.c) file that uses the Motor Control library should include the " motor_control.h ".

Library Files: libmotor_control_dspic33e-elf.a & libmotor_control_dspic33f-elf.a

The Motor Control library archive (.a) files installed with the library release. The prototypes for library functions hosted by the archive files are described in the motor_control.h file. Both of these archive files released with the library are built using the ELF-type of Object Module Format (OMF).

Inline C Definitions Header File: motor_control_inline_dspic.h

This header file hosts the C language definitions of the library functions. The " motor_control_inline_dspic.h " is automatically included when a C language source (.c) file includes the " motor_control.h " file.

Mapping Header File: motor_control_mapping.h

This header file defines a short function name for each of the library functions and maps it, by default, to the prototype of one of the implementation variants. The " motor_control_mapping.h " is automatically included when a C language source (.c) file includes the " motor_control.h " file.

Installation


To start using the Motor Control Library, go to the Software area below and download the zip file and extract the library files into your application source files folder. For more details on the Usage Model, refer to the Help document that is included in the Motor Control Library.

Motor Control Library Function List


Name Description
MC_CalculateSineCosine_Assembly_Ram This function calculates the Sine and Cosine values for a specified angle input.
MC_CalculateSineCosine_InlineC_Ram This function calculates the Sine and Cosine values for a specified angle input.
MC_CalculateSpaceVectorPhaseShifted_Assembly This function calculates the duty cycle values based on the three scaled reference vectors in the a-b-c reference frame and the PWM period value.
MC_CalculateSpaceVectorPhaseShifted_InlineC This function calculates the duty cycle values based on the three scaled reference vectors in the a-b-c reference frame and the PWM period value.
MC_ControllerPIUpdate_Assembly This function calculates the PI correction.
MC_ControllerPIUpdate_InlineC This function calculates the PI correction.
MC_TransformClarke_Assembly This function calculates the Clarke transformation.
MC_TransformClarke_InlineC This function calculates the Clarke transformation.
MC_TransformClarkeInverseSwappedInput_Assembly This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
MC_TransformClarkeInverseSwappedInput_InlineC This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
MC_TransformPark_Assembly This function calculates the Park transformation.
MC_TransformPark_InlineC This function calculates the Park transformation.
MC_TransformParkInverse_Assembly This function calculates the inverse Park transformation.
MC_TransformParkInverse_InlineC This function calculates the inverse Park transformation.

Are You Looking for Motor Control Software for 32-bit Microcontrollers?


dsPIC33 Motor Control Products


Documentation

Title
AN1206 - Sensorless Field Oriented Control (FOC) of an AC Induction Motor (ACIM) Using Field Weakening Download
AN1292 - Dual-Shunt FOC with PLL Download
AN2584 - Integrated Power Factor Correction (PFC) and Sensorless Download
AN1162 - Sensorless Field Oriented Control (FOC) of an AC Induction Motor (ACIM) Download
AN887 - AC Induction Motor Fundamentals Download
AN955 - VF Control of 3-Phase Induction Motor Download
AN2757 - Sensored (Encoder-Based) Field Oriented Control of a Three Phase Permanent Magnet Synchronous Motor (PMSM) Download
AN2520 - Sensorless Field Oriented Control (FOC) for a Permanent Magnet Synchronous Motor (PMSM) Using a PLL Estimator and Equation-based Flux Weakening (FW) Application Note Download
AN2590 - Sensorless FOC for PMSM Using Reduced Order Luenberger Observer - Sensorless FOC for PMSM Using Reduced Order Luenberger Observer Application Note Download
AN857 - Brushless DC Motor Control Made Easy Download
Title
Motor Control and Drive Brochure Download
Title
CE002 Configuring 10-Bit dsPIC DSC A/D Converters for 1 Msps Conversion Rate Download
CE019 - Proportional Integral Derivative (PID) controllers & closed-loop control Download
CE155 - Real-Time Data Monitoring (RTDM) Example Download
PFC Sensorless FOC PLL Estimator MCHV Download
Sensorless FOC PLL Estimator MCLV Download
Title
dsPIC33 Motor Control Library for FOC Download
Title
dsPICDEM MCLV-2 (DM330021-2) Development Board User's Guide Download
dsPICDEM MCSM Development Board Users Guide Download

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vehicula velit sit amet turpis rutrum vehicula. Donec eu varius velit, nec ultricies arcu. Fusce vitae pulvinar lorem. Etiam sodales et ipsum volutpat suscipit. Aliquam non mauris ut lectus volutpat feugiat id eget massa. Aliquam vel eleifend metus. Nam ultricies, risus sed tempor suscipit, dolor ligula sodales erat, et porta magna sem fermentum felis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec commodo magna at scelerisque sollicitudin. Morbi elit tortor, blandit vel imperdiet in, ullamcorper eu tortor. Etiam dapibus eleifend elementum. Vestibulum finibus efficitur mauris, vitae convallis ex molestie non. Etiam luctus at mauris accumsan finibus.