Skip to content

Conversation

@Abigail-27
Copy link
Contributor

No description provided.

@Ishan1522
Copy link
Member

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));
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

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..

Copy link
Member

@Ishan1522 Ishan1522 Oct 15, 2025

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

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

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

why was this doubled

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Also, you doubled acceleration
image
Why?

Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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

@Abigail-27 Abigail-27 merged commit 086b90e into main Nov 1, 2025
3 of 4 checks passed
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