1. Control requirements
The operation of traffic lights at crossroads is shown in the figure below. When the start switch is turned on, the signal light system starts to work, and the North-South red light is on first, and the east-west green light is on. When the start switch is off, all the signal lights go out. When working, the green light is on for 25s and flashes three times (3S), the yellow light is on for 2S and the red light is on for 30s.
The working sequence diagram of three color lamps in each direction is shown in the figure below.
Figure traffic light control sequence diagram
2. Analyze the input and output signals of PLC
According to the control requirements, the I / O address allocation of PLC is shown in the table below, and the I / O wiring diagram of PLC is shown in the figure below.
3. Analyze the time relationship between the output signals by the sequence diagram
A cycle of traffic lights takes 60 seconds, which is divided into six time periods corresponding to six dividing points: T1, T2, T3, T4, T5 and T6. The state of the signal lamp will change at the six demarcation points. In the programming, the six time periods must be controlled by six timers.
In order to clarify the function of each timer, so as to understand the accurate time of state transition of each lamp, the functions of each timer are listed, as shown in the table below.
4. Ladder program design
According to the control requirements of traffic lights, the ladder diagram is shown in the figure below.
The program is divided into three parts. The first part is the square wave circuit used to generate the green light flashing signal; The second part is the timing circuit, which needs six timers to timing the state changes of north-south direction and east-west direction signal lights respectively; The third part is the indicating circuit, which is used to control the change of the two direction signals.