-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timers don't properly reset during a successful pid_wait_until
#117
Labels
bug
Something isn't working
Comments
Using the same chunk of code that caused problem, I confirmed that adding
|
I should have done this previously, but I've made sure this issue is fixed in drive and swing motions. Drive (there are doubles here because each side of the drive has it's own exit conditions running)
Swing
|
ssejrog
added a commit
that referenced
this issue
Jun 10, 2024
* New action for deploying website * ⬆️ PROS 4 Porting work (#100) * New action for deploying website (#98) * PROS 4 Porting work * Revert gitignore * Added imu loading animation --------- Co-authored-by: Jess Zarchi <[email protected]> * 🐛Fixed unit conversion for exit conditions * 🐛Fixed derivative kick #99 (#105) * ✨Added imu scaling #104 (#106) * ✨Imu velocity exiting #102 * PID class has secondary sensor velocity support, implemented that with imu accel into exit conditions * Made names more clear, added missing functions * 🐛Max text width is wider #112 (#113) * 🐛Exit condition print error #111 (#114) * ✨Motion chaining #109 (#115) * Motion chaining and quick exits are functional #109 * Added reverse constants, okapi units, finalized function names and comments * 🐛Fixed scaling in drive pid #110 (#116) * Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized --------- Co-authored-by: Will Xu <[email protected]>
ssejrog
added a commit
that referenced
this issue
Jun 10, 2024
* New action for deploying website (#98) * ⬆️3.1.0 (#124) * New action for deploying website * ⬆️ PROS 4 Porting work (#100) * New action for deploying website (#98) * PROS 4 Porting work * Revert gitignore * Added imu loading animation --------- Co-authored-by: Jess Zarchi <[email protected]> * 🐛Fixed unit conversion for exit conditions * 🐛Fixed derivative kick #99 (#105) * ✨Added imu scaling #104 (#106) * ✨Imu velocity exiting #102 * PID class has secondary sensor velocity support, implemented that with imu accel into exit conditions * Made names more clear, added missing functions * 🐛Max text width is wider #112 (#113) * 🐛Exit condition print error #111 (#114) * ✨Motion chaining #109 (#115) * Motion chaining and quick exits are functional #109 * Added reverse constants, okapi units, finalized function names and comments * 🐛Fixed scaling in drive pid #110 (#116) * Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized --------- Co-authored-by: Will Xu <[email protected]> * Hotfix broken link --------- Co-authored-by: Will Xu <[email protected]>
ssejrog
added a commit
that referenced
this issue
Jun 10, 2024
* Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized * Bring final 3.1.0 over to dev (#125) * New action for deploying website (#98) * ⬆️3.1.0 (#124) * New action for deploying website * ⬆️ PROS 4 Porting work (#100) * New action for deploying website (#98) * PROS 4 Porting work * Revert gitignore * Added imu loading animation --------- Co-authored-by: Jess Zarchi <[email protected]> * 🐛Fixed unit conversion for exit conditions * 🐛Fixed derivative kick #99 (#105) * ✨Added imu scaling #104 (#106) * ✨Imu velocity exiting #102 * PID class has secondary sensor velocity support, implemented that with imu accel into exit conditions * Made names more clear, added missing functions * 🐛Max text width is wider #112 (#113) * 🐛Exit condition print error #111 (#114) * ✨Motion chaining #109 (#115) * Motion chaining and quick exits are functional #109 * Added reverse constants, okapi units, finalized function names and comments * 🐛Fixed scaling in drive pid #110 (#116) * Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized --------- Co-authored-by: Will Xu <[email protected]> * Hotfix broken link --------- Co-authored-by: Will Xu <[email protected]> --------- Co-authored-by: Will Xu <[email protected]>
ssejrog
added a commit
that referenced
this issue
Jun 10, 2024
* New action for deploying website (#98) * Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized * ⬆️3.1.0 (#124) * New action for deploying website * ⬆️ PROS 4 Porting work (#100) * New action for deploying website (#98) * PROS 4 Porting work * Revert gitignore * Added imu loading animation --------- Co-authored-by: Jess Zarchi <[email protected]> * 🐛Fixed unit conversion for exit conditions * 🐛Fixed derivative kick #99 (#105) * ✨Added imu scaling #104 (#106) * ✨Imu velocity exiting #102 * PID class has secondary sensor velocity support, implemented that with imu accel into exit conditions * Made names more clear, added missing functions * 🐛Max text width is wider #112 (#113) * 🐛Exit condition print error #111 (#114) * ✨Motion chaining #109 (#115) * Motion chaining and quick exits are functional #109 * Added reverse constants, okapi units, finalized function names and comments * 🐛Fixed scaling in drive pid #110 (#116) * Upgraded example project, cleaned formatting everywhere Main project builds fine, the example project is giving me strange errors about the LCD. Not sure how to fix this * Timers now correctly reset between motions #117 * Added liblvgl to example project, updated template * Changing max speed works, new (old) default constants, new constructor #118 #119 #120 * Fixed typo in example project * Cleaned up example project * Main project updated to example, fixed #122 and #123 * Final 3.1.0 push. Template and example project finalized --------- Co-authored-by: Will Xu <[email protected]> * Hotfix broken link --------- Co-authored-by: Will Xu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
People were saying motions would sometimes skip randomly. The past few days I've looked through those projects and found other problems that have been solved elsewhere here. These were problems relating to exit condition constants being way too small, or some incorrect signs in
pid_wait_until
.As people pushed ez's exit conditions further and robots got faster, I think the perfect storm appeared to uncover an underlying bug since the start of ez template.
Expected Behavior
All timers for exit conditions should reset after a
pid_wait_
has run, and potentially at the start of every motion.Actual Behavior
When
pid_wait_until()
is successful, it bypasses the timers and they hold their values over to the next motion.Steps to Reproduce
This code was able to show that when
pid_wait_until
failsafes the timers do reset.Below:
I was able to get a successful
pid_wait_until
with the code below, and none of the timers reset between motions.The second motion did not skip here, but
m
was 10ms away from skipping it.Solution
timers_reset()
needs to be made public in the PID classpid_wait_until
exitpid_x_set()
to make extra sure all of the timers start at 0The text was updated successfully, but these errors were encountered: