Winch Control Board (WCB)                                                               Last update: 2019-08-13
The Winch Control Board controls the Winch Motor, a 24V windscreen whiper motor, used to lift and lower the cover of the machine.
The size of the cover (... x ... cm)  makes it difficult for moderate sized people to open or close it manually.

The winch has its own endswitches. For Cover-closed on the front of the laser area, for fully open a small mercury (shame) switch is mounted on the inside of the cover, such that it will open at approximately 60 degrees.
Endswitches are open when hit. The most likely failmechanism is a loose wire which will produce a safe “stop” condition.

There is an Arduino Nano which steers a dual half-bridge module with two synchronized PWM signals to control the motor voltage. 
A current sensor provides info about the actual motor current, which is positively fed back into the PWM drive to stabilize the motor speed, and to detect overcurrent in case the movement is stuck.

The WCB communicates with the Arduino on the Safety Board by software serial (This leaves the USB-serial port free for programming and diagnosis and avoids Arduino-Arduino communication over USB)

The WCB reports its status by sending single character messages:
"O" = fully open, i.e. the "Open" end switch is activated.
"o" = in the process of opening.
"C" = Closed, i.e. the "Closed" end switch is activated.
"c" = in the process of closing.
"M" = stopped in the middle between fully open and fully closed.
"E" = Error, overcurrent detected. The WCB disables the half-briges. A reset of the Winch-Arduino is required to go back to normal operation.

If the WCB does not react the Safety Board (SFB) assumes that the winch is not operable and disables he relevant buttons on the user screen.
For the sake of safety the SFB relies only on the two "Cover Closed" switches wired to the SFB.

The WCB accepts the following commands from the GUI (through the SFB) as single characters and reacts with the one-char status message.
"O" = start opening the cover. Response = "o".  If it was closing, the movement is stopped and the response = "M".
"C" = start closing the cover. Response = "c". If it was opening, the movement is stopped and the response = "M".
"I" = Idle. Do nothing but respond with the status.
The commands "O" and "C" are given only once by the SFB when such action is required.

On the board sits a switch which triggers the "O" or "C" commands as if they were from the SFB.

One adjustment potmeter controls the nominal speed of opening / closing.
Another pot controls the amount of positive feedback of motor current into the motor voltage.
This may require some explanation:
When a DC brushed motor is running it also acts as a DC generator. The voltage generated is linearely proportional to the RPM of the motor. The difference between this generated voltage and the applied voltage causes -devided by the electrical armature resistance- the current through the motor, to which the torque is proportional. So when we add to the applied voltage an amount I-motor * R-motor we've stabilized the RPM very well regarding mechanical load variations. The feedback potmeter actually sets the R-Motor value. 

The states of the WCB controller are described by the following state diagram:


State Diagram of the Winch Controller.

On the GUI-side the status information is only used to determine which buttons should be active, blinking, or inactive, according to the next Table.

Received Char / Job Status
O
o
M
c
C
E
Job Running
Job Paused
ButtOpen
X
Blink
OK
OK
OK
X
X
OK(*)
ButtClose
OK
OK
OK
Blink
X
X
X
X(*)

Note (*) During JobPaused the cover can be opened and closed. When the cover is not closed the Job cannot be continued.
Manually opening the cover while a Job is running will abort it without the possibility of continuing.