I know its probably a strange request but is there a way to get the status of the RSL pin? If there is not a way to get this information directly does anyone know if there is predictable behavior of the timing of the flashing etc based on FPGA time?
I’ll bite. Why?
You can get enabled status in the code and with some slow mo footage you can probably figure out RSL on and off time when flashing.
If you really wanted to do this you could probably hook up a custom circuit to it… and if there was a rule explicitly forbidding that you could do other crazy things:
- Use something to sense the current in the RSL wire
- Add a light sensor on the RSL itself
- Point your limelight at the RSL
… but really, why?
Some questions don’t need reasons
Fine but cool idea are meant to be shared!
Absolute Madman! Thanks!!
So for the people asking the question… WHY??? Originally I was looking into seeing if it would be possible to detect what channel on the PDH the rio was plugged into and or if an RSL light one plugged in or not. Unfortunately the current draw on the RSL is below the resolution of the PDH (For some reason I thought the RSL was incandescent).
Now however there is always fun to be had with addressable LEDS… IE making a synchronized wave to the RSL (And other shenanigan’s). Now just trying to thing of strange ways to use this new found information.
Hook up an optical sensor to look at the RSL.
From reading DS logs, I believe the current reported by the PDH has a resolution of ⅛ amp.
So I do not know the Specs for the CTRE PDP but for the PDH the specs are as follows.
High current Channels
125 mA Resolution with a max reading of 127.9 A
Low current Channels
62.5 mA Resolution with a max reading of 31.94 A
Ref Here Power Distribution Hub Specifications - Power Distribution Hub
I have had trouble finding exact specs for the PDP but one downside is that the channels used for powering the rio are not monitored.
So the high-current channels are using 10-bit, and the low-current 9-bit.
Conclusion: yes, it’s possible, albeit indirectly, using the input current of the roborio. I used this today to sync an LED strip with the RSL for Maximum Safety™.
Hahaha, so glad someone actuality did this. I totally forgot that there was current sensing on the RIO itself and not just the PDP/H. I have a feeling in a real match this source might be pretty noisily but you probably could get good data on it with enough filtering and modeling. Esp because the RSL blinks at a predictable frequency. Right now I don’t have access to a RIO to test on but want to see if I can get a working java example to call the C code shown in @Ryan_Blue’s Solution
Ryan’s solution is superior since it allows you to change the state of the RSL and not just read it
Coming soon to a wpilib beta near you:
Side note: please do not attempt to write to the RSL. Not only is it a tool field staff use to help diagnose issues with your robot, it’s also a critical safety feature.
What if I want to do it for fun?
Don’t, Ryan will revoke your WPILib license
and void your warranty the BSD license doesn’t provide in the first place.
Oh no! I violated the TOS for Linux!