Inertial help during auton

Hi,
I am the programmer in my team. I am coding 15 sec auton and I am using the inertial sensor to turn to a heading in degree. The problem is, is that when I am telling the robot to turn to, for example 315 degrees, it will turn to around 315 degrees, and then it will spin left and right multiple times before stoping at about 315. It appears that the robot keeps turning left and right because it is trying to find 315 degrees, however I don’t see anybody else on the forum having this problem so I am worried that this is something specific with my program. Also, I have the turn velocity to 10 percent which is really slow. I need help please. Has anybody else experienced this type of problem?

Your robot is oscillating, which means it keeps moving past the target point, and trying to correct for it in a loop. A sister team of mine had this problem, so I suggested that they make sure their drivetrain wheelbase and track length were correct in the code. This helped fix it.

What is really happening (someone else correct me if I am wrong) is that the robot is using its own wrong PID (proportional, integral, derivative) constants when using the inertial sensor. There are multiple articles and videos online about using a PID controller, and if you are interested in that, go ahead and check those out. I have added them to my code and it is extremely helpful to get it to drive the correct length and turn the correct amount, after the constants are tuned.

Hope this helped. Others, feel free to add what I missed or correct me if I misspoke.

1 Like

I think if your robot is oscillating it means your proportional constant is too high. If it never reaches the target then the derivative constant is to high and if the integral is too big it will really overshoot. I hope this helps.

1 Like

I can be corrected by jpearman or another knowledgeable Vex person, but I believe in the past they have said that for the “turn to heading” type blocks that it’s a straight P loop (no I or D). There is enough error correction that if it massively overshoots, then it tries to come back, and that’s going to show up with oscillation.

The suggestion to check wheelbase and gear ratios is definitely the first thing to do if the ‘Drivetrain’ is being utilized.

3 Likes

correct, and may will not work well for all robots.

3 Likes

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