Autonomous Mode Issues

As the title implies we are having problems with our autonomous (all 5 of em).
Everything runs and in the correct order but some of the values aren’t working correctly.
When I plug the same values into TeleOp Everything works as planned.
The specific things that aren’t happening are

  1. The drive motors oscillate forward and back when they are told to run
  2. The shooter spins but, not at the correct speed

(see attatched vi)

Autonomous Independent.vi (108 KB)


Autonomous Independent.vi (108 KB)

Anyone.

Did you really mean to set the PID coefficients for driving to 0, 0, and 0?

Did you really mean to se the Left and Right Drive values to 0 and 0?

I didn’t look as closely at the shooter, but it looks like globals that describe the set points of the control loops aren’t telling the robot to do much. If 16 isn’t the auto you wanted comments on, post another picture.

Greg McKaskle

Are you trying to drive the robot to a specified location? Your P gain might be too high in the “1” case, making it oscillate around the setpoint. This will happen if your wheels are off the ground without any significant load.

Your shooter encoder is obviously configured with 4x decoding. If you change it to 1x (and change the associated constant 1440 to 360), you can get slightly better results, though since you’re computing the rate yourself from the position it isn’t a big deal. You should definitely see an improvement in shooter speed stability if you change its simple delay-throttled while loop to a timed loop, or if you do a similar delta computation on the actual system millisecond timer instead of just assuming the loop runs at a fixed rate. I think the constant 20 is involved there – are you commanding the shooter speed in revolutions per second?

In your While loops, I see a consistent pattern of testing for (i+1) being greater than or equal to a constant. Why not just test for i being greater?

The testing was done on the ground.
The shooter is configured to 2x. and the code for the shooter (conversions and stuff) is from teleop, where it works perfect. I’m commanding the shooter to an arbitrary value not a RPS

The default values are set to 0 UNTIL the case structures come in and tell it otherwise, via a local variable.

Now here’s what I think the problem is. When I found those setpoints and PID gains it was in TeleOp mode not autonomous. does TeleOp run at a different speed than the while loop with a 50 ms timer in it?

Could I just take the timers out of all of em and put the whole thing in a 50ms While loop?

Teleop runs nominally at 20ms. So yes, your tuning is for a different loop rate. I don’t remember your symptoms well enough to say this is the issue, but it should be pretty simple to change the lower loops to run at 20ms and test – if you have the mechanisms.

Greg McKaskle

Which would cause a slower rate WHOOO Thanks for the help. I’m unsure if this will remedy the drive system because of the whole bag thing but it will definitely work on the shooter.