Solenoid not working correctly (URGENT!)

We are using CTRE PCM and solenoids to control our pneumatics arm, however it doesn’t work well. We cannot make the solenoid work. The riolog says ‘CAN message not found’. The status light is also off on the PCM. Could anyone help me solve this?

Sounds like a wiring problem. Do the other CAN devices work?

Other devices work rather well, and Phoenix can also recognize PCM, with Compressor working and the status light is orange, but the solenoid seems nowhere to be found.
I am not sure if the solenoid will appear in Phoenix or not.

Did you change the pcms ID from the default of 0? DONT do that if you did. The PDP and PCM should always have an ID of 0 unless you tell it otherwise specifically in your code. All of the default library methods will assume ID 0.

5.6 Pneumatic Troubleshooting :: FRC Zero has that note and some other things you should try!

1 Like

alright, i will try to recover it.
i change the can id to 4 and i also edit the corresponding code in the program.

According to the docs.wpilib.org page about using the compressor and solenoids they do show you can change the ID with either of these two lines depending on your hardware

Compressor pcmCompressor = new Compressor(0, PneumaticsModuleType.CTREPCM);
Compressor phCompressor = new Compressor(1, PneumaticsModuleType.REVPH);

In the example they have a PCM using 0 and the PCH using 1 for the can ID.

So you could use 4 but if you didn’t change the ID there when declaring your compressor that would explain the issue you are seeing possibly.

Since the compressor can be not declared and instead automatically created when making a solenoid, or if you don’t specify an ID for your pnuematics control hardware it is assumed it is 0 by default.

It sounds like you did alter your code to match this so my only other questions/suggestions besides the steps in the FRC zero guide would be to double check that you don’t have conflicting IDs elsewhere in the can chain prior to the PCM. If for some reason you have 2 motors with conflicting IDs right before any other can device the network data may never make it all the way there.

Other idea

Trying putting the PCM right after the roborio in the daisy chain before any motor controllers and see if that changes the behavior at all. If so you know the issue is further down the chain and you can keep physically working your way like that down the line til it’s solved.

Also if you have a screenshot or can copy paste your code here in a code block using three ’ with the word java like ‘’‘java your code in-between ‘’’ but replace the ‘’’ with ` and it should format it properly like the block I did. Maybe there’s something else in the code if the physical checks and Id change all fail

Also rereading the question about if the solenoids will show up in Phoenix Tuner, I’m unsure because they are really just relays. They don’t have a data line persay or a way to communicate. They are on and off like a switch and the reason the PCM has CAN at all is because it gets data from the roboRio to turn ports 0-7 on or off according to the code for the solenoids. So maybe phoenix would show a port status for 0-7 but more than likely there’s nothing there.

1 Like

Sincere thanks for your timely reply.
We now solve the problem according to your solution. It was effective and the solenoid react after setting the PCM CAN ID to 0. I did change my code but other ids won’t work at all.
Maybe the can id used for execute is 0 by default. Anyway, it’s good news we can solve the issue. It helps a lot and thank you again.

1 Like

I’m glad it worked! We have had this happen so often my default response is just always use 0 because it works. I think there’s a way to mark that comment as a solution if you can. Then when someone else has this same problem they can find the same answer you got!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.