View Single Post
  #8   Spotlight this post!  
Unread 09-12-2016, 16:21
cbale2000's Avatar
cbale2000 cbale2000 is offline
Registered User
AKA: Chris Bale
FRC #0703 (Phoenix)
Team Role: Leadership
 
Join Date: Apr 2006
Rookie Year: 2004
Location: Saginaw, MI
Posts: 919
cbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond repute
Re: Powering two compressors with one PCM

Quote:
Originally Posted by axton900 View Post
The issue that we are facing with the idea of just using a spike relay is the fact that the compressor class in wpilib only seems to be accepting the pcm as a parameter.
Could one of the teams who was able to use a relay share the code that they used for this situation?
Thanks in advance!
Older default code (2014 and before) would have some basic examples, though it should be pretty easy to program yourself.

There should be a way to read the pressure sensors state from the PCM in code, and if you have that, then all you have to do is use the output of the pressure state to toggle the spike on or off. The pressure sensor is a switch that activates at ~120psi and deactivates at ~ 100-110psi, so simply using it as a Boolean to toggle the compressor state should make it operate the same as a PCM controlled compressor would.

You can query the pressure switch and compressor status from the PCM and simply mimic the state of the PCM controlled compressor with the code on the bottom half of this page: https://wpilib.screenstepslive.com/s...anual-id=13810


The second compressor, for the purposes of code, isn't a compressor, it's a Spike-controlled motor. Just make sure that the spike turns on and off at the appropriate times via the methods mentioned above.

Last edited by cbale2000 : 09-12-2016 at 16:26.
Reply With Quote