Added a second cylinder to my clamp, but now the button doesnt work

I recently added a second double acting cylinder to my clamp adjacent to where the first one was, and used t fittings to split the air from the solenoid to the two cylinders. However, now there is seemingly a delay on the button telling it to close, or it just doesn’t work sometimes. Nothing changed in terms of electrical components, and the open button still works fine. but i have to press the close button several times for it to close. Does anyone have any ideas what might be causing this?

  1. Make sure that you didn’t accidentally flip the tubes when installing the new cylinder.
  2. Make sure there are no leaks, and that all of your tubing is properly inserted into all of the fittings.
1 Like

Time to start troubleshooting
Would it be possible to paste your code?

1 Like
while (1) {
 //Drivetrain code
LDrive.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct)+Controller1.Axis4.position(percentUnits::pct)/2-Controller1.Axis2.position(percentUnits::pct), velocityUnits::pct);
RDrive.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct)-Controller1.Axis4.position(percentUnits::pct)/2-Controller1.Axis2.position(percentUnits::pct), velocityUnits::pct);
LDrive2.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct)+Controller1.Axis4.position(percentUnits::pct)/2-Controller1.Axis2.position(percentUnits::pct), velocityUnits::pct);
RDrive2.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct)-Controller1.Axis4.position(percentUnits::pct)/2-Controller1.Axis2.position(percentUnits::pct), velocityUnits::pct);
 //Control Front Mobile Goal Lift (One with Clamp)
 if(Controller1.ButtonL1.pressing()){
   //Drops Lift Down
  LiftL.spin(directionType::rev, 100, velocityUnits::pct);
  LiftR.spin(directionType::rev, 100, velocityUnits::pct);
}
 else if(Controller1.ButtonL2.pressing()){
   //Lifts Lift Up
  LiftL.spin(directionType::fwd, 100, velocityUnits::pct);
  LiftR.spin(directionType::fwd, 100,velocityUnits::pct);
 }
else{
  //Brakes Lift When Not Moving
  LiftL.stop(brakeType::hold);
  LiftR.stop(brakeType::hold);
 }
//other mogo pickup
if(Controller1.ButtonR1.pressing()){
   Tilter.spin(directionType::rev, 100, velocityUnits::pct);
}
else if(Controller1.ButtonR2.pressing()){
  Tilter.spin(directionType::fwd, 100, velocityUnits::pct);
 }
 else{
  Tilter.stop(brakeType::hold);
}
//ring intake
if(Controller1.ButtonA.pressing()  ) {
  Intake.spin(directionType::fwd, 100, velocityUnits::pct);
}
else if(Controller1.ButtonB.pressing()  ) {
  Intake.spin(directionType::rev, 50, velocityUnits::pct);
 }
else{
   Intake.stop(brakeType::coast);
 }
//Pneumatic Code
if( Controller1.ButtonX.pressing() ) {
   Pneumatics.set( false );
 }
 //Otherwise don’t activate
 if( Controller1.ButtonY.pressing() )
   Pneumatics.set( true );
}
wait(20,msec);
}
int main() {
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
pre_auton();
while (true) {
 wait(100, msec);
}
}
  1. The cylinders are not opposing each other; when the brain is off both are pushing in the same direction.
  2. I haven’t done precise leak testing, but would this impact the toggling of the cylinders? it isn’t running out of air

I’m not a coder, and this is gonna sound really dumb, but are there any compilation errors? Like, is there a brace or bracket missing or anything?

No, the code works fine. It worked perfectly up until i added the second cylinder, which is why I can’t figure out what the problem is

Alrighty, turns out it was a controller issue. Broken button. Very strange, because it worked perfectly all the way up until we added the cylinder, and then it stopped working every time. Thanks for the input all.

5 Likes