@mvas the program doesn’t work. I doesn’t even go forward. I don’t know what is wrong with it.
That is a very vague description…
I’ve given you more than enough info to get it working. You’re gonna need to debug on your own (not to sound harsh but my goal was to teach you how PID works in the context of Vex, my job isn’t to go line by line looking for small syntax errors). Make sure you’re printing to the terminal and strategically put print lines in different parts of the function to ensure it’s properly executing. Also, ensure the data is what you expect it to be.
If you really get stuck, send over your updated PID function one last time and I’ll look over it one more time.
I’m sorry lol. It literally just doesn’t move.
Yep, I get it. I have taken all of your advice and used it appropriately. I’ll just keep fiddling with it until it works. Thank you
Increase your gains and set ki and kd to 0 –– just a heads up. I probably should’ve mentioned you should always start with a high-value forkp and work down from there. Make sure your motors are receiving power to and the function is actually executing.
That’s the problem. I set kp to 0.9 and the others to 0. The motors don’t receive power.
Update: the motors go forward and stop, but they do not slow down at all toward the end. I have played with the constants and nothing works. The straight line assist also doesn’t work. It just does nothing.
Again these are all very vague descriptions of what you think is going on. You need to look at the data to make sure it’s what you expect it to be and provide that data here.
If you show me what the error looks like over time, what values the gyro is returning over time, and the final power output then I can help you. Print this to the terminal and show the results here (a screenshot would work fine cause it’s probably gonna be hundreds of lines of output).
Edit:
Another tuning tip, keep lowering kp until the robot barely reaches the target.
Were you able to figure out this issue? @squiddy_slapper