Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CONTROL WASHING MACHINE MOTOR

Status
Not open for further replies.

Abdulkerim

Junior Member level 1
Junior Member level 1
Joined
Jan 31, 2022
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
GB
Activity points
99
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
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 ()
I am using timer1 to save the number of pulses from the tachometer
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
 

Hi,

Generally it's no good idea to use busy waits (delay_us) in an ISR.

The shown cide is not complete.
Thus it's imposiible to find out what happens.
* In your error description you talk about the tacho signal. We see that it controls the TACHO_RPM variable. But we don't see how this variable is used.
* we don't see where the variable US_DELAY comes from and what range it has.

Also we don't see how often the tacho signal comes, nor what mains frequency you have.
Posting your schematic surely is good idea.

Generally I recommend to go through application notes on "triac motor control" with microcontrollers.
I guess Microchip provides good documents. But generally documents from other semiconductor manufacturers are useful, too.

Klaus
 
thank you MR

KlausST

The tachometer pulses one pulse per rotation
and thıs ıs my delay functıon
i tried 1uS and 10uS and 100uS
C:
void DELAYING_10US (unsigned ddd)
{
while (ddd != 0) {
                      ddd--; delay_us (10);   /// 1uS, 10uS, 100uS
                     }
and the TACHO_RPM
i tried it inside 1mS, 10mS base time and inside endless loop in void main (void)
C:
if (TACHO_RPM < RPM && US_DELAY > 100) US_DELAY--;
else if (TACHO_RPM > RPM && US_DELAY < 900) US_DELAY++;

but the motor still jumping
--- Updated ---

image (3).png
 
Last edited:

You should have a look o the PID control theory; to solve your problem, perhaps only the 'P' suffice. In short, you will add incremental changes on the output power taking into account the current speed, instead of the binary control as you're doing above.
 
You should have a look o the PID control theory; to solve your problem, perhaps only the 'P' suffice. In short, you will add incremental changes on the output power taking into account the current speed, instead of the binary control as you're doing above.
Thank you sir

andre_luis

Could you point me to a specific reference?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top