Issue with using ProfiledPIDSubsystem

Hello everyone. I am new to command based programming, and have recently been attempting to code our elevator pivot, via use of a ProfiledPIDSubsystem. When we press the configured button initially, it goes to it’s position just fine. However, when we press the same button again, it goes at full speed straight up, causing the motor to stall and bend our shaft. Any reason as to why? I’m a little lost. Heres our code for better reference:

EDIT: Additionally, since its another semi issue I wanna get out the way, how would I go above converting the pulses of the NEO into meters?

You’re setting the goal to null when b is pressed. Does that code even compile?

Yes it does. That’s just a placeholder for now, i dont expect it go anywhere. The main issue is with the x() bounded portion

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.