Add NUSense Fan Controller functionality#38
Conversation
…le communication with the fan controller over I2C.
There was a problem hiding this comment.
Did you use the nanopb tool in the NUbots/NUbots repo to update the NUSenseData protobuf files here? It's been a while, so I can't remember exactly, but mostly interested to know if the tool is working well still as-is, otherwise if you had to do anything like update libraries make sure they go in the other PR for the next person.
I'm assuming that only the pb.* files are auto generated.
It looks like a lot of comments, but a lot of them are the same point just repeated.
Some of this is convention, which can be confusing here if the auto generated code does something different.
Good stuff!
Yes - autogenerated by |
ysims
left a comment
There was a problem hiding this comment.
Nice re:the nanopb tool, and yeah definitely something that can get missed. Is there a NUSense page going up on NUbook? It would be good to mention this in a NUSense development page
There is a draft. Will definitely add. I forgot about the new ./b tool. |
|
wait theres a tool to generate nanopb messages in the code base? |
you're as surprised as I was after I had handwritten out all the message stuff... |
I dont remember writing the tool ngl lol |
This PR is linked to functionality on NUBots PR#1763
This PR enables use of the MAX31760 Fan controller IC on the NUSense board, detects if a fan has dropped below a set RPM threshold, and passes a fan warning to NUSense through the existing ProtoBuf framework.
This chip has the functionality to automatically control a tachometer-enabled fan, however this behavior has not been implemented. On startup of NUSense, the fans are put in manual mode (disable all automatic control and write PWM directly to the fans) and sends them full blast (255/255) for full fan speed.
In the NUSense super-loop, the fan controller IC is polled for each fans speed, and is then compared against the fan controller warning threshold (100RPM) which determines whether or not to report an error back to the NUC.