RoboJackets / robocup-software

Georgia Tech RoboJackets Software for the RoboCup Small Size League
Apache License 2.0
183 stars 187 forks source link

Robots veer off course when turning and moving #781

Closed jgkamat closed 7 years ago

jgkamat commented 8 years ago

For an example, see this: snapshot4

I'm not sure if this is a problem with the soccer PID or the per wheel PID, but I think its on the per wheel PID.

Soccer seems to send the correct velocities, but I'm not 100% sure.

justbuchanan commented 8 years ago

Tuning the pid in soccer should fix this. There's no per-wheel pid in the simulator.

jgkamat commented 8 years ago

So then the issue that we saw at comp was just improperly tuned PID, I'm guessing. Hopefully this isn't a bigger issue than that.

jgkamat commented 8 years ago

I don't think this is an issue with the PID.

I think the issue is that as we rotate at a higher speed, the rotation alters our sent commands (as our commands are sent in the robot's frame of reference), Since our rotation speed is increasing, we continue to accumulate errors even though the PID will try to compensate. I think we could fix this by predicting where the robot will face when the command is actually received (maybe length of a frame / 2) and using that angle instead of the current robot's angle to send velocities on. Do we do anything like this already?

ashaw596 commented 8 years ago

I tried that a bit and it didn't really help much (in Sim at least). I think it's more a problem that in turning cases the robot acts a bit more like a car than the particle we model it as.

On Jul 16, 2016 4:31 PM, "Jay Kamat" notifications@github.com wrote:

I don't think this is an issue with the PID.

I think the issue is that as we rotate at a higher speed, the rotation alters our sent commands (as our commands are sent in the robot's frame of reference), Since our rotation speed is increasing, we continue to accumulate errors even though the PID will try to compensate. I think we could fix this by predicting where the robot will face when the command is actually received (maybe length of a frame / 2) and using that angle instead of the current robot's angle to send velocities on. Do we do anything like this already?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RoboJackets/robocup-software/issues/781#issuecomment-233156522, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8XBpl0eXD56LFLyHkYaIzx6UtFprq9ks5qWWnBgaJpZM4JOF-p .

ashaw596 commented 8 years ago

Could also just be a Sim thing. We could test the robot itself by driving forward and then switch to turning in place. Ideally it should slow down in a straight line even if it's turning(though wheel momentum might be an a issue). If it slows down while turning in a circle, it could be pid not controlling the wheels well, pid overcompensating, or our particle model is weird with the wheels(would lqr help?). With our motors, the robot might also just stop and fall over with really fast wheel deceleration.

On Jul 16, 2016 4:33 PM, "Albert" ashaw596@gmail.com wrote:

I tried that a bit and it didn't really help much (in Sim at least). I think it's more a problem that in turning cases the robot acts a bit more like a car than the particle we model it as.

On Jul 16, 2016 4:31 PM, "Jay Kamat" notifications@github.com wrote:

I don't think this is an issue with the PID.

I think the issue is that as we rotate at a higher speed, the rotation alters our sent commands (as our commands are sent in the robot's frame of reference), Since our rotation speed is increasing, we continue to accumulate errors even though the PID will try to compensate. I think we could fix this by predicting where the robot will face when the command is actually received (maybe length of a frame / 2) and using that angle instead of the current robot's angle to send velocities on. Do we do anything like this already?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RoboJackets/robocup-software/issues/781#issuecomment-233156522, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8XBpl0eXD56LFLyHkYaIzx6UtFprq9ks5qWWnBgaJpZM4JOF-p .

jgkamat commented 8 years ago

@jpfeltracco found out that this is an issue with us limiting our speed. We don't take rotation into account when driving, so when we rotate and drive, wheels at the top can't drive fast enough and we swerve.

jgkamat commented 7 years ago

@jpfeltracco does #856 fix this? I thought it did, but I wanted to be sure.

jpfeltracco commented 7 years ago

Yep, I'll go ahead and close this, I thought I mentioned in the PR that it closes this but I guess not.