MOC3041 is zero crossing detector device, use MOC3021.
For starters..... you don't trigger a Triac with PWM. You trigger it with phase control.
Phase control is a trigger delay from zero the zero crossing.
Additionally, not all single-phase motors are suitable for speed control. They are limited mostly to shaded pole ones.
Hi,
as schmittt trigger already mentioned: don´t use PWM. It won´t work.
Read basics about phase control.
In short: You need to detect zero cross of line voltage --> Then use a variable delay (the shorter the delay, the higher the speed) --> then trigger the Triac with the use of MOC3021.
Klaus
If we SWITCHED the TRIAC using delay function means controller have to do that work only,because it will comes under infinite while loop.
To avoid this one I need PWM control..
Is their any other way to control the speed of the motor by using the PWM control..?
They were using PWM.
The noise was from the motor
void interrupt ssr() {
if (INTCONbits.INT0IF == 1) { //INTF flag raised, so external interrupt occured
zc = 1;
INTCONbits.INT0IF = 0;
}
}
void System_init(void) {
TRISA = 0b00000011;
PORTA = 0b00000011;
ADCON1 = 0XFF;
CMCON = 0X07;
TRISB = 0b11111111;
PORTB = 0b11111111;
TRISC = 0b00000000;
PORTC = 000000000;
TRISD = 0b00000000;
PORTD = 0b00000000;
TRISE = 0X00;
PORTE = 0X00;
INTCONbits.GIE = 1; //Enable Global Interrupt
INTCONbits.INT0E = 1;
INTCON2bits.INTEDG0 = 1;
INTCONbits.INT0IF = 0;
}
void main(void) {
System_init();
while (1) {
if (zc == 1) { //zero crossing occurred
triac_1 = 1;
DelayMs(1);
triac_1 = 0;
zc = 0;
}
}
}
"The delay" in the present code doesn't change the trigger time. Triac trigger pulse must be delayed relative to zero crossing. And you need a zero crossing detector that works equally for positive and negative zero crossings.By changing the delay is it possible to control the speed of induction motor..?
while (1)
{
if (zc == 1)
{ //zero crossing occurred
DelayMs(your delay goes here)
triac_1 = 1;
triac_1 = 0;
zc = 0;
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?