Design a state-based PLC program to control a motor.
The system specification is as follows:
Press a normally open push button, and the motor will start. The motor will stop after 5 minutes or when a normally closed push button is pressed.
When the motor is running, a red light is ON. When the motor is stopped, a green light is ON.
Use the Fail-Safe concept, i.e., if the wire of the stop push button is disconnected, the motor cannot be started.
Complete the following:
1. Define the inputs, outputs, and states of the system described above.
2. Design this process control using state diagrams. You are required to clearly express each state of the system and describe the conditions for state transitions.
3. Create complete ladder logic for the system.