Tshirt cannon CAN issue

We are just trying to get our tshirt cannon to do the bare minimum and open solenoids. We have been having a CAN issue for a while and we’ve tried almost everything…

  • Replaced all hardware
  • Updated PDP and PCM Firmware
  • Updated the PDP CAN ID to 1 and PCM CAN ID to 0
  • Rewired all electrical from FRC guide

I’m very sure our electrical is all correct, but we still get a CAN issue in Driver Station console.

The PDP and PCM status lights both flash slow green, even when enabled.

What exact message is the driver station reporting?

Probably not an issue with this short of wires, but the CAN wires ought to be a twisted pair.

Yeah I don’t have an updated picture but I twisted the CAN wires, and moved radio like 2 feet away.

Error is: “CAN Error message not found”

You might have a device in code that isn’t on your bus (like a motor controller). Make sure you have all your IDs in code correct, and also make sure you don’t have any devices in code that’s not on the bus

The code just defines PCM, I believe the library automatically gets the ID from what I’m told? It also doesn’t have a field to define it in the declaration of the PCM

The CAN ID of the PCM can be declared in the constructor of the solenoid itself and in my experience it usually is best to do so.

I think the only variable it takes is the port on the PCM.

No, it can, the constructor of the Solenoid and DoubleSolenoid class can take the CAN ID of the pneumatics module. I am not sure if this is your issue but we have had similar issues before and I do believe adding the CAN ID solved it.
image

image

DoubleSolenoid
Solenoid

1 Like

I rewrote the code with the proper solenoid method and it worked, thank you so much​:sob::sob:

1 Like

I’m glad it worked! I have ran into this issue multiple times and always forget because it seems odd for the CAN ID to be in the solenoid rather than the pneumatics module itself, I’m sure there must be a reason for it though.

Agreed. This confused me this year as well

I don’t know if this still holds true but I was told at one point the reason this was done was if you were splitting a double solenoids relays onto two different PCM modules. It’s an edge case but in that scenario you want to tell it which relay and module by solenoid.

Edit. Reading the API the double doesn’t support that anymore so I’m not sure why I was told this.

The PneumaticsControlModule class also has a constructor that includes the CAN ID.

1 Like

Ah, it does, looking back at some of our team’s code. But even with that CAN ID there we still saw issues without putting it in the solenoid itself.

If you contructed it like the following then the two objects aren’t linked together and the PCM would use CAN ID 10 and the Solenoid would use the default CAN ID 0. What PCM would the solenoid be associated with if you had multiple PCMs?

  PneumaticsControlModule pcm = new PneumaticsControlModule(10);
  Solenoid sol = new Solenoid(PneumaticsModuleType.CTREPCM, 0);

If you constructed it like the following, then they would associated and both would use CAN ID 11.

  PneumaticsControlModule pcm2 = new PneumaticsControlModule(11);
  Solenoid sol2 = pcm2.makeSolenoid(0);

The former syntax has the advantage that for robots with solenoids in multiple subsystems, you don’t need to pass PCM objects around, but with the disadvantage that you have to put in the CAN ID each time.

Code issues aside, I’m begging you, please give those CAN wires a good twisting (CAN wire should be twisted to avoid signal interference). It’s painful to look at. :joy:

2 Likes

yeah I already had, im gonna neaten up the board now that it work

1 Like

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