The relay is a PILZ PNOZ series. This should also solve the galvanic isolation issues we were discussing above.
In addition, if a cable gets crushed or shorted, the safety relay should catch the fault (periodic pulses are sent to check the health of the connections).
Correct. It detects a short between them, but also, both e-stop switch channels must open and close for it to enable the output: if one channel opens and closes, but the other stayed closed, this is considered a sensor/switch fault, and the output stays off.
STO1 and STO2 will then have to be routed via a custom ciurcit in my PCB, and that will be my own design (which at some point will have to be certified). Is this a more sensible approach?
Not really. That essentially circumvents much of the safety relay’s function, because it’s not actually switching the motor power. A safety system needs to rely on components and system design that are designed to fail safe (that is, that if
any part fails, the machine itself fails into a safe (nonhazardous) state)*. For example, in your design, the optocoupler or the gate driver could fail to an unsafe state (where the e-stop button is pressed but has no effect). What happens if the MCU crashes? (Can the PWM generators keep running independently even if your code has crashed or hit a bug?)
On the other hand, if you just route power to the BLDC driver through the safety relay, it doesn’t matter what else goes wrong: if you press the e-stop button, the motor WILL stop, even if (for example) your MCU has gotten into a state where the motor drive signals are being generated when they shouldn’t, and the gate driver’s enable line somehow got shorted to the enabled state.
Safety relays are designed with all sorts of redundancy and self-monitoring inside, so that if anything goes wrong, it shuts down the output. But that only works if it is physically capable of removing power to the hazard-generating parts (like the motor). So if you put anything in between, those things need to be equally designed for safety.
For example: If the motor currents are significantly less than the maximum of the safety relay’s outputs, you can use them directly, but it’s more common to use one (or more) of those outputs to control an external relay or contactor with force-guided contacts (or multiple in series, just like the internal force-guided relays inside the safety relay you show).
Force-guided contacts means that all the contacts in a relay or contactor (which are always single-throw in force-guided types) always move together by having a rigid mechanical linkage, and not individually-flexing double-throw contacts like in a regular relay.
Suppose you use two relays with force-guided contacts in series, so that you have two relays that must close for the motor to operate. If any contact were to weld closed, then when that relay is de-energized, the welded contact would prevent the other contacts in that relay from moving: the normally-open main contacts would remain closed, but also, the normally-closed auxiliary monitoring contact would stay open, breaking the “start” circuit that needs to be closed in order for the safety relay to allow the machine to start. This effectively prevents a failed (welded) relay from eroding a layer of safety: if one relay fails, the machine is disabled. The machine cannot be turned on until the failed relay is replaced.
An ordinary relay’s monitoring contact could close, even if one of the main contacts is welded, telling the safety relay an incorrect state. That means the safety redundancy of two relays in series is pointless, since the machine remains fully functional even if one relay has failed. If the second relay fails, the machine now has no way of stopping when the e-stop is pressed.
FYI, contactors are basically heavy-duty relays, but for the purposes of safety design, what’s special about them is that they break each circuit in two places, not just one, and have much larger gaps between open contacts (and between channels) than regular relays do. They’re basically always used for high-current switching, but miniature contactors exist for higher-reliability switching of smaller loads.
Also, the safety relay has a separate logic output for sending the output relay state to the MCU for monitoring.
* as opposed to the colloquial use of “fail safe” to mean “doesn’t fail”, “has redundancy”, or “does something extra”.