I am trying to debug why my smart motion control loop on the 1.40 firmware is acting strangely. Is anyone else experiences a regression issue with this version (I’m upgrading from 1.1.9)?
I am trying to determine if it is a code error on my part (whether or not something has changed with the release that I am not aware of with regards to how smart motion works), or whether or not the update has a regression issue (which is probably not the case…).
Some background information: It is an elevator with two motors. I have set the arbitrary ff to the percent output required to hold the elevator. As it approaches a setpoint that I have, it is almost like it never reaches the deceleration period of the trapezoid, then last-minute tries to correct, like a lag spike almost. Then, it overshoots massively and eventually oscillates near the target setpoint. I am only really using f (
setFF in code) right now on the PID controller (tested by running at different speeds then measuring velocity). I am using unit conversions to inches. Setpoints are negative since the way the elevator was wired up. Things I have considered:
- I gain somehow that causes it to overshoot? I set it to zero though
- Velocity/position conversion is causing problems?
- Maybe negative setpoints don’t work well?
- Loop overruns on the RIO, but this shouldn’t affect control loop on spark?
- Closed-loop ramping set accidentally? I also set to zero
- Firmware regression?
- Output range set improperly, but I set it to -1 to 1
setReferenceis called every update. I thought this was okay?
- Closed-loop error is set to zero
- Arb feed-forward is set wrong?
- Parameter mismatch between slave and master?
For now, I am writing a separate code in a new project that has only spark commands. This could maybe affirm the loop overrun problems? Main code sits at 90% CPU usage and has some garbage spikes.
Any help/insight is appreciated,