Jump to content

Search the Community

Showing results for tags 'BLDC'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 4 results

  1. Hi there, my current project is to build a controller for a sensorless BLDC motor using a MSP430G2553. I want to realize trapezoidal control with Back-EMF/zero-crossing detection. I plan to detect zero-crossing with the Comparator(CA2/3/4 vs. CA1) and generate PWM using Timer1. Timer0 will be used for things like 30 BLMC_.zip
  2. //########################################################################### #include "DSP2833x_Device.h" // external function prototypes extern void InitSysCtrl(void); extern void InitCpuTimers(void); // Prototype statements for functions found within this file. void Gpio_select(void); void Setup_HS1(void); void Setup_HS2(void); void Setup_HS3(void); void Setup_HS4(void); void Setup_HS5(void); void Setup_HS6(void); // Global Variables int Hall_1_result, Hall_2_result, Hall_3_result, Hall_State, x=0 , P_State=0; #define Hall_1 GpioDataRegs.GPADAT.bit.GPIO24 #define Hall_2 GpioDataRegs.GPADAT.bit.GPIO25 #define Hall_3 GpioDataRegs.GPADAT.bit.GPIO26 //########################################################################### // main code //########################################################################### void main(void) { InitSysCtrl(); // Basic Core Init from DSP2833x_SysCtrl.c Gpio_select(); while(1) { if(Hall_1 ==1) //eCAP1_Hall1 Hall_1_result = 1; else Hall_1_result = 0; if (Hall_2 == 1) //eCAP2_Hall2 Hall_2_result = 1; else Hall_2_result = 0; if (Hall_3 == 1) //eCAP3_Hall3 Hall_3_result = 1; else Hall_3_result = 0; Hall_State = (4*Hall_3_result) + (2*Hall_2_result) + (1*Hall_1_result); if (Hall_State >=1 && Hall_State <=6) { P_State = Hall_State; switch (Hall_State) { case 1 : { x = 1; Setup_HS1(); break; } case 2 : { x = 2; Setup_HS2(); break; } case 3 : { x = 3; Setup_HS3(); break; } case 4 : { x = 4; Setup_HS4(); break; } case 5 : { x = 5; Setup_HS5(); break; } case 6 : { x = 6; Setup_HS6(); break; } } } if (Hall_State == 0 || Hall_State == 7) { EPwm1Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM1A(S1) EPwm1Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM1B(S4) EPwm2Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM2A(S3) EPwm2Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM2B(S6) EPwm3Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM3A(S5) EPwm3Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM3B(S2) } } // end of infinite loop } // end of main void Gpio_select(void) { EALLOW; GpioCtrlRegs.GPAMUX1.all = 0; // GPIO15 ... GPIO0 = General Puropse I/O GpioCtrlRegs.GPAMUX2.all = 0; // GPIO31 ... GPIO16 = General Purpose I/O GpioCtrlRegs.GPBMUX1.all = 0; // GPIO47 ... GPIO32 = General Purpose I/O GpioCtrlRegs.GPBMUX2.all = 0; // GPIO63 ... GPIO48 = General Purpose I/O GpioCtrlRegs.GPCMUX1.all = 0; // GPIO79 ... GPIO64 = General Purpose I/O GpioCtrlRegs.GPCMUX2.all = 0; // GPIO87 ... GPIO80 = General Purpose I/O GpioCtrlRegs.GPAMUX1.bit.GPIO0= 1; //ePWM1A active GpioCtrlRegs.GPAMUX1.bit.GPIO1= 1; //ePWM1B active GpioCtrlRegs.GPAMUX1.bit.GPIO2= 1; //ePWM2A active GpioCtrlRegs.GPAMUX1.bit.GPIO3= 1; //ePWM2B active GpioCtrlRegs.GPAMUX1.bit.GPIO4= 1; //ePWM3A active GpioCtrlRegs.GPAMUX1.bit.GPIO5= 1; //ePWM3B active GpioCtrlRegs.GPADIR.all = 0; GpioCtrlRegs.GPAMUX2.bit.GPIO24 = 0; GpioCtrlRegs.GPADIR.bit.GPIO24 = 0; // gpio pin as input GpioCtrlRegs.GPAMUX2.bit.GPIO25 = 0; GpioCtrlRegs.GPADIR.bit.GPIO25 = 0; //gpio pins as input GpioCtrlRegs.GPAMUX2.bit.GPIO26 = 0; GpioCtrlRegs.GPADIR.bit.GPIO26 = 0; //gpio pins as input GpioCtrlRegs.GPBDIR.all = 0; GpioCtrlRegs.GPCDIR.all = 0; GpioCtrlRegs.GPAPUD.all = 0; GpioCtrlRegs.GPAPUD.bit.GPIO24 = 0; GpioCtrlRegs.GPAPUD.bit.GPIO25 = 0; GpioCtrlRegs.GPAPUD.bit.GPIO26 = 0; EDIS; } void Setup_HS1(void) { EPwm1Regs.TZCTL.all = 0; //ePWM on S1 (ePWM1A) EPwm1Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm1Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm1Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm1Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm1Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm1Regs.CMPA.half.CMPA = EPwm1Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm3Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM3B(S2) EPwm3Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM3A(S5) EPwm2Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM2B(S6) EPwm2Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM2A(S3) EPwm1Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM1B(S4) } void Setup_HS2(void) { EPwm3Regs.TZCTL.all = 0; //ePWM on S5 (ePWM3A) EPwm3Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm3Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm3Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm3Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm3Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm3Regs.CMPA.half.CMPA = EPwm3Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm2Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM2B(S6) EPwm1Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM1A(S1) EPwm3Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM3B(S2) EPwm2Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM2A(S3) EPwm1Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM1B(S4) } void Setup_HS3(void) { EPwm1Regs.TZCTL.all = 0; //ePWM on S1 (ePWM1A) EPwm1Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm1Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm1Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm1Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm1Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm1Regs.CMPA.half.CMPA = EPwm1Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm2Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM2B(S6) EPwm3Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM3A(S5) EPwm3Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM3B(S2) EPwm2Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM2A(S3) EPwm1Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM1B(S4) } void Setup_HS4(void) { EPwm2Regs.TZCTL.all = 0; //ePWM on S3 (ePWM2A) EPwm2Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm2Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm2Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm2Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm2Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm2Regs.CMPA.half.CMPA = EPwm2Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm1Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM1B(S4) EPwm1Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM1A(S1) EPwm2Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM2B(S2) EPwm3Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM3A(S5) EPwm3Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM3B(S2) } void Setup_HS5(void) { EPwm2Regs.TZCTL.all = 0; //ePWM on S3 (ePWM2A) EPwm2Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm2Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm2Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm2Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm2Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm2Regs.CMPA.half.CMPA = EPwm2Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm3Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM3B(S2) EPwm1Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM1A(S1) EPwm1Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM1B(S4) EPwm3Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM3A(S5) EPwm2Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM2B(S6) } void Setup_HS6(void) { EPwm3Regs.TZCTL.all = 0; //ePWM on S5 (ePWM3A) EPwm3Regs.TBCTL.bit.CLKDIV = 0; // CLKDIV = 1 EPwm3Regs.TBCTL.bit.HSPCLKDIV = 1; // HSPCLKDIV = 2 EPwm3Regs.TBCTL.bit.CTRMODE = 2; // up - down mode EPwm3Regs.AQCTLA.all = 0x0060; // SET=CMPA CLEAR=CAD EPwm3Regs.TBPRD = 7500; // 5KHz - PWM signal EPwm3Regs.CMPA.half.CMPA = EPwm3Regs.TBPRD/2; //value of CMPA (Duty Ratio) EPwm1Regs.AQCSFRC.bit.CSFB = 2; //force continuous high on output of ePWM1B(S4) EPwm1Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM1A(S1) EPwm2Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM2B(S2) EPwm2Regs.AQCSFRC.bit.CSFA = 1; //force continuous low on output of ePWM2A(S3) EPwm3Regs.AQCSFRC.bit.CSFB = 1; //force continuous low on output of ePWM3B(S2) } //=========================================================================== // End of SourceCode. //=========================================================================== Hi, I want to run a BLDC motor with the help of my DSP (TMS320F28335). While it is able to detect change in Hall State ( I confirmed it by rotating rotor with hand), as soon as Hall State is changing, corresponding gate driver signals are not developed. However if I stop debugging in the IDE (CCS) and debug it again then corresponding correct pulses are produced. I am not getting how to develop gate driver signals continuously according to change in hall state. I am using following code- code.txt
  3. I've just started a project "Sensorless BLDC Motor Controller: Modular System" on Kickstarter. It is open source hardware/firmware project. https://www.kickstarter.com/projects/946939931/sensorless-bldc-motor-controller-modular-system Event driven finite state machines (FSM) approach was used for this sensorless BLDC motor controller firmware. The programming language is C and there is no operating system. It was implemented by myself from scratch based on the well known motor control, other algorithms and the firmware is a totally open source product. What the implemented firmware can do? Uses a 31.25 kHz symmetric PWM scheme to better detect BEMF zero crossing 12-bit ADC configured as a window comparator makes more error prone zero crossing detection, especially on a start Initial Position Detection (IPD) algorithm was implemented based on Variable Inductance Sensing Method A rotor revolving direction can be changed any time on a fly, that can be used for "reverse braking" Safety stop when a motor stalled Motor speed control (start, stop, up, down, duty cycle %) and obtaining a real time telemetric data (speed, voltage current) using serial UART interface configured for 460800 bps Motor speed control using standard 1...2 ms PPM of remote control (RC) devices I hope it can help an engineering community. Thanks.
  4. Hello, I wrote a very simple PWM Code for my Brushless DC Motor (incl. ESC) and it works very good (I don't use any Potentiometers.): int motorPin = PF_1; void setup() { pinMode(motorPin, OUTPUT); } void loop() { analogWrite(motorPin, HIGH); delayMicroseconds(1000); analogWrite(motorPin, LOW); delayMicroseconds(19000); } I need 50Hz (1/50=20us). The Motor breaks when the first delay is "1000us" and the second is "19000us". The Motor arrives highspeed when the first delay is "2000us" and the second is "18000us" So my dutycycle should be between 5 - 10% What i need is this PWM Signal without any delays. Is there any way to create a PWM without delays? Thank you very much. greetings, Yaman
×
×
  • Create New...