Konstantin Metodiev
- Jul 17, 2015
- 3
- Joined
- Jul 17, 2015
- Messages
- 3
Hello! I am newbie in electronics which is why probably, I am going to ask a simple question. I am trying to design an H-bridge to drive a three phase brushless DC motor within Proteus environment. The circuit is shown in the attached image. The microcontroller is PIC18F2550 and the driver is IR2101.
Both the ucontroller and the driver do whatever they are expected. The MCU switches two pins of PORTB in a row according to the attached source code. The IR2101 in turn amplifies the signal within 0...12V DC. The MOSFETs' gates are switched ON and OFF accordingly so that each time two phases are connected obeying the current commutation step:
1) Phase U -> Phase W
2) Phase U -> Phase V
3) Phase W -> Phase V
4) Phase W -> Phase U
5) Phase V- > Phase U
6) Phase V -> Phase W
The Hall sensor isn't considered here.
Needless to say, the simulation stops after few sconds. Each phase suffers from severe ripples which are visible in the oscilloscope windows. Please note, the ripples appear if the current phase is not connected by the MOSFETs. For instance, whenever Phase U and Phase W are connected (step 1) the Phase V voltage oscillates significantly.
I can't deal with that issue. Could anybody help me?
Thank you in advance!
void InitMain(void) {
CMCON = 0x07; // Disables comparators
ADCON1 = 0x0F; // All digital
TRISB.F0 = 0; // Sets up an output
TRISB.F1 = 0; // Sets up an output
TRISB.F2 = 0; // Sets up an output
TRISB.F3 = 0; // Sets up an output
TRISB.F4 = 0; // Sets up an output
TRISB.F5 = 0; // Sets up an output
return;
}
const unsigned char delay = 100;
void main() {
InitMain();
PORTB = 0b00000000;
while(1) {
/* UH UL VH VL WH WL */
PORTB.F0 = 1; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 1; Delay_ms(delay);
PORTB.F0 = 1; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 1; PORTB.F4 = 0; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 1; PORTB.F4 = 1; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 1; PORTB.F2 = 0; PORTB.F3 = 0; PORTB.F4 = 1; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 1; PORTB.F2 = 1; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 0; PORTB.F2 = 1; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 1; Delay_ms(delay);
}//while
return;
}

Both the ucontroller and the driver do whatever they are expected. The MCU switches two pins of PORTB in a row according to the attached source code. The IR2101 in turn amplifies the signal within 0...12V DC. The MOSFETs' gates are switched ON and OFF accordingly so that each time two phases are connected obeying the current commutation step:
1) Phase U -> Phase W
2) Phase U -> Phase V
3) Phase W -> Phase V
4) Phase W -> Phase U
5) Phase V- > Phase U
6) Phase V -> Phase W
The Hall sensor isn't considered here.
Needless to say, the simulation stops after few sconds. Each phase suffers from severe ripples which are visible in the oscilloscope windows. Please note, the ripples appear if the current phase is not connected by the MOSFETs. For instance, whenever Phase U and Phase W are connected (step 1) the Phase V voltage oscillates significantly.
I can't deal with that issue. Could anybody help me?
Thank you in advance!
void InitMain(void) {
CMCON = 0x07; // Disables comparators
ADCON1 = 0x0F; // All digital
TRISB.F0 = 0; // Sets up an output
TRISB.F1 = 0; // Sets up an output
TRISB.F2 = 0; // Sets up an output
TRISB.F3 = 0; // Sets up an output
TRISB.F4 = 0; // Sets up an output
TRISB.F5 = 0; // Sets up an output
return;
}
const unsigned char delay = 100;
void main() {
InitMain();
PORTB = 0b00000000;
while(1) {
/* UH UL VH VL WH WL */
PORTB.F0 = 1; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 1; Delay_ms(delay);
PORTB.F0 = 1; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 1; PORTB.F4 = 0; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 0; PORTB.F2 = 0; PORTB.F3 = 1; PORTB.F4 = 1; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 1; PORTB.F2 = 0; PORTB.F3 = 0; PORTB.F4 = 1; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 1; PORTB.F2 = 1; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 0; Delay_ms(delay);
PORTB.F0 = 0; PORTB.F1 = 0; PORTB.F2 = 1; PORTB.F3 = 0; PORTB.F4 = 0; PORTB.F5 = 1; Delay_ms(delay);
}//while
return;
}
