Abdulkerim
Junior Member level 1
Hello guys
I am trying to control the motor of a washing machine, and the problem I encountered is adjusting the RPM precisely compared to the value of the tachometer.
I am using a PIC16F628 microcontroller
I am using timer1 to save the number of pulses from the tachometer
When I control the time delay of the triac with the buttons, everything works fine.
But when I change the time delay programmatically, the motor jumps according to the change in time delay.
Of course, I tried to calculate and compare the tachometer pulses in 1 millisecond and more as well
But the engine jumps step by step
If you want, I can share a video to make the problem more clear
Please help and thank you everyone
I am trying to control the motor of a washing machine, and the problem I encountered is adjusting the RPM precisely compared to the value of the tachometer.
I am using a PIC16F628 microcontroller
C:
void INTERRUPT ()
{
/// ZERO CROSSING FUNCTION ///
if (EXT_INT_FLAG) {
DELAYING_10US (US_DELAY);
TRIAC = ON_TR;
delay_us (100);
TRIAC = OFF_TR;
INT_EDG =~ INT_EDG; /// toggle edge (INT) sensing "RISING, FALLING"///
/// beacause PIC16F628 has no 2 sensing ///
EXT_INT_FLAG = 0;
} /// if (EXT_INT_FLAG)
if (TMR2_FLAG) {
/// using TIMER2 to generate time base "1mS" ///
TMR2_FLAG = 0;
}
} /// void INTERRUPT ()
C:
/// here take the TMR1 register value then reset it ///
TACHO_RPM = (TMR1H << 8) + TMR1L;
TMR1H = TMR1L = 0;
C:
void main (void)
{
TMR2_1MS ();
TMR1_INIT ();
EXT_INT_INIT ();
CHIP_INIT ();
while (1) {
/// here display TACHO_RPM on 4DIGIT seven segment ///
}
}
When I control the time delay of the triac with the buttons, everything works fine.
But when I change the time delay programmatically, the motor jumps according to the change in time delay.
Of course, I tried to calculate and compare the tachometer pulses in 1 millisecond and more as well
But the engine jumps step by step
If you want, I can share a video to make the problem more clear
Please help and thank you everyone