I wish the Simple Motor Controller's ERR pin were active-low

I like my Simple Motor Controller 24v23 v1.4. I haven’t hooked it up to a motor yet; I’m just writing my software at this point. But so far as the software goes, I’m generally happy with my purchase.

I have a single complaint/feature request though: I really wish that the Simple Motor Controller’s ERR line were active-low. I think active-low is typical of fault detection lines.

I think the way the ERR line is supposed to work is that if any one of the devices on the ERR bus activated the line, all the devices would see it and shut down, right? That approach doesn’t work so reliably on an active-high inputs, especially when things are going wrong, which is exactly the situation where I would be using my ERR line.

The most serious case to consider for a fault detection line is where physical damage is happening and may escalate to people getting hurt. In the case of robot motor controllers, that would be one where control lines are being physically cut by the mechanical parts of the robot as it is destroying itself. As the machine’s metal parts cut the control lines, ERR will briefly be grounded. If the ERR line were active-low, that would raise the signal and allow any motors still powered to be shut down.

A less dramatic but more sinister case is one where some device is actively driving the active-high line low, either by bad design or a run-time failure. Either way, it would drain current away from the ERR line to ground. In microelectronics, current drains win over current sources. No matter how hard another device tries to raise the ERR line, the voltage won’t rise.

Lastly, with an active-high input, it takes work to push voltage up and raise the signal. As a fault detection bus, it should have a chance at detecting when a device on the bus has lost its own power supply. I understand that the other devices on the bus aren’t necessarily Pololu products, and it’s not your job to make sure they properly signal their failure. But with an active-high ERR line, it’s impossible to raise the signal when you’ve lost power. If ERR were an active-low line, the line driver for the device losing power could at least ground the line, which doesn’t require power.

From what I see, it should be easy enough for Pololu to publish an alternate firmware that makes the ERR line active low. It looks like the ERR terminal goes to a STM103TB microcontroller, input pin PB2, which has software-selectable pull-up resistor. :slight_smile:

That simply isn’t true for a number of possible output pin configurations. For example, a junction transistor is off (nonconducting) by default and requires base current to enforce an active low output.

Hello.

Thank you for sharing your feedback; I am glad that you are happy with the Simple Motor Controller. You bring up some really good points. It might be possible to create some alternative firmware that would switch the functionality of the ERR line. However, to use it effectively, you would have to somehow break the connection from the ERR line to the ground, which goes through the red LED and a resistor. Taking that into account, would you still be interested in this modification?

-Brandon

I’m not asking Pololu to make their devices ground ERR on power loss. I know it takes a careful hardware arrangement to make an output like that work properly. I want my Pololu device to recognize it if other devices can signal that way. The point is that with the ERR input is active-high, all of those things are impossible.

A simple implementation of ground-on-power-loss would be to put a normally-closed relay from the ERR bus to ground. When the device has power, it un-grounds the line. Power off, line grounded, that easy. :slight_smile: You could probably play some tricks with pull-ups, pull-downs and tri-state outputs if you wanted to.

You bet! Cutting a trace is easy and I wasn’t really using the ERR LED.

I was thinking about how briefly a chopped line might produce a low voltage on the input pin. In case there were software debouncing on that line, I would prefer not to have it.

Hi, Michael.

After further consideration of your suggestion, we have decided not to make the change you are requesting. I would like you and anyone else following the discussion to understand both why we have the error lines active high and why we do not want to make a version with them active low.

The main reason for the active-high error lines is that we would like these units to operate in a mix of 3.3 V and 5 V systems. Because the error lines are basically I/O lines on microcontrollers, there are diodes from the I/O pins to the microcontrollers’ respective Vdd lines. Depending on the details of the arrangements, having the error lines high by default could at best lead to unpredictable powering of the MCUs through error line and in the worst case damage the lower-voltage MCU.

I realize many parts have an active-low error output, but that is partly to allow you to use an external pull-up to get to the output voltage of your choice. For those devices, they have a genuine open-drain or open-collector output that would not allow the device to get powered from voltage on the line. Also, as Jim mentioned, you do need power to turn on those low-side transistors; in general, those active-low error lines will not indicate an error when those devices are not powered.

Ultimately, the error lines on our devices are not intended to provide the kind of comprehensive, system-level failsafe you are contemplating when talking about saw blades ripping through your robot, and inverting the error pin behavior is not going to change that or even significantly improve that. You talk about what happens for the instant that a saw blade might be shorting an error line to ground, but as soon as the wire is severed, that link to other malfunctioning units is cut, anyway. In this general approach where all the error lines are just wired together, we cannot have devices driving high and low; we can only choose between floating and one of the other two states. If you really wanted something where malfunction of any device can be detected by all other ones, you would have to do something much more complicated.

For your immediate case, if you were happy going to extremes like cutting up traces anyway, it should be pretty easy to invert the error behavior externally. If you want just the open-drain output that’s active low, you can just connect the error line to a transistor; if you want the behavior flipped for the input, just invert your incoming error line.

Finally, if you are interested in a high volume of these motor controllers, we can certainly customize them all kinds of ways including making the error lines work however you want. Please contact us directly if that is something you would like to pursue.

- Jan