I’ve been trying to get SysId to work for a little while now and every time I run the SysId routine and put the log into SysId, I get an error about trimming removing too much data from the quasistatic test. I dug around in the log file and found that voltage is being reported as 0 V every time it’s logged.
Voltage is calculated by CANSparkMax().get() * RobotController.getBatteryVoltage(). I assume this is to calculate the voltage applied to the motor.
I put the motor speed in SmartDashboard and began to run the SysId routine and the motor speed stayed at 0 when the robot was clearly moving. It seems like m_LeftFrontMotor.get() doesn’t return anything other than 0, which leads to 0 volts being reported and SysId not solving for the feedforward values.
I’ll put a link to my code below, but I forgot to commit my changes to the SysId code today, so I’ll update with the new code on Monday. None of the changes I made today should have effected the reported voltage, other than putting it on SmartDashboard.
I copied the WPILib SysId example, and changed it to match our setup. If the issue is what I think, PWMSparkMax().get() and CANSparkMax().get() don’t behave in the same way or .get() has no effect when you set the voltage instead of the output percentage.
Any ideas on how to get the correct voltage logged would be appreciated. I don’t have access to the shop until Monday, so any testing will have to wait until then.
Should I try to roll everything back to the 2023 versions? RIO, DriverStation, SPARK max motor controllers, vendor libraries, etc. and run SysId from there? At that point, I think I would have to use the 2023 SysId tool since I doubt the 2024 code for SysId would work with a RIO being on a different year.
We have a week 1 even so I’m not sure if waiting for a new REV software version is possible. I’ll try to go through and make sure everything has the most recent firmware, maybe they fixed it and my team just hasn’t updated yet.
The WPILib example project uses PWMSparkMax. Would connecting our motor controllers over PWM solve this issue?
Thanks for the help everyone! Looks like your solution fixed the issue I was having @superpenguin612.
I still need to play with SysId some more. The gains I got seem to be making it worse, so I may need to change the test setup a little bit but I probably won’t work on it for a few days.
It’s probably for another topic, but we got a lot of warning/error messages about motor safety. Not sure why that is though.