Spark Max not moving to position after change from % output

We have an elevator that we are driving with a spark max and neo. There are 2 different control modes: position or %output and we switch between the two modes on the fly.

We are running into an issue where after a while, seemingly randomly, position control just stops working when we transition from % output back to position. We can still move it with % output but position control stops doing anything and just sits there.

I’m not sure if the PID values are being cleared or what is happening but this appears to be some kind of firmware/library bug. As indicated everything works fine for a while but after a few minutes position control just stops working and power cycling robot restores expected functionality (for a short while).

There are no errors anywhere.

Send diagnostics to the dashboard/shuffleboard. Key items are: what mode is it in, what position does the robot think your elevator is at, and what it thinks the set point (if in position mode), and throttle position (definitely if you’re in % mode, but even better if you get the value from the PID output when in position mode). With these four items, you should be able to narrow the problem down to whether it is before, inside, or “below” your PID code.

What firmware version are you running on the SPARK MAX?

We use labview so i had real time monitoring of all the parameters/values and that’s how I came to this conclusion to begin with.
the position that it’s in is correct and updates as expected when we move it in % mode. the zero point is also correct and doesn’t change post initial zero after initial enable. The position being sent to it is also correct (but it doesn’t matter what we send it, it just seems to be ignored). There is only 2 nodes in the program that set a value to the motor and they are mutually exclusively run and monitoring the state I can confirm that the value and method being sent to the spark appears to be correct but when the position node is run it just doesn’t work.

What’s weird is that everything works perfectly for a while after a fresh boot just after a while it stops.

Not around robot today to get the details but I did fresh flash a week ago from today so whatever was on the website as latest firmware then.

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