-
Notifications
You must be signed in to change notification settings - Fork 0
ishan puh lease tell me wtf is wrong with this #171
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
Conversation
|
how is the hardstop() method used in the code? Is it used? |
| if (leaderPosition.getValueAsDouble() == 0) { | ||
| leaderMotor.setControl(mmPositionRequest.withPosition(-0.1)); | ||
| if (leaderStatorCurrent.getValueAsDouble() > ElevatorConstants.STATOR_CURRENT_THRESHOLD) { | ||
| leaderMotor.setControl(mmPositionRequest.withPosition(0.001)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think setting the control to move the elevator up a bit is a little dangerous. I think you may want to consider resetting the position to the bottom of the elevator when it reaches that point. So it should only work when the elevator is moving down and the stator current is continuing to be high. This is because if the elevator is all the way up or gets caught on something, the stator current will also increase.
So the safest way to do this would probably be to reset to the bottom position when the stator current has been increased and it's moving downward.
You should also have an override to this on a button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also comment this cuz people are gonna read ts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do i say if its going downward? Like if its approaching 0? And how do i word/structure that? Also ik abt the override as far as the subsystem interfacing but r u saying u want it as a physical button as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you need a physical button to override the hardstop. It's not override in the interface sense. It's like actually telling the robot, do NOT use the hardstop when this button is pressed. You can also make it toggleable, so one press turns it off, the next turns it on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To tell if it's going downward just check if the position is decreasing over a certain interval. Off the top of my head, I think you could create like a list or smthn of your elevator positions, store them up, kind of like how we do for vision and stuff, and keep a certain amount of positions for a specific window of time. If the trend is decreasing then it's going downward.
Lowkey that's hella complicated so like ask chat. it's also 1:30 AM..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what 6328 does https://github.com/Mechanical-Advantage/RobotCode2025Public/blob/main/src/main/java/org/littletonrobotics/frc2025/subsystems/superstructure/elevator/Elevator.java#L353 It's simpler than what I said and their code def works. Check it out. I'll look through other example later maybe perchance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kk
| public static final boolean SIMULATE_GRAVITY = true; | ||
|
|
||
| public static final double STATOR_CURRENT_LIMIT = 100; // 100 | ||
| public static final double STATOR_CURRENT_LIMIT = 200; // 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this doubled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When limits were enabled i forgot to turn them off and i wasnt sure how high the threshold was gonna be so i was gonna tune it and i wanted there to be a negligible existing limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok... but why is it doubled. Like what's the point of a threshold if you're going to make the existing limit negligible? At that point the threshold becomes the actual limit, but with a delay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill revert the limit 😔 i HALVED the acceleration cuz the elevator was too fast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see ur right
but how was the elevator too fast? ...Ig u slowed it down for testing which is chill
| public static final double STATOR_CURRENT_LIMIT = 100; // 100 | ||
| public static final double STATOR_CURRENT_LIMIT = 200; // 100 | ||
| public static final double SUPPLY_CURRENT_LIMIT = 0; | ||
| public static final double STATOR_CURRENT_THRESHOLD = 10000000; // will tune later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make the constant name a little more descriptive. Is this for the hard stop? Or just stator current in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its for the hard stop lol ill add comments and adjust names tmr

No description provided.