Coder Social home page Coder Social logo

microchip-pic-avr-examples / sensored_spbldc_mchv3_lvmc Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 10.44 MB

This drive is created to control the Single Phase Brushless DC (BLDC) Motor Driver using Microchip's dsPIC33CK DSC in a sensored fashion (Hall Effect sensor).

License: Other

Makefile 0.75% C 99.25%
bldc dspic hall-effect-sensor motor-control motor-driver sensored-control dsc dsp

sensored_spbldc_mchv3_lvmc's Introduction

image

SENSORED SINGLE PHASE BRUSHLESS DC MOTOR DRIVER USING dsPIC33CK

INTRODUCTION

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.

Motor Control Application Firmware Required for the Demonstration

  • Sensored_SPBLDC_MCHV3_LVMC.X

Software Tools Used for Testing the firmware

  • MPLAB® X IDE v5.45
  • MPLAB® XC16 Compiler v1.70
  • MPLAB® X IDE Plugin: X2C-Scope v1.3.3

Hardware Tools Required for the Demonstration

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

HARDWARE SETUP

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.

  1. 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

  1. 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

  1. 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


BASIC DEMONSTRATION

Firmware Description

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.

Basic Demonstration

Follow below instructions step by step to setup and run the motor control demo application:

  1. Start MPLAB X IDE and open (File>Open Project) the project Sensored_SPBLDC_MCHV3_LVMC.X

  2. 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.

  3. On the configuration panel drop down menu, select if the development board used for demonstration is MCHV3 or LVMC.

  4. 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.

  1. 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

  1. 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.

  2. 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.

  3. 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

  1. The motor speed can be varied using the potentiometer of the respective development board as indicated below.

  2. Press the appropriate push button to stop the motor.

REFERENCES:

For additional information, refer following documents or links.

  1. Sensored Single Phase BLDC Motor Driver using dsPIC33CK Application Note

  2. dsPICDEM™ MCHV3 Development Board User’s Guide

  3. dsPIC33CK Low-Voltage Motor Control board User's Guide

  4. dsPIC33CK256MP508 Family Datasheet (DS70005349)

  5. MPLAB® X IDE User’s Guide (DS50002027) or MPLAB® X IDE help

  6. MPLAB® X IDE installation

  7. MPLAB® XC16 Compiler installation

sensored_spbldc_mchv3_lvmc's People

Contributors

harishagari avatar

Watchers

 avatar

Forkers

yasukuni

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.