Elevator Motor Stalling

Hello, all!

My team is using an elevator mechanism this year and we’re finally begun testing it with real code. It’s moving, but once it gets to the height we ask of it, the motors start squealing. Here is our code, for reference. We keep increasing our KP and it’s barely making a difference. We’re using Falcon 500s for our elevator with Motion Magic Voltage control. We control the motor (Kraken x60) that our shooter pivots on with Motion Magic Voltage as well, the primary difference being that we use the arm gravity type (cosine) instead of elevator (static), and our angle motor doesn’t squeal. Does anyone have any ideas about how to solve this or at least what direction to go in? Thank you.

A few questions

  1. Is there a hard stop at the top of your elevator where the motors are stalling? If so, the problem is most likely that your motors are still trying to run once they reach that hard stop
  2. Are the amp limits on your elevator motors set correctly?
  3. Is there a lot of mechanical resistance in any spot in the elevator motion (specifically the spot the motors are stalling at)? This might make the motors take more power to run making them stall easier
  1. There’s a stop in the code at the top, but no physical stop. We aren’t commanding it to the top right now, anyway
  2. We have current limits set to 40. I just realized that we don’t ever apply know - I just made that change in the code. I’m not sure if it’ll do anything, though
  3. The motors stall regardless of the height we command it to (we did multiple height tests yesterday). I don’t see any mechanical resistance at any point in the elevator

We got it to finally stop squealing. I’ll document what happened here in case it helps anyone else. So we’re controlling our elevator with a leader-follower system, and we discovered that the follower motor wasn’t doing anything. Turns out, the follower motor’s control type kept getting set to Duty Cycle Out instead of Motion Magic Voltage. After a call with CTRE, we learned that because in our function to stop the elevator motors we were stopping both the leader and follower motors (which was called in disabledInit(), thus being called after the constructor) using .set(), it caused the control type of our follower motor to revert to not following the leader motor. Once we fixed that, it stopped squealing and it moves much faster (probably because two motors are raising the elevator, not just one, who would guess).