3 phase STAR-TRIANGLE ( Y/Δ ) motor. Help to compile 2 buttons and 3 releys

//INPUTS int buttonInput1 = 3; //button N/O START int buttonInput2 = 4; //button N/C STOP //OUTPUTS int lightOutput1 = 5; //RELAY CENTRAL int lightOutput2 = 6; //RELAY STAR int lightOutput3 = 7; //RELAY TRIANGLE //INPUTS CONDITION int buttonstate1 = 0; //button N/O START CONDITION int buttonstate2 = 1; //button N/C STOP CONDITION

void setup(){ //INPUTS pinMode(3,INPUT); //Button N/O START pinMode(4,INPUT); //Button N/C STOP //OUTPUTS pinMode(5,OUTPUT); //RELAY CENTRAL pinMode(6,OUTPUT); //RELAY STAR pinMode(7,OUTPUT); //RELAY TRIANGLE

}

void loop(){

buttonstate1 = digitalRead(1); //read condition of N/O button and connect it with PIN 3

if (buttonstate1 == HIGH){ digitalWrite(5,HIGH); //RELAY CENTRAL digitalWrite(6,HIGH); //RELAY STAR digitalWrite(7,LOW); //RELAY TRIANGLE } buttonstate2 = digitalRead(0); //read condition of N/C button and connect it with PIN 4

if (buttonstate2 == LOW){ digitalWrite(5,LOW); //RELAY CENTRAL digitalWrite(6,LOW); //RELAY STAR digitalWrite(7,LOW); //RELAY TRIANGLE }

}

HOW TO COMPILE BUTTONS with OUTPUTS(releys)???? please help me to finish that

pinMode(1,INPUT);       //Button N/O START

Why is the switch connected to the serial port pin? How can you debug your code that way? Debug by guesswork takes way longer than debug by fact.

i didn't pay attention that the "pin 1" was serial...thank you.I will change it. can you help me to compile relays with buttons?

can you help me to compile relays with buttons?

No. I can't see what error messages you are seeing.

by the time i will keep by my self...if I will have questions i'll ask you))

Firstly, please put your code into code tags.
Secondly, a y/d start is not a good way to start a three phase motor for a number of reasons:

  • You will get two current spikes almost as high as the single one in direct start
  • The motor will have a starting torque of 1/3 of the direct start torque meaning that that starting time is prolonged resulting in increased heat up.

Y/D start IS appropriate when starting devices with large inertia such as rotational converters and tooling machinery where there is large inertia but no load on start.

The best way to do a Y/D start is designing a state machine as the one in the attached state diagram. This can then easily be coded using my state machine library

#include <SM.h>

SM ydStart(off);
enum {onBtn = 2, offBtn, cRelay, wRelay, dRelay};//declare I/O pins

void setup(){
  for(int pin = cRelay; pin<=dRelay; pin++) pinMode(pin, OUTPUT);//relay pins as outputs
}//setup()

void loop(){
  EXEC(ydStart);
}//loop()

State off(){
  if(digitalRead(onBtn)){
    ydStart.Set(wye);
    digitalWrite(cRelay, 1);//central realy on
    digitalWrite(wRelay, 1);//wye relay on
  }//if(onBtn)
}//off()

State wye(){
  checkOff();
  if(ydStart.Timeout(1000)){
    digitalWrite(wRelay, 0);
    ydStart.Set(ccp);
  }//if(timeout)
}//wye()

State ccp(){
  checkOff();
  if(ydStart.Timeout(20)){//20ms for cross conduct prevention
    digitalWrite(dRelay, 1);
    ydStart.Set(delta);
  }//()
}//ccp()

State delta(){
  checkOff();
}//delta()

void checkOff(){
  if(digitalRead(offBtn)){//check off btn
    for(int pin = cRelay; pin<=dRelay; pin++) digitalWrite(pin, 0);//all relays off
    ydStart.Set(off);
  }//if(offBtn)
}//()

yd start state diagram.png

Thank you Nilton. You help me a lot!!!)))) :D