Instruction
You need to provide a detailed description of your code, LINE by LINE, and associate it to the conditions below. First write the code as a whole. Then break it down into pieces and describe how your code follows specific process procedure provided. For unforeseen conditions, make an assumption, describe it fully and provide the code that goes with it.
1) There is a conveyer belt that carries empty bottles through a guided lane to a filling machine. The conveyer belt will have a motor" M 1" that can receive start or stop commands. This motor moves the bottles towards a filling tap and receives control commands.
2) The bottles move forward in steps, but the motor will speed up smoothly to full speed to avoid shaking and choppy operation. For that reason, there will be a soft start utilized for the motor to apply SO% voltage, 75%and 100% in steps of o.s seconds each.
3) The motor starts as soon as a proximity sensor (PXl) detects that the filling station is empty. This generates a "o" command and the motor has to start to send a new bottle in. Once the PXl sensor registers" 1" the motor has to stop.
4) As soon as the motor is stopped, a valve "VLVl" is energized to fill the bottle. A level sensor "LVl" controls the filling valve. As soon as the LVl registers" 1" the valve is closed, the bottle is capped by "CP" actuator and the bottle has to move forward to the next conveyer belt.
5) If the filling of bottle under the tank takes more than 7 seconds, the "CP" does not operate and a blinking red light "Ll" is turned on flashing with intervals of 1 second and the process stops. It has to be RESET and STARTED manually.
6) Before the filling station, the bottles are checked by sensor "PX2" to make sure they ae standing up right. PX2 will register 1 if the bottle is standing up. If the bottle is not standing up right, an actuator "Al" is energized to kick the bottle out of the lane.
7) After the bottles are filled and capped they will have to travel for 1 minute on another conveyer belt a boxing station. The second conveyer belt is running constantly by motor M2. However, if this conveyer belt is stopped for any reason, the bottling process must stop.
8) There is a proximity sensor "PX3" that is used as a counter. For every 6 bottles filled and passed through the second convey er belt, a packaging motor is activated "M3" which does not require any speed controls.
9) The packaging will have the capacity for 50 packages. The sensor "PX4" is used to sense the storage is full. So, when 50 boxes are packaged and the storage is full PX4 registers 1 and a siren" S 1" and pilot light "L2" will turn on to show the problem. This will stop the entire process until the packages are removed and a RESET button is pressed.
10) A supervisor will have the option on STOPPING any part of the process. This will require to stop the affected parts of the bottling.
11) A manual start is needed after each STOP or error in the system.