Skip to content
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

Wider/Smaller Swings and PID Locking Opposite Side in Swings #83

Closed
Unionjackjz1 opened this issue Jan 25, 2024 · 0 comments
Closed

Wider/Smaller Swings and PID Locking Opposite Side in Swings #83

Unionjackjz1 opened this issue Jan 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Unionjackjz1
Copy link
Member

Unionjackjz1 commented Jan 25, 2024

There are two improvements that need to be made that both intertwine with each other.

The problem with this code is the opposite side of the drive can potentially move during the swing, leading to inconsistencies.

    if (current_swing == LEFT_SWING)
      private_drive_set(swing_out, 0);
    else if (current_swing == RIGHT_SWING)
      private_drive_set(0, -swing_out);

Instead we should run PID on that side of the drive to stop it from moving.

But with this, we should also have an option to set that side to some power to allow for wider swing turns. This should be some constant power that scales with the powered side. This was implemented in EZ-Template before it was released and somewhere got removed. This can also allow for smaller swings by setting the opposite side to a negative number.

The opposite side should be set to opposite side power * (swing_out / max_speed)

@Unionjackjz1 Unionjackjz1 added the enhancement New feature or request label Jan 25, 2024
@Unionjackjz1 Unionjackjz1 self-assigned this Jan 25, 2024
@Unionjackjz1 Unionjackjz1 changed the title Wider Swings and PID Locking Opposite Side in Swings Wider/Smaller Swings and PID Locking Opposite Side in Swings Jan 25, 2024
Unionjackjz1 added a commit that referenced this issue Jan 25, 2024
Backwards right arcs would have the left PID go the wrong direction.
Unionjackjz1 added a commit that referenced this issue Jan 29, 2024
* Fixed rotation sensor tick per rev (#47)

* middle step for #49 and #54

* Added piston groups (#54)

* Completed small issues (#56, #55, $54, #52, #48)

* Finished with clean up on constants

* Added set ratio function

* Added practice mode

* Updated PROS Kernel, okapi, fixed #53, general cleaning

* ✨Okapi units (#49, #62)

* ✨ Added `set_relative_turn_pid()` (#59)

* issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

* issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

* Fixed issue #67

* ✨Okapi units

* New function names #65

* Added okapi units to turns and time, tuned PID, cleaned code, completed #66

* Fixed some names, added `get` functions #73

* Added more gets, removed version # from print  #73

The version number in `ez_template_print` was redundant when version can be checked through pros cli.

* ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

* Memory optimisation and comments:
when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

* Maybe I was wrong

* add new website code

* added running the site locally

* kernel upgrade

* Update Kernel/Okapi

---------

Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

* Added Ability for user to reverse Drive in opcontrol (#80)

* Update drive.hpp

weird changes

* Added Reversal to opcontrol driving

* mistake deleting active break logic, added back

* Removed old website, updated readme

* Completed #82, fixed formatting

* Cleaned relative turns, added wide swings #59 #83

* Added slew to turns and swings, fixed wide arc bug #59 #83 #84

Backwards right arcs would have the left PID go the wrong direction.

* #49 #59 #65 #84

All functions that have a parameter using okapi units has the ability to be called without using okapi units.

Fixed relative bug that would stop a swing from working off of a turn

Naming convention was fixed on setting constants.

Forward and Reverse PID for swings was implemented.

* namespaced all classes, removed piston group. #50 #54

* Added PID Tuner #85

* PID Tuner can modify increments #85 #86 #87

PID Tuner:
- printing to brain can now be toggled
- won't enable autonselector if it wasn't on prior to enabling PID Tuner
- user can set all increments
- user can get all increments
- renamed functions to be compliant with #65

Completed #86 and #87

* Cleaned example files

* Added example project to this repo and made v3 template

* Final update for 3.0.0 #65

---------

Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
Co-authored-by: Will Xu <xu.z.william@gmail.com>
Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>
Unionjackjz1 added a commit that referenced this issue Feb 7, 2024
commit 600bc47
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:53:53 2024 -0800

    Removed 2.x files

commit 6f6c701
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:45:42 2024 -0800

    v3.0.0 (#88)

    * Fixed rotation sensor tick per rev (#47)

    * middle step for #49 and #54

    * Added piston groups (#54)

    * Completed small issues (#56, #55, $54, #52, #48)

    * Finished with clean up on constants

    * Added set ratio function

    * Added practice mode

    * Updated PROS Kernel, okapi, fixed #53, general cleaning

    * ✨Okapi units (#49, #62)

    * ✨ Added `set_relative_turn_pid()` (#59)

    * issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

    * issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

    * Fixed issue #67

    * ✨Okapi units

    * New function names #65

    * Added okapi units to turns and time, tuned PID, cleaned code, completed #66

    * Fixed some names, added `get` functions #73

    * Added more gets, removed version # from print  #73

    The version number in `ez_template_print` was redundant when version can be checked through pros cli.

    * ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

    * Memory optimisation and comments:
    when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

    * Maybe I was wrong

    * add new website code

    * added running the site locally

    * kernel upgrade

    * Update Kernel/Okapi

    ---------

    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

    * Added Ability for user to reverse Drive in opcontrol (#80)

    * Update drive.hpp

    weird changes

    * Added Reversal to opcontrol driving

    * mistake deleting active break logic, added back

    * Removed old website, updated readme

    * Completed #82, fixed formatting

    * Cleaned relative turns, added wide swings #59 #83

    * Added slew to turns and swings, fixed wide arc bug #59 #83 #84

    Backwards right arcs would have the left PID go the wrong direction.

    * #49 #59 #65 #84

    All functions that have a parameter using okapi units has the ability to be called without using okapi units.

    Fixed relative bug that would stop a swing from working off of a turn

    Naming convention was fixed on setting constants.

    Forward and Reverse PID for swings was implemented.

    * namespaced all classes, removed piston group. #50 #54

    * Added PID Tuner #85

    * PID Tuner can modify increments #85 #86 #87

    PID Tuner:
    - printing to brain can now be toggled
    - won't enable autonselector if it wasn't on prior to enabling PID Tuner
    - user can set all increments
    - user can get all increments
    - renamed functions to be compliant with #65

    Completed #86 and #87

    * Cleaned example files

    * Added example project to this repo and made v3 template

    * Final update for 3.0.0 #65

    ---------

    Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
    Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
    Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
    Co-authored-by: Will Xu <xu.z.william@gmail.com>
    Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>
Unionjackjz1 added a commit that referenced this issue Apr 2, 2024
* v3.0.0 (#88)

* Fixed rotation sensor tick per rev (#47)

* middle step for #49 and #54

* Added piston groups (#54)

* Completed small issues (#56, #55, $54, #52, #48)

* Finished with clean up on constants

* Added set ratio function

* Added practice mode

* Updated PROS Kernel, okapi, fixed #53, general cleaning

* ✨Okapi units (#49, #62)

* ✨ Added `set_relative_turn_pid()` (#59)

* issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

* issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

* Fixed issue #67

* ✨Okapi units

* New function names #65

* Added okapi units to turns and time, tuned PID, cleaned code, completed #66

* Fixed some names, added `get` functions #73

* Added more gets, removed version # from print  #73

The version number in `ez_template_print` was redundant when version can be checked through pros cli.

* ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

* Memory optimisation and comments:
when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

* Maybe I was wrong

* add new website code

* added running the site locally

* kernel upgrade

* Update Kernel/Okapi

---------

Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

* Added Ability for user to reverse Drive in opcontrol (#80)

* Update drive.hpp

weird changes

* Added Reversal to opcontrol driving

* mistake deleting active break logic, added back

* Removed old website, updated readme

* Completed #82, fixed formatting

* Cleaned relative turns, added wide swings #59 #83

* Added slew to turns and swings, fixed wide arc bug #59 #83 #84

Backwards right arcs would have the left PID go the wrong direction.

* #49 #59 #65 #84

All functions that have a parameter using okapi units has the ability to be called without using okapi units.

Fixed relative bug that would stop a swing from working off of a turn

Naming convention was fixed on setting constants.

Forward and Reverse PID for swings was implemented.

* namespaced all classes, removed piston group. #50 #54

* Added PID Tuner #85

* PID Tuner can modify increments #85 #86 #87

PID Tuner:
- printing to brain can now be toggled
- won't enable autonselector if it wasn't on prior to enabling PID Tuner
- user can set all increments
- user can get all increments
- renamed functions to be compliant with #65

Completed #86 and #87

* Cleaned example files

* Added example project to this repo and made v3 template

* Final update for 3.0.0 #65

---------

Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
Co-authored-by: Will Xu <xu.z.william@gmail.com>
Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>

* Removed 2.x files

* 3.0.1

* Revert "3.0.1"

This reverts commit f0f633d.

---------

Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
Co-authored-by: Will Xu <xu.z.william@gmail.com>
Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>
Unionjackjz1 added a commit that referenced this issue Apr 2, 2024
* Squashed commit of the following:

commit 600bc47
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:53:53 2024 -0800

    Removed 2.x files

commit 6f6c701
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:45:42 2024 -0800

    v3.0.0 (#88)

    * Fixed rotation sensor tick per rev (#47)

    * middle step for #49 and #54

    * Added piston groups (#54)

    * Completed small issues (#56, #55, $54, #52, #48)

    * Finished with clean up on constants

    * Added set ratio function

    * Added practice mode

    * Updated PROS Kernel, okapi, fixed #53, general cleaning

    * ✨Okapi units (#49, #62)

    * ✨ Added `set_relative_turn_pid()` (#59)

    * issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

    * issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

    * Fixed issue #67

    * ✨Okapi units

    * New function names #65

    * Added okapi units to turns and time, tuned PID, cleaned code, completed #66

    * Fixed some names, added `get` functions #73

    * Added more gets, removed version # from print  #73

    The version number in `ez_template_print` was redundant when version can be checked through pros cli.

    * ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

    * Memory optimisation and comments:
    when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

    * Maybe I was wrong

    * add new website code

    * added running the site locally

    * kernel upgrade

    * Update Kernel/Okapi

    ---------

    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

    * Added Ability for user to reverse Drive in opcontrol (#80)

    * Update drive.hpp

    weird changes

    * Added Reversal to opcontrol driving

    * mistake deleting active break logic, added back

    * Removed old website, updated readme

    * Completed #82, fixed formatting

    * Cleaned relative turns, added wide swings #59 #83

    * Added slew to turns and swings, fixed wide arc bug #59 #83 #84

    Backwards right arcs would have the left PID go the wrong direction.

    * #49 #59 #65 #84

    All functions that have a parameter using okapi units has the ability to be called without using okapi units.

    Fixed relative bug that would stop a swing from working off of a turn

    Naming convention was fixed on setting constants.

    Forward and Reverse PID for swings was implemented.

    * namespaced all classes, removed piston group. #50 #54

    * Added PID Tuner #85

    * PID Tuner can modify increments #85 #86 #87

    PID Tuner:
    - printing to brain can now be toggled
    - won't enable autonselector if it wasn't on prior to enabling PID Tuner
    - user can set all increments
    - user can get all increments
    - renamed functions to be compliant with #65

    Completed #86 and #87

    * Cleaned example files

    * Added example project to this repo and made v3 template

    * Final update for 3.0.0 #65

    ---------

    Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
    Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
    Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
    Co-authored-by: Will Xu <xu.z.william@gmail.com>
    Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>

* Fixed small bugs, refactoring #89, #90, #91, #92)

* Fixed typo in comment, updated readme

* Upgraded kernel, ready for v3.0.1 release
Unionjackjz1 added a commit that referenced this issue Apr 2, 2024
* Fixed rotation sensor tick per rev (#47)

* middle step for #49 and #54

* Added piston groups (#54)

* Completed small issues (#56, #55, $54, #52, #48)

* Finished with clean up on constants

* Added set ratio function

* Added practice mode

* Updated PROS Kernel, okapi, fixed #53, general cleaning

* ✨Okapi units (#49, #62)

* ✨ Added `set_relative_turn_pid()` (#59)

* issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

* issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

* Fixed issue #67

* ✨Okapi units

* New function names #65

* Added okapi units to turns and time, tuned PID, cleaned code, completed #66

* Fixed some names, added `get` functions #73

* Added more gets, removed version # from print  #73

The version number in `ez_template_print` was redundant when version can be checked through pros cli.

* ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

* Memory optimisation and comments:
when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

* Maybe I was wrong

* add new website code

* added running the site locally

* kernel upgrade

* Update Kernel/Okapi

---------

Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

* Added Ability for user to reverse Drive in opcontrol (#80)

* Update drive.hpp

weird changes

* Added Reversal to opcontrol driving

* mistake deleting active break logic, added back

* Removed old website, updated readme

* Completed #82, fixed formatting

* Cleaned relative turns, added wide swings #59 #83

* Added slew to turns and swings, fixed wide arc bug #59 #83 #84

Backwards right arcs would have the left PID go the wrong direction.

* #49 #59 #65 #84

All functions that have a parameter using okapi units has the ability to be called without using okapi units.

Fixed relative bug that would stop a swing from working off of a turn

Naming convention was fixed on setting constants.

Forward and Reverse PID for swings was implemented.

* namespaced all classes, removed piston group. #50 #54

* Added PID Tuner #85

* PID Tuner can modify increments #85 #86 #87

PID Tuner:
- printing to brain can now be toggled
- won't enable autonselector if it wasn't on prior to enabling PID Tuner
- user can set all increments
- user can get all increments
- renamed functions to be compliant with #65

Completed #86 and #87

* Cleaned example files

* Added example project to this repo and made v3 template

* Final update for 3.0.0 #65

* Squashed commit of the following:

commit 600bc47
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:53:53 2024 -0800

    Removed 2.x files

commit 6f6c701
Author: Jess Zarchi <jackfz01@gmail.com>
Date:   Sun Jan 28 23:45:42 2024 -0800

    v3.0.0 (#88)

    * Fixed rotation sensor tick per rev (#47)

    * middle step for #49 and #54

    * Added piston groups (#54)

    * Completed small issues (#56, #55, $54, #52, #48)

    * Finished with clean up on constants

    * Added set ratio function

    * Added practice mode

    * Updated PROS Kernel, okapi, fixed #53, general cleaning

    * ✨Okapi units (#49, #62)

    * ✨ Added `set_relative_turn_pid()` (#59)

    * issue #59 - add set_relative_turn_pid function, no issue - fix various cases of wrong function documentation

    * issue #59 - set_relative_turn_pid changed casing of variables to snake_case and made it relative to current target, not current heading

    * Fixed issue #67

    * ✨Okapi units

    * New function names #65

    * Added okapi units to turns and time, tuned PID, cleaned code, completed #66

    * Fixed some names, added `get` functions #73

    * Added more gets, removed version # from print  #73

    The version number in `ez_template_print` was redundant when version can be checked through pros cli.

    * ⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively  (#76)

    * Memory optimisation and comments:
    when a function is static, it doesn't need to exist for every object. Since this function does not reference any internal variables, it can be static

    * Maybe I was wrong

    * add new website code

    * added running the site locally

    * kernel upgrade

    * Update Kernel/Okapi

    ---------

    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>

    * Added Ability for user to reverse Drive in opcontrol (#80)

    * Update drive.hpp

    weird changes

    * Added Reversal to opcontrol driving

    * mistake deleting active break logic, added back

    * Removed old website, updated readme

    * Completed #82, fixed formatting

    * Cleaned relative turns, added wide swings #59 #83

    * Added slew to turns and swings, fixed wide arc bug #59 #83 #84

    Backwards right arcs would have the left PID go the wrong direction.

    * #49 #59 #65 #84

    All functions that have a parameter using okapi units has the ability to be called without using okapi units.

    Fixed relative bug that would stop a swing from working off of a turn

    Naming convention was fixed on setting constants.

    Forward and Reverse PID for swings was implemented.

    * namespaced all classes, removed piston group. #50 #54

    * Added PID Tuner #85

    * PID Tuner can modify increments #85 #86 #87

    PID Tuner:
    - printing to brain can now be toggled
    - won't enable autonselector if it wasn't on prior to enabling PID Tuner
    - user can set all increments
    - user can get all increments
    - renamed functions to be compliant with #65

    Completed #86 and #87

    * Cleaned example files

    * Added example project to this repo and made v3 template

    * Final update for 3.0.0 #65

    ---------

    Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
    Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
    Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
    Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
    Co-authored-by: Asik007 <yugioh705@gmail.com>
    Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
    Co-authored-by: Will Xu <xu.z.william@gmail.com>
    Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>

* Fixed small bugs, refactoring #89, #90, #91, #92)

* Fixed typo in comment, updated readme

* Upgraded kernel, ready for v3.0.1 release

---------

Co-authored-by: HakopZarikyan <39071041+HakopZ@users.noreply.github.com>
Co-authored-by: Michael Ben-Zvi <michael@trade29.com>
Co-authored-by: Will Xu <54247087+WillXuCodes@users.noreply.github.com>
Co-authored-by: Michael Barr <61331006+fishsticks89@users.noreply.github.com>
Co-authored-by: Asik007 <yugioh705@gmail.com>
Co-authored-by: Sylvie <54775775+SylvieMayer@users.noreply.github.com>
Co-authored-by: Will Xu <xu.z.william@gmail.com>
Co-authored-by: Mactar Gueye <64631549+Mactar1233@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant