Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

my stb controller crad

sahu

Member
here the function detels of my stabilizer controller card .
Only one L.T. is required. its wiring as per my diagram.
******************************************************
* ITS stb wiring diaGRaM for 90 Volt to 290 Volt *
******************************************************

************************************************************************************************
1- When we connect 95V input from variac the output should be 200V on output relay-4 on com point(POLE) .Now increase input and check output.When output reaches between 240 - 245V ,we move preset wiper till
relay-3 goes ON and
relay-1 ,relay-2 are off

output will reach near about to 205V.now input near about 115volt.
THIS STEP WE CAN SAY STEP_0 .
************************************************************************************************

2- now input near about 115volt.Agen increase input and check output.When output reaches between 240 - 245V.now input near about 137volt.
relay-1 goes ON and now
relay-3 goes off .
relay-2 are off

output will reach near about to 205V.now input near about 167volt.
THIS STEP WE CAN SAY STEP_1 .
************************************************************************************************

3- now input near about 167volt. Agen increase input and check output.When output reaches between 240 - 245V.now input near about 200volt.
relay-1 all redy on in STEP_1 .
relay-3 goes on .
relay-2 are off

output will reach near about to 205V.now input near about 200volt.
THIS STEP WE CAN SAY STEP_2 .
************************************************************************************************

4- now input near about 200volt. Agen increase input and check output.When output reaches between 240 - 245V.now input near about 240volt.
relay-1 all redy on in STEP_1 & STEP_2.
relay-2 goes on and now
relay-3 goes off .&

output will reach near about to 205V.now input near about 240volt.
THIS STEP WE CAN SAY STEP_3 .
*************************************************************************************************

5- now input near about 240volt. Agen increase input and check output.When output reaches between 240 - 245V.
relay-1 all redy on in STEP_1 , STEP_2 & STEP_3 And also
relay-2 all redy on in STEP_3 .. & now
relay-3 goes on .&

output will reach near about to 205V.now input near about 240volt.
THIS STEP WE CAN SAY STEP_4 .
************************************************************************************************


/////////////////////////////////////////////////////////////////////////////////////////


relay-4 for hi\low volt cut & time dealy

its CCS C code as ...
Code:
/********************************************************************************************
        // Main Stabilizing is done here
********************************************************************************************/
void rl_function_controller(void)
   
  {div_t step_mode;
int1 a=0;
step_mode=div(a,3);
    { ch = CalculateMV(1);  
 switch (step_mode.rem)
          { 
           case 0:
      if ((ch >= 10) && (ch <= 130)) //>95 volt
          {G=1;
          power_level_1();
            break;
           }
          if ((ch >= 137) && (ch <= 167))  //>115 v
          {B=1;
          power_level_2();//RL3=ON
           a=a+1;     //step_mode = step_mode+1;  // goto step 2
            break;
          }
          /* if (ch >= 170) 
           {// state=1;
a=a+1;     //step_mode = step_mode+1;  // goto step 2
                                 break;
           }*/

     case 1:
     
     if (ch < 115) //now  case 2 < 115v 
          {B=1;G=1;
          a=a-1;  // step_mode = step_mode - 1;  // Callback to step 1
        // state=0;;
                break;
          }
         // if (ch < 132)  // //now  case 2 < 137v 
        if ((ch >= 119) && (ch <= 140)) //RL1=ON &  //RL3=OFF
          {C=1;
          power_level_3();
                break;
           }
         // if (ch >= 157)    // //now  case 2 > 137v to 170 v
        if ((ch >= 144) && (ch <= 177)) //RL1=ON &  RL3=ON
          {D=1;
          power_level_4();
              a=a+1;
               break;
          }
        /*if (ch > 180) 
         {  //state=2;    //
   a=a+1;// step_mode = step_mode+1;  // goto step 3
                        break;
         }*/
     case 2:
     
     if (ch < 119) //now  case 2 
          {
        //state=1;// 
 a=a-1;     // step_mode = step_mode - 1;  // Callback to step 1
                break;
          }
        if ((ch >= 122) && (ch <= 141)) //RL1=ON &  RL2=ON &RL3=OFF
          {E=1;
          power_level_5();
              break;
           }
       if ((ch >= 143) && (ch <= 175)) //RL1=ON &  RL2=ON &RL3=OFF
          {F=1;
          power_level_6();
            break;
          }
          }}}

 /***************************************************************************
  Function power_level on selected step
 ****************************************************************************/
void power_level_1(void)  
//{ if (G=1)
{
B=0;
C=0;
D=0;
E=0;
F=0;
            output_low(RL1);
            output_low(RL2);
            output_low(RL3);
            delay_ms(60);
break;
            } //}
void power_level_2(void)  
//{  if (B=1)
{
G=0;
C=0;
D=0;
E=0;
F=0;
           output_high(RL3);
            output_low(RL2);
            output_low(RL1);
             delay_ms(60);
break;
} //}
void power_level_3(void)  
//{  if (C=1)
{
G=0;
B=0;
D=0;
E=0;
F=0;
              output_low(RL3);
              output_high(RL1);
              output_low(RL2);
               delay_ms(60);
break;
} //}
void power_level_4(void)  
//{  if (D=1)
{
G=0;
B=0;
C=0;
E=0;
F=0;
            output_high(RL3);
            output_low(RL2);
            output_high(RL1);
               delay_ms(60);
break;
} //}
void power_level_5(void)  
//{  if (E=1)
{
G=0;
B=0;
C=0;
D=0;
F=0;
              output_low(RL3);
              output_high(RL1);
              output_high(RL2);
                 delay_ms(60);
break;
} //}
void power_level_6(void)  
//{  if (F=1)
{
G=0;
B=0;
C=0;
D=0;
E=0;
            output_high(RL3);
            output_high(RL2);
            output_high(RL1);
               delay_ms(60);
break;
}// }
but it is not work as i want .pl guide me where i wrong ??
 
Hi Sahu.... I'm not entirely happy with your switch statement... The 'break;' statements are in 'if' loops... So if none of the if statemets are true... the next 'case' will be executed.

Code:
switch (x)
   {
   case 1:
      if(a)
         {
          arguments;
         }
       if(b)
         {
          arguments;
         }
       if(c)
         {
          arguments;
         }
      break; ----------> break goes here.
   case 1:
        .................rest...
  }

In your powerlevel functions.. There is no need for the break statements
 
Hi Sahu.... I'm not entirely happy with your switch statement... The 'break;' statements are in 'if' loops... So if none of the if statemets are true... the next 'case' will be executed.

Code:
switch (x)
   {
   case 1:
      if(a)
         {
          arguments;
         }
       if(b)
         {
          arguments;
         }
       if(c)
         {
          arguments;
         }
      break; ----------> break goes here.
   case 1:
        .................rest...
  }

In your powerlevel functions.. There is no need for the break statements
thank u Mr .Ian Rogers
now i remove break statements in my powerlevel functions..
so now code are as ....
Code:
 switch (step_mode.rem)
          { 
           case 0:
      if ((ch >= 10) && (ch <= 130)) 
          {G=1;
          power_level_1();
            //break;
           }
          if ((ch >= 137) && (ch <= 167))  
          {B=1;
          power_level_2();//RL3=ON
           a=a+1;     //step_mode = step_mode+1;  // goto step 2
           // break;
          }
                       break;
     case 1:
     if (ch < 115) 
          {B=1;G=1;
          a=a-1;  // step_mode = step_mode - 1;  // Callback to step 1 (last step)
              //  break;
          }
        if ((ch >= 119) && (ch <= 140)) //RL1=ON &  //RL3=OFF  now  case 2
          {C=1;
          power_level_3();
               // break;
           }
        if ((ch >= 144) && (ch <= 177)) //RL1=ON &  RL3=ON
          {D=1;
          power_level_4();
              a=a+1;  // move to next step
              // break;
          }
                 break;
case 0 work very well . but problem is here
if ((ch >= 137) && (ch <= 167))
{B=1;
power_level_2();//RL3=ON
a=a+1; //step_mode = step_mode+1; // goto step 2
// break;
}
break;
case 1:
if (ch < 115)
{B=1;G=1;
a=a-1; // step_mode = step_mode - 1; // Callback to step 1 (last step)
// break;
}
if ((ch >= 119) && (ch <= 140)) //RL1=ON & //RL3=OFF now case 2 not work
{C=1;
power_level_3();
// break;
}
 
May I see the div_t structure?

Also... I have tried and tried, but I cant work out the logic... How do you change the step_mode? The input voltage is monitored! but how the outputs are worked out.

For instance... Relay 1, when activated, applies the input voltage onto the 290v rail ??? OR relay 2 redirects the input voltage to the 200v or 137v rail

I take it that the 22v output should be stable with the voltage at any of the four inputs 6/9/11 & 13 : 1 ratio? What is the point of the output?
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top