Force Re-calibrate gyro after physically moving robot

Is there a way to force re-calibration of the gyro when using a drivetrain with gyro in VEXcode IQ Blocks? Carrying the robot seems to decrease the gyro accuracy, but physically moving the robot is needed to reposition it during a programming skills run.

Not sure about IQ Blocks, but it used to be possible in RobotC back in the day.
That being said, moving robot around mid-skills-run shouldn’t affect accuracy much. What does is moving the robot while it is initially calibrating, such as when you’re turning it on, or while you ask for explicit recalibration.

Just to make sure we’re on the same page: Calibration is the time when the gyro finds the mid-position, zero angular rate signal. Reset is when you tell the system that “this is the zero heading”.

My students never needed costly (2+s) recalibration during a match, but they would routinely reset the gyro whenever they got a good reference (robot pushing against the wall, for example).

4 Likes

If you just want to reset to zero, you can use the Set Drivetrain Heading block which can be found under Drivetrain.
I don’t think that you can recalibrate though.

1 Like

You can calibrate at any time by using the calibrate block… Unless you are using a drivetrain. Then you can’t. But, if you’re using a drivetrain, I would encourage you to learn more about blocks so you don’t have to.

Of for sure, this is how I prefer teams to go but for rookies the Drivetrain solutions are excellent.

Yes, I have written code using gyro readings based on its drift in different programming environments, but I coach beginners and they need to start somewhere less complicated. Using the drivetrain with gyro with VEXcode IQ Blocks is a good start. However, the robot still does not move in the exact same way every time the program is run. There is enough variability to cause tens of points to be lost or gained based on apparent luck. We have looked at other sources of variability and are trying to do all that can be done to reduce it. Gyro calibration is one of those possible sources of variability. The execution of a sequence of forward and turn commands results in the robot orientation being about 10 degrees off in heading in the end after some runs. I don’t understand how the turns using a drivetrain with gyro can allow this.

1 Like

I’m not sure how much (if any) P control there is on drivetrain gyro turns, @tfriez is your man for that. But maybe try adding your own basic P control, e.g if you want to turn 90 degrees, do 65 degrees at 80% turn speed then 25 degrees at 15% turn speed to reduce inertia-driven overshoot.

2 Likes

You can calibrate the gyro for 2, 4, or 8 seconds. The default is 2 seconds. The longer you calibrate without moving the robot, the more accurate the gyro will remain. I have found that calibrating for 8 seconds before the start of the match results in the gyro remaining significantly more accurate throughout the match. After that if the gyro gets disoriented, you only need to orient the robot against a reference (the wall) and reset (not recalibrate).

1 Like

We’ve received some feedback on this, so we’re going to expose different drivetrain calibration options / recalibrate drivetrain blocks in a future update.

3 Likes

Awesome! Is there an ETA for delivery?

Likely in our post-worlds update… we’re focused on bug fixes only between now and worlds to minimize changes for teams.

2 Likes

Apologies for reviving an old thread, but wanted to follow up on the delivery of this feature. Unless I have overlooked it, I believe that the calibrate gyro block is still not exposed to the user if drivetrain with gyro is setup. Can you confirm if this is still on the roadmap or has been obsoleted by a different method?

1 Like

Apologies, this got lost in the “before times” that was pre-pandemic / pre-VEXcode VR.

The new IQ 2nd Gen exposes the internal Inertial sensor calibration block at all times, but the discrete drivetrain gyro block has not yet been exposed. We’ll get this back on the development menu again, thanks to your ping.

3 Likes

Out of curiosity, when using drivetrain, does the gyro automatically calibrate when a program slot is started?

Should teams reset the heading to zero or does any of that take any affect?

My more experienced teams are using a P-loop like Caution Tape (so they have access to the calibrate block), but using the drivetrain setup & blocks for the newer teams is a necessity so not sure if there are any best practices I can share with them.

Thank you

2 Likes

Hi Vex I am a student at HCS Indy and I am having trouble with the gyro sensor. It is turning and going foreword unexpectedly and unknowingly please help.

your person,
??? ???