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

Controls Tutorial for Motion Profiling #2589

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

gerth2
Copy link
Contributor

@gerth2 gerth2 commented Mar 1, 2024

Using vertical elevator as the driving example for now

Entering draft PR for comments.

Will update as functionality is added

@gerth2
Copy link
Contributor Author

gerth2 commented Mar 8, 2024

Question for the group.

TrapezoidProfile from wpimath (or something similar) is needed to complete this PR.

Two options for how to generate it without blowing up scope:

  1. rewrite by hand in .js
  2. Use something like https://www.codeconvert.ai/app to auto-convert with some fixup.

AI code ownership can be fraught in a corporate context, but I'm not sure how much that applies in open source. Thoughts on the risk before we move forward with 2 over 1? I'm fine with either.

Note, as mentioned in the past, a nifty thing would be a webasm build of wpimath that we build these sims around. But that's still a longer lead-time item.

@gerth2 gerth2 marked this pull request as ready for review March 8, 2024 05:24
@sciencewhiz
Copy link
Collaborator

Two options for how to generate it without blowing up scope:

1. rewrite by hand in .js

2. Use something like https://www.codeconvert.ai/app to auto-convert with some fixup.

Or #1831

@gerth2
Copy link
Contributor Author

gerth2 commented Oct 8, 2024

In an attempt to not let this rot too much...

If 1831 doesn't have line of sight to get solved prior to 2025 season, would going back on the initial two options be acceptable?

@gerth2 gerth2 force-pushed the gerth2_elevator_motion_profiling branch from 3a2becc to 49d309c Compare December 19, 2024 18:54
@gerth2 gerth2 force-pushed the gerth2_elevator_motion_profiling branch from 49d309c to f1c2556 Compare December 19, 2024 20:37
@gerth2
Copy link
Contributor Author

gerth2 commented Dec 19, 2024

rewritten sans AI.

const gravityAcceleration = -this.kGVolts / this.kAVoltSecondSquaredPerM;
const EMFAcceleration = -this.kVVoltSecondPerM * velMPerS / this.kAVoltSecondSquaredPerM;
const controlEffortAcceleration = inputVolts / this.kAVoltSecondSquaredPerM;
const airResistanceAccel = -1.0 * Math.sign(velMPerS) * Math.pow(velMPerS, 2) * 0.2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the air resistance contribution appropriately scaled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants