This document describes the setup requirements for running the Sensored Single Phase BLDC Motor Driver, which is referenced in the "Sensored Single Phase BLDC Motor Driver using dsPIC33CK” application note.
- Sensored_SPBLDC_MCHV3_LVMC.X
- MPLAB® X IDE v5.45
- MPLAB® XC16 Compiler v1.70
- MPLAB® X IDE Plugin: X2C-Scope v1.3.3
Development Board | Power Supply |
---|---|
DSPICDEM™ MCHV3 Development Board (DM3300233) | 10A 250V Power Adapter |
dsPIC33CK Low Voltage Motor Control (LVMC) Development Board (DM330031) | 12V Power Supply |
This section describes hardware setup required for the demonstration.
NOTE: Before making any connection on the MCHV3 Board, verify that the system is not powered and it is fully discharged. The system is completed discharged when the red D13 LED is off.
-
Connect the wires for Hall sensor and phase windings of the motor to the appropriate terminals of the development board, as mentioned in the table below.
Motor Wire | MCHV3 Board | LVMC Board |
---|---|---|
Motor Pin A | M1 (J17) | Phase A (J14) |
Motor Pin B | M2 (J17) | Phase B (J14) |
Hall Supply | 5V (J9) | 3.3V (J7) |
Hall Ground | GROUND (J9) | GND (J7) |
Hall Signal | HALL A(J9) | HALL C (J7) |
MCHV3 Board | LVMC Board | |
---|---|---|
Motor Phases | ||
Hall Connectors |
-
On the MCHV3 Development Board, connect a 250V power adapter to the J1 Terminal. On the LVMC Development Board, plug in the 12V power supply to connector J1. The table below is provided to summarize the supply and terminal as well.
MCHV3 Board | LVMC Board | |
---|---|---|
Supply | 250V | 12V |
Terminal | J1 | J1 |
-
The onboard programmer ‘PICkit™ On Board (PKoB4)’ , is used for programming or debugging the dsPIC33CK256MP508. To use an on-board programmer, connect a micro-USB cable between Host PC and the terminal provided on the LVMC Board as indicated on the PKoB4 row in the table below. To enable communication using X2CScope between the board and the host PC, refer to USB row in the table below.
MCHV3 | LVMC | |
---|---|---|
PKoB4 | J19 (PROGRAM/DEBUG on the front panel) | J13 |
USB | J6 (USB on the front panel) | J6 |
This firmware is implemented to work on Microchip’s 16-bit Digital signal controller (dsPIC® DSC) dsPIC33CK256MP508. For more information, see the dsPIC33CK256MP508 Family datasheet (DS70005349).
The Motor Control Demo application uses push button to start or stop the motor and potentiometer to vary speed of the motor. This Motor Control Demo Application configures and uses peripherals like PWM, ADC, SCCP, UART etc.
For more details refer Microchip Application note 'Sensored Single Phase BLDC Motor driver' available at Microchip web site.
Follow below instructions step by step to setup and run the motor control demo application:
-
Start MPLAB X IDE and open (File>Open Project) the project Sensored_SPBLDC_MCHV3_LVMC.X
-
Set the project Sensored_SPBLDC_MCHV3_LVMC.X as main project by right clicking on the project name and selecting 'Set as Main Project' as shown. The project 'Sensored_SPBLDC_MCHV3_LVMC' will then appear in bold.
-
On the configuration panel drop down menu, select if the development board used for demonstration is MCHV3 or LVMC.
-
Open userparams.h (under Sensored_SPBLDC_MCHV3_LVMC.X -> headerfiles) in the project Sensored_SPBLDC_MCHV3_LVMC.X
- Ensure either CLOSEDLOOP or OPENLOOP are defined in the LOOP CONTROLLER section.
- Select the default rotation of the motor based on the motor specification sheet by commenting either CW or CCW.
- Uncomment the defined OVERTEMPERATURE_DETECTION, OVERCURRENT_DETECTION and/or STALL_DETECTION in the MOTOR FAULT DETECTION section to enable the motor fault detections.
- Right click on the project Sensored_SPBLDC_MCHV3_LVMC.X and select “Properties” to open its Project Properties Dialog. Click the selected category “Conf: [MCHV3]" or "Conf: [LVMC]” to display the general project configuration information. In the category window:
- Select the specific Compiler Toolchain from the available list of compilers. Please ensure MPLAB® XC16 Compiler supports the device dsPIC33CK256MP508. In this case, “XC16(v1.70)” is selected.
- Select the Hardware Tool to be used for programming and debugging.
- After selecting Hardware Tool and Compiler Toolchain, click button Apply
-
Ensure that the checkbox 'Load symbols when programming or building for production (slows process)' is checked, which is under the 'Loading' category of the Project Properties window.
-
To build the project (in this case Sensored_SPBLDC_MCHV3_LVMC.X) and program the device dsPIC33CK256MP508, click 'Make and Program Device Main project' on the toolbar.
-
When the device is programmed successfully, run or stop the motor by pressing the push button. The appropriate LEDs should turn on and the motor should start spinning smoothly in one direction in the range indicated by the potentiometer. Ensure that the motor is spinning smoothly without any vibration.
MCHV3 Terminal | LVMC Terminal | |
---|---|---|
Push Button | PUSH BUTTON - ON/OFF | SW1 - ON/OFF SW2 - REVERSE direction |
-
The motor speed can be varied using the potentiometer of the respective development board as indicated below.
-
Press the appropriate push button to stop the motor.
For additional information, refer following documents or links.
-
Sensored Single Phase BLDC Motor Driver using dsPIC33CK Application Note
-
MPLAB® X IDE User’s Guide (DS50002027) or MPLAB® X IDE help