plc programming motor on/off

Join Date
Nov 2018
Location
ahmedabad
Posts
1
hi guys
i have a problem, i have five motors and my coustmer want me to start
the motor at random sequence and stop the motor in the same sequence i started the motor
anyone have some idea what to do?
 
I would do a FIFO load when you start the motors
Motor 1 load 1
Motor 2 load 2
then for the stop use the FIFO unload
the motor at the unload would be the motor to stop
just use 1 stop button and 5 start buttons
there may be other way but I think this would be the simplest to set up and use
 
I am guessing that you are trying to even the wear on the motors. There are two schools of thought here; one that you even the wear and so put off how long before a motor fails, the other that if you do that then all motors will fail at around the same time, so you will get big problems later. The third way, which must be a college of thought because it is smarter than a school, is to monitor the state of the drives and have planned maintenance.
 
is to monitor the state of the drives and have planned maintenance.

Like thats going to happen :)

Another thought.... run motor 1 to failure then switch to motor 2 and service motor 1

I did work at a plant that had backups for just about every pump in their oil system, they would have pump/motor 1 as the primary and once it failed switch to number 2 and rebuild 1... once the rebuild was done (day or two) switch back to 1, they would also run number 2 once a month for a day, they did have a good maintenance system
 
Like thats going to happen :)

Another thought.... run motor 1 to failure then switch to motor 2 and service motor 1

I did work at a plant that had backups for just about every pump in their oil system, they would have pump/motor 1 as the primary and once it failed switch to number 2 and rebuild 1... once the rebuild was done (day or two) switch back to 1, they would also run number 2 once a month for a day, they did have a good maintenance system

In my experience, motors from the same manufacturer, used the same way, tend to fail around the same number of run-time hours. For the motors that we have hot stand-by for (not very many) we used to switch which motor we ran every 2 weeks on our down days.

That was an issue when a replacement motor took 6 weeks to deliver. Motor #1 failed, the order was placed, and motor #2 failed 3 weeks later, so we had to come up with a plan B for the 3 weeks extra that the first replacement motor took to arrive.

We now switch about 2/3 and 1/3. Motor #1, at 2/3 of the run-time, is expected to fail early. Motor #2, the hot standby, will likely last much longer than it takes to get the replacement or rebuild.
 
Example implementation using Siemens S7 classic


Code:
FUNCTION_BLOCK FB1
VAR_INPUT
 bStartMotors:BOOL;
 bStopMotors:BOOL;
END_VAR
VAR
bStart:BOOL;
bStop:BOOL;
bStartedge:BOOL;
bStopEdge:BOOL;
sfb1SecTimer:sfb4;
MotorQ:ARRAY[1..5] OF INT:=1,2,3,4,5;    
StartSequence:ARRAY[1..5] OF int;
iStartStep:INT:=0;
StopSequence:ARRAY[1..5] OF int;
iStopStep:INT:=0;
i:INT;
tRandom:TIME;
abRandom AT trandom:ARRAY[1..4] OF BYTE;
iSwap1:INT;
iswap2:INT;
iSwap:INT;
END_VAR

    CONST 
        TIME_BETWEEN_STARTS:=2; //secs
        TIME_BETWEEN_STOPS:=2; //secs

    END_CONST;

IF  bStartMotors AND NOT bStartEdge THEN 
    bStart:=True;
    istartstep:=1;
    //randomise motor start order
    iSwap1:=1+ (WORD_TO_INT((byte_TO_WORD(abRandom[3]) AND w#16#ff)) MOD 5);
    iSwap2:=1+ (WORD_TO_INT((byte_TO_WORD(abRandom[4]) and w#16#ff)) MOD 5);
    iSwap:=MotorQ[iSwap1];
    Motorq[iSwap1]:=motorq[iSwap2];
    Motorq[iSwap2]:=iSwap;
END_IF;
bStartEdge:=bStartMotors;
sfb1sectimer.PT:=t#1s;
sfb1sectimer.In:=NOT sfb1sectimer.Q;
sfb1SecTimer();
tRandom:=sfb1sectimer.ATIME;
IF sfb1sectimer.q AND bStart THEN 
 FOR i:=1 TO 5 DO
  IF iStartStep=i THEN 
   StartSequence[i]:=StartSequence[i]+1;
   IF Startsequence[i]=TIME_BETWEEN_STARTS THEN 
    Startsequence[i]:=0;
    iStartStep:=iStartStep+1;
    Exit;
   END_IF;  
  END_IF;    
 END_FOR;
END_IF;
IF iStartStep=6 THEN 
 bStart:=False;
 iStartstep:=0;
END_IF;
FOR i:=1 TO 5 DO
      IF MotorQ[i]=iStartStep THEN 
        CASE i OF
          1:Q0.0:=True;
          2:Q0.1:=True;
          3:Q0.2:=True;
          4:Q0.3:=True;
          5:Q0.4:=True;              
        END_CASE;
       END_IF;
END_FOR;  

IF bStopMotors AND NOT bStopEdge THEN 
    bStop:=True;
    istopstep:=1;
END_IF;
bStopEdge:=bStopMotors;
IF sfb1sectimer.q AND bStop THEN 
 FOR i:=1 TO 5 DO
  IF iStopStep=i THEN 
   StopSequence[i]:=StopSequence[i]+1;
   IF Stopsequence[i]= TIME_BETWEEN_STOPS THEN 
    Stopsequence[i]:=0;
    iStopStep:=iStopStep+1;
    Exit;
   END_IF;  
  END_IF;    
 END_FOR;
END_IF;
IF iStopStep=6 THEN 
 bStop:=False;
 iStopstep:=0;
END_IF;
FOR i:=1 TO 5 DO
      IF MotorQ[i]=iStopStep THEN 
        CASE i OF
          1:Q0.0:=False;
          2:Q0.1:=False;
          3:Q0.2:=False;
          4:Q0.3:=False;
          5:Q0.4:=False;              
        END_CASE;
       END_IF;
END_FOR;      
    ;
END_FUNCTION_BLOCK
 

Similar Topics

Hello colleagues, Some time ago I started my adventure with programming. With your help and the courses, things are starting to come together...
Replies
13
Views
581
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
77
Hi Please I have zeilo smart relay #SR2A201BD but I don't have it's programming cable. Can I use any general usb/rs232 converter? Or need...
Replies
2
Views
78
Hi, Does anyone have thoughts or know of, can point in the right direction any published materials with a plumbing centric point of you explaining...
Replies
1
Views
125
@ All: what is your best guess on a potential range in increase in efficiency in % (i.e. saved programming hours, greater output, etc.) when...
Replies
5
Views
291
Back
Top Bottom