One of the most difficult elements of this project to get right has been the PID loop to keep the vehicle tracking straight. Without it the vehicle can easily veer off course. I think the process of tuning the parameters took several years off of my life.
The first part was getting information about what the angle between the front and the back. I started out by creating a sensor using a ratiometric hall effect sensor and neodymium magnets.
This worked pretty well, but it was an incredible hard to set up. The output was very non-linear, and in the end I had to create a complete lookup table for all of the potential values. This was an incredibly cheap way to get absolute position feedback. It cost less than two dollars. As a long term solution it doesn't really work with what I am trying to accomplish because it would be really hard for someone to set up if they didn't know what they were doing. I also had to rebuild the center pivot which means I had to remove the sensor.
I then used a normal 10k pot. It worked for a while, but wasn't rugged enough and it failed. Unfortunately I didn't have any spares. I gutted a servo motor and used it as a pot. This has worked quite well so far.
I use this measurement to as the input of the PID loop. The setpoint comes from reading the joystick on the wii nunchuck. The output controls the turn parameter of the sabertooth controller.
Tuning this loop was pretty scary. There is a lot of power in these motors. When the parameters were out of wack it has a tendency to turn violently, There are some good dents in a couple of places from the sudden stops.
Now it is running pretty well, but I will try and tune it for a bit stronger response in the future.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.