Yacer
Newbie
Hello everyone,
I want to carry out a project in which i can control a DC motor (220 v) using pic 16f876a
This project is based on the following steps below:
First off, i started by applying the method of detecting zero crossing with my pic, employing a bridge rectifier, a zener diode as voltage regulator,optocoupler for the hardware portion of zero cross detection.
The bridge rectifier rectifies this AC voltage to DC (knowing that the frequency is 50hz),
but since there is no bulk smoothing capacitor, the output is not pure DC.
The pic16F877a detects the zero crossing using the RB0/INT external interrupt function
My pic16F876a is coded to enable the external interrupt.
An interrupt is generated upon the falling edge of RB0.
This what will make my pic16f876a generates the PWM signal
Now i want to make this PWM signal variable using a variable delay (i don't
want to use a timer, just a simple instructions to avoid abstraction, by implementing vdelay in my code)
in order to control and vary continuously my DC motor speed (either to increase or decrease its speed)
This requires the calculation of my rectified sinusoidal signal average value
along the full period of the DC signal (here i want to calculate each time the
average value in a small part of the full period) by implementing integral operation.
I will use two pushbuttons connected to my pic16f876a for incrementing or decrementing the motor speed.
So would you please help me find the right code using mikroc pro for pic ?
Sincerely,
I want to carry out a project in which i can control a DC motor (220 v) using pic 16f876a
This project is based on the following steps below:
First off, i started by applying the method of detecting zero crossing with my pic, employing a bridge rectifier, a zener diode as voltage regulator,optocoupler for the hardware portion of zero cross detection.
The bridge rectifier rectifies this AC voltage to DC (knowing that the frequency is 50hz),
but since there is no bulk smoothing capacitor, the output is not pure DC.
The pic16F877a detects the zero crossing using the RB0/INT external interrupt function
My pic16F876a is coded to enable the external interrupt.
An interrupt is generated upon the falling edge of RB0.
This what will make my pic16f876a generates the PWM signal
Now i want to make this PWM signal variable using a variable delay (i don't
want to use a timer, just a simple instructions to avoid abstraction, by implementing vdelay in my code)
in order to control and vary continuously my DC motor speed (either to increase or decrease its speed)
This requires the calculation of my rectified sinusoidal signal average value
along the full period of the DC signal (here i want to calculate each time the
average value in a small part of the full period) by implementing integral operation.
I will use two pushbuttons connected to my pic16f876a for incrementing or decrementing the motor speed.
So would you please help me find the right code using mikroc pro for pic ?
Sincerely,