I would like to synchronize a PWM with phase I'm following the example that has the help with the dsPIC30F2010.
the output of this dspic ok but it is not synchronized with the phase RST, how can I create this sync!
unsigned int i;
unsigned int duty_50;
void Timer1Int() org 0x1A {
IFS0 = IFS0 & 0xFFF7;
LATC = ~ PORTC;
}
void main(){
ADPCFG = 0xFFFF;
PORTB = 0xAAAA;
TRISB = 0;
PORTC = 0xAAAA;
TRISC = 0;
Delay_ms(1000);
duty_50 = Pwm_Mc_Init(2000,1,0x3F,0);
returns 50% of the duty
Pwm_Mc_Set_Duty(i = duty_50,1);
Pwm_Mc_Start();
do
{
i--;
Pwm_Mc_Set_Duty(i,1);
Delay_ms(1);
if (i == 0)
i = duty_50 * 2 - 1;
PORTB = i;
Timer1Int();
}
while(1);
}
I would like to synchronize PWM with the phase
Why do you want to do that for?but it is not synchronized with the phase RST, how can I create this sync!
And what do you mean exactly with "synchronise"? What does it mean for the PWM pulse frequency and duty cycle?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
I am designing a rectifier to a 3 phase system, with SCR or IGBT in the entry so I have to have a shot at having to correct a short circuit between the phase, so I have to "Synchronize"
and I have a dead time between the positive and negative also for the shot that disparo.se in output would be problems but how the entrance I can not miss
seugue changes
void main () (
PORTB = 0x0000;
TRISB.F1 = 1;
delay_ms (200);
Pwm_Mc_Init (2000, 0,0 xff, 1);
Pwm_Mc_Set_Duty (0, 1);
Pwm_Mc_Set_Duty (0, 2);
Pwm_Mc_Start ();
of
(
ch_1 = Adc_Read (1);
i = ch_1 * 4;
Pwm_Mc_Set_Duty (i, 1);
Pwm_Mc_Set_Duty (i, 2);
Pwm_Mc_Set_Duty (i, 3);
Pwm_Mc_Set_Duty (i, 4);
Pwm_Mc_Set_Duty (i, 5);
Pwm_Mc_Set_Duty (i, 6);
delay_ms (100);
)
while (1);
)
and I have a dead time between the positive and negative also for the shot that disparo.se in output would be problems but how the entrance I can not miss
seugue changes
void main () (
PORTB = 0x0000;
TRISB.F1 = 1;
delay_ms (200);
Pwm_Mc_Init (2000, 0,0 xff, 1);
Pwm_Mc_Set_Duty (0, 1);
Pwm_Mc_Set_Duty (0, 2);
Pwm_Mc_Start ();
of
(
ch_1 = Adc_Read (1);
i = ch_1 * 4;
Pwm_Mc_Set_Duty (i, 1);
Pwm_Mc_Set_Duty (i, 2);
Pwm_Mc_Set_Duty (i, 3);
Pwm_Mc_Set_Duty (i, 4);
Pwm_Mc_Set_Duty (i, 5);
Pwm_Mc_Set_Duty (i, 6);
delay_ms (100);
)
while (1);
)
Hi, I think your problem can not be solved by using PWM (there is a chance that I am wrong of course).
I think you need 3 pulses, synchronised with the zero crossing of the 3 phases, to ignite your triac's (or SCR's or IGBT's) a while after the zero crossing. By controlling the delay between the pulse and the zero crossing the Triac's will ignite sooner or later after the crossing, letting longer or shorter current through to the load.
This is in principle what a "dimmer" does for a single phase.
Here is an example of a single phase light dimmer, controlled by touching the house of the lamp:
http://users.edpnet.be/rosseel01/DRO/PI ... C_Projects, project "TouchDimmer".
The example software (and hardware) detects the zero crossing and starts a timer. After the timer rolls over, the triac ingition pulse is generated.
You do not need the "touch" section in the code...
I think you need 3 pulses, synchronised with the zero crossing of the 3 phases, to ignite your triac's (or SCR's or IGBT's) a while after the zero crossing. By controlling the delay between the pulse and the zero crossing the Triac's will ignite sooner or later after the crossing, letting longer or shorter current through to the load.
This is in principle what a "dimmer" does for a single phase.
Here is an example of a single phase light dimmer, controlled by touching the house of the lamp:
http://users.edpnet.be/rosseel01/DRO/PI ... C_Projects, project "TouchDimmer".
The example software (and hardware) detects the zero crossing and starts a timer. After the timer rolls over, the triac ingition pulse is generated.
You do not need the "touch" section in the code...
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
But I can not maintain a constant Vcc it this way then I will decrease the life of the component! So I have to have a PWM of 2khz ... and how can I create a Dead Time 2% in the PWM? .. Dead this time prevents the thyristors and come short circuit.
when the test is being made with thyristors but the operation is the same with or SCR Triacs
when the test is being made with thyristors but the operation is the same with or SCR Triacs