Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

BLDC CONTROL

son0102

Newbie
Newbie level 3
Joined
Dec 30, 2024
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
27
I have a sensorless bldc motor. Motor: 310VDC-380VDC, 1.2A, 150W, 1100 rpm, 10 pole, 12 slot.
I'm trying to control the speed. I used the circuit and code on the internet.
this's diagram:
1735534011645.png

this's code:
/* Sensorless brushless DC motor control with Arduino UNO and IR2101 (Arduino DIY ESC).
* BLDC motor speed is controlled with a potentiometer connected to A0.
* This is a free software with NO WARRANTY.
* http://simple-circuit.com/
*/

#define PWM_MAX_DUTY 255
#define PWM_MIN_DUTY 10
#define PWM_START_DUTY 40

byte bldc_step = 0, motor_speed, pin_state;

void setup()
{
DDRD |= 0xE0; // configure pins 5, 6 and 7 as outputs
PORTD = 0x00;
DDRB |= 0x0E; // configure pins 9, 10 and 11 as outputs
PORTB = 0x31;
// Timer1 module setting: set clock source to clkI/O / 1
TCCR1A = 0;
TCCR1B = 0x02;
// Timer2 module setting: set clock source to clkI/O / 1
TCCR2A = 0;
TCCR2B = 0x02;
// ADC module configuration
ADMUX = 0x60; // configure ADC module and select channel 0
ADCSRA = 0x84; // enable ADC module with 16 division factor (ADC clock = 1MHz)

PCICR = EIMSK = 0; // disable all external interrupts

pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
}

// pin change interrupt 2 (PCINT2) ISR
ISR (PCINT2_vect)
{
if( (PIND & PCMSK2) != pin_state )
return;
// BEMF debounce
for(byte i = 0; i < 20; i++)
{
if(bldc_step & 1){
if(PIND & PCMSK2) i -= 1;
}
else {
if(!(PIND & PCMSK2)) i -= 1;
}
}

bldc_move();
bldc_step++;
bldc_step %= 6;
}

// BLDC motor commutation function
void bldc_move()
{
switch(bldc_step)
{
case 0:
AH_BL();
BEMF_C_FALLING();
break;
case 1:
AH_CL();
BEMF_B_RISING();
break;
case 2:
BH_CL();
BEMF_A_FALLING();
break;
case 3:
BH_AL();
BEMF_C_RISING();
break;
case 4:
CH_AL();
BEMF_B_FALLING();
break;
case 5:
CH_BL();
BEMF_A_RISING();
}
}

void loop()
{
SET_PWM_DUTY(PWM_START_DUTY); // setup starting PWM with duty cycle = PWM_START_DUTY
int i = 5000;

// motor start
while(i > 100)
{
delayMicroseconds(i);
bldc_move();
bldc_step++;
bldc_step %= 6;
i = i - 20;
}

motor_speed = PWM_START_DUTY;

PCICR = 4; // enable pin change interrupt for pins PCINT23..16 (Arduino 0 to 7)

while(1)
{
ADCSRA |= 1 << ADSC; // start conversion
while(ADCSRA & 0x40); // wait for conversion complete
motor_speed = ADCH; // read ADC data (8 bits only)
if(motor_speed < PWM_MIN_DUTY)
motor_speed = PWM_MIN_DUTY;
SET_PWM_DUTY(motor_speed);
}
}

void BEMF_A_RISING()
{
PCMSK2 = 0x04; // enable Arduino pin 2 (PCINT18) interrupt, others are disabled
pin_state = 0x04;
}
void BEMF_A_FALLING()
{
PCMSK2 = 0x04; // enable Arduino pin 2 (PCINT18) interrupt, others are disabled
pin_state = 0;
}
void BEMF_B_RISING()
{
PCMSK2 = 0x08; // enable Arduino pin 3 (PCINT19) interrupt, others are disabled
pin_state = 0x08;
}
void BEMF_B_FALLING()
{
PCMSK2 = 0x08; // enable Arduino pin 3 (PCINT19) interrupt, others are disabled
pin_state = 0;
}
void BEMF_C_RISING()
{
PCMSK2 = 0x10; // enable Arduino pin 4 (PCINT20) interrupt, others are disabled
pin_state = 0x10;
}
void BEMF_C_FALLING()
{
PCMSK2 = 0x10; // enable Arduino pin 4 (PCINT20) interrupt, others are disabled
pin_state = 0;
}

void AH_BL()
{
PORTD &= ~0xA0;
PORTD |= 0x40;
TCCR1A = 0; // turn pin 11 (OC2A) PWM ON (pin 9 & pin 10 OFF)
TCCR2A = 0x81; //
}
void AH_CL()
{
PORTD &= ~0xC0;
PORTD |= 0x20;
TCCR1A = 0; // turn pin 11 (OC2A) PWM ON (pin 9 & pin 10 OFF)
TCCR2A = 0x81; //
}
void BH_CL()
{
PORTD &= ~0xC0;
PORTD |= 0x20;
TCCR2A = 0; // turn pin 10 (OC1B) PWM ON (pin 9 & pin 11 OFF)
TCCR1A = 0x21; //
}
void BH_AL()
{
PORTD &= ~0x60;
PORTD |= 0x80;
TCCR2A = 0; // turn pin 10 (OC1B) PWM ON (pin 9 & pin 11 OFF)
TCCR1A = 0x21; //
}
void CH_AL()
{
PORTD &= ~0x60;
PORTD |= 0x80;
TCCR2A = 0; // turn pin 9 (OC1A) PWM ON (pin 10 & pin 11 OFF)
TCCR1A = 0x81; //
}
void CH_BL()
{
PORTD &= ~0xA0;
PORTD |= 0x40;
TCCR2A = 0; // turn pin 9 (OC1A) PWM ON (pin 10 & pin 11 OFF)
TCCR1A = 0x81; //
}

void SET_PWM_DUTY(byte duty)
{
OCR1A = duty; // set pin 9 PWM duty cycle
OCR1B = duty; // set pin 10 PWM duty cycle
OCR2A = duty; // set pin 11 PWM duty cycle
}
But just started, the mosfet is broken. I don't have an oscilloscope to check.
I tried 12VDC motor, it's no problem.
What is the problem?
 
The original circuit at simple-circuit.com drives a 12 V BLDC. Not clear if necessary modifications for high voltage have been applied. Would be helpful to see a photo of the HV power stage.
Possible issues
- too large gate resistors
- missing DC link bypass capacitors
- crosstalk of output stage noise causes false switching
- no overcurrent sense (may be necessary depending on BLDC winding resistance)
 
In addition to what FvM wrote:
* slow diodes for bootstrap
* slow electrolytics capacitors for bypass and bootstrap

Seeing these issues in the schematic ... I also expect similar issues with PCB layout.

Everything regarding half bridge circuits and BLDC driving ... has been discussed hundred times before.

MOSFET manufacturers as well as MOSFET_driver manufacturer provide hundreds of application notes how to do it correctly. All say about the same ... thus it's not necessary to look for a specific one.

Use these documents. Don't rely on random internet source.

Klaus
 
- điện trở cổng quá lớn
I will reduce the resistor to 10 ohm. Is that ok?
- thiếu tụ điện DC link bypass
Add bypass capacitors between power supply and ground. any other positions?
- nhiễu xuyên âm của tầng đầu gây ra hiện tượng chuyển mạch sai
Crosstalk causes short circuit which damages mosfet? how to remove them?
* diode chậm cho bootstrap
i'm using Diode Schottky. trr = 500ns
* tụ điện phân chậm cho bypass và bootstrap
bootstrap capacitor is tantalum 1uF
Mọi thứ liên quan đến mạch cầu nửa và điều khiển BLDC ... đã được thảo luận hàng trăm lần trước đây.
Can you give me the keyword?
 
Vậy tại sao bạn lại cho chúng tôi xem 1N4007?
I originally used those components, then I changed them but i haven't modified the schematic yet
Why do you show us a 1N4007 then?
I originally used those components. Then I changed them but i haven't modified the schematic yet
did you try: "half bridge circuits and BLDC"
i tried but there is not much specific data about them. I am looking for a simpler and more concise driver, TPD4164K by TOSHIBA
 
originally used those components. Then I changed them but i haven't modified the schematic yet
For your own benefit I recommend not to post schematics that does not match your real circuit.
Indeed for me who wants to help it often is a waste of time.. causing misunderstandings.. and thus is annoying somehow.
tried but there is not much specific data about them. I am looking for a simpler and more concise driver, TPD4164K by TOSHIBA
I did not ask to look for a different circuit / different components. I rather recommend to use the ones you have correctly.
The manufacturer provides all informations you need.

Even in this forum Ir21xx problems are the most often discussed problems.
It seems all posters make the same mistakes.. thus the answers are the same, too.

I guess I repeated the solutions more than 50 times .. but many posters don't spend time for a search .. they all expect "personal treatment".
To me it feels as the posters expect the "helpers" to spend the time they don't want to spend. They act as if their time is more worth than ours.

Don't get me wrong .. but having repeated it 50 times is enough.

Klaus
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top