Sinusoidal Control of PMSM Motors with dsPIC30F / dsPIC33F DSC

Motor Control Pulse Width Modulation (MCPWM) and high-speed A/D Converter. The DSP engine of the dsPIC30F2010 supports the necessary fast mathematical operations. The dsPIC30F2010 family member is a 28-pin 16-bit DSC specifically designed for low-cost/high efficiency motor control applications. The dsPIC30F2010 provides these key features: · 30 MIPS processing performance · Six independent or three complementary pairs of dedicated Motor Control PWM outputs · Six-input, 1 Msps ADC with simultaneous sampling capability from up to four inputs · Multiple serial communications: UART, I2CTM and SPI · Small package (6 mm x 6 mm QFN) for embedded control applications · DSP engine for fast response in control loops
This application note describes a method of driving a sensored Permanent Magnet Synchronous Motor (PMSM) with sinusoidal currents controlled by a dsPIC30F Digital Signal Controller (DSC). The motor control firmware uses the dsPIC30F peripherals while the mathematical computations are performed by the DSP engine. The firmware is written in `C’ language, with some subroutines in assembly to take advantage of the special DSP operations of the dsPIC30F.
· Sinusoidal current generation for controlling PMSM motor phases using Space Vector Modulation (SVM) · Synchronization of sinusoidal voltages to PMSM motor position · Four-quadrant operation allowing forward, reverse and braking operation · Closed-loop speed regulation using digital Proportional Integral Derivative (PID) control · Phase advance operation for increased speed range · Fractional math operations performed by the DSP engine of the dsPIC® DSC
You will need the following hardware to implement the described motor control application: · PICDEMTM MCLV Development Board (Figure 1) · Hurst DMB0224C10002 BLDC Motor · 24 VDC Power Supply You can purchase these items from Microchip as a complete kit or as individual components. Check the Development Tools section of the Microchip web site for ordering information.
The dsPIC30F Motor Control family is specifically designed to control the most popular types of motors, including AC Induction Motors (ACIM), Brushed DC Motors (BDC), Brushless DC Motors (BLDC) and Permanent Magnet Synchronous Motors (PMSM), to list a few. Several application notes have been published for ACIM operation (AN984, AN908 and GS004) and Brushless DC Motor Control operation (AN901, AN957 and AN992) based on the dsPIC30F motor control family. These application notes are available on the the Microchip web site ( This application note demonstrates how the dsPIC30F2010 is used to control a sensored PMSM motor with sinusoidal voltages. The design takes advantage of dsPIC30F peripherals specifically suited
© 2005 Microchip Technology Inc.
It is strongly recommended that you read the “PICDEMTM MCLV Development Board User’s Guide” (DS51554) to fully understand the hardware topology being used in this application note. This User’s Guide can be downloaded from the Microchip web site. Figure 2 is a simplified system block diagram for a Sinusoidal PMSM motor control application. This diagram will help you develop your own hardware. On the low side, the voltage limit is 10V. On the high side, the voltage limit is 48V. It is important to note that the heat sink on the IGBTs have very limited heat dissipation, so high power requirements may not be easily met with the PICDEMTM MCLV development board. To use the PICDEMTM MCLV development board for this application, use the jumper settings shown in Table 1 and the motor connections shown in Table 2 and Table 3.
Position for Sinusoidal Control (dsPIC® DSC Sensored) Open Open Open Short
Phase A 3-Phase Phase B Inverter Phase C 3-Phase PMSM Motor
Jumpers J7, J8, J11 J12, J13, J14
J15, J16, J17, J10 J19
AN2 Reference Speed S2 Start/Stop RB3/CN5 RB4/IC7 RB5/IC8 Hall A R21 Hall B R22 Hall C R25
Position for Sinusoidal Control (dsPIC® DSC Sensored) Phase A (White) Phase B (Black) Phase C (Red) Ground (Green) if available
Connector J9 M3 M2 M1 G
Salient aspects of this topology are: · Potentiometer R14 selects the desired speed (Reference Speed) · Rotor position is detected using Hall effect sensors connected to pins RB3, RB4 and RB5 · Current feedback is provided through a simple operational amplifier circuit · Fault input is received through a comparator circuit connected with the current feedback circuit. The current is sensed using a 0.1 ohm resistor (R26) You can easily adjust the values of the resistors to accommodate the current capabilities of the motor being used for your application. The motor drive circuit, on the other hand, is designed to drive a 24V PMSM motor. You can change the hardware to meet the drive requirement of a specific motor. Note: Refer to the “PICDEMTM MCLV Development Board User’s Guide” (DS51554) for details on how to change the hardware for use with motors greater or less than 24V.
Position for Sinusoidal Control (dsPIC® DSC Sensored) Red Black White Brown Green
Connector J9 +5V GND HA HB HC *
The colors referenced in Tables 2 and 3 for the motor windings and hall sensors, respectively, pertain to the Hurst 24V motor available from Microchip. The ground wire is sometimes not available on some motors.
After your code is developed and you have downloaded it to the dsPIC30F, you will need to press switch S2 to start and stop the motor. The potentiomer marked REF (R14) sets the required speed and direction of rotation of the motor. The motor does not need to stop to change direction of rotation.
© 2005 Microchip Technology Inc.