Is it possible and legal to disable a CAN Spark Max from a RaspberryPi by connecting a GPIO digital out pin from the RaspberryPi to the Forward Limit Switch input on the data port of the CAN Spark Max, then connecting the two grounds together?
Basically, wired like this:
The GPIO digital output pin is connected to the LIMIT F solder pad, while the grounds are connected. By setting the pin high on the RaspberryPi, the Spark would register this as the limit switch being ‘hit’ and stop the motor from moving forwards, while by setting the pin low the Spark would continue moving.
The Spark would still be on the RoboRio’s CAN bus and receiving the disable signals from the Rio, this would only serve to act like a limit switch.
The RaspberryPi’s digital output is 3.3v, and I believe the Spark’s input is the same (someone fact-check me on this please)
if your raspberry pi runs any kind of logic besides being some intermediate between a hardware switch and your sparkmax, this seems illegal by R701 blue box:
There are no rules that prohibit co-processors, provided commands originate
from the roboRIO to enable and disable all power regulating devices. This
includes motor controllers legally wired to the CAN bus.
either way, it may be in a gray area of being noticed at inspection (or even illegal at all), do with that info how you please.
? the commands are still all made by a legal motor controller.
It would appear that the limit switch input needs to connect to ground, not 3v3.
Spark max documentation:
Not sure if it can be reconfigured. If it cannot, I would suggest using a relay controlled by the raspberry pi and connecting ground and the limit switch pin.
1 Like
true that, and i could totally see this going both ways, ie because youre using this to avoid needing to use can/nt on your pi, id suggest against making a qa, and just rolling with it. if need be your goal can (probably) be achieved with no hardware modifications using nt
1 Like