Monday, May 23, 2022

Serial problems

 So last time I left the robot, I was able to control it with a keyboard, but it had issues stopping.


Today I revisited the issue. 

I started by Tuning the PID controller on the Arduino, that proved really unproductive, so I started wondering if this is a "garbage in=garbage out" problem. The lowpass filter I got from Curiores (https://gist.github.com/curiores), wasnt performing the way I wanted, do I found another signal filtering library by Martin Bloedorn (https://github.com/MartinBloedorn/libFilter) which seemed to work a lot better. Probably because its a higher order filter.

I also noticed that my the battery voltage dropped quickly and determined how well the PID worked. So I might need a more reliable battery source than just 12 NiMH batteries. 

I also bought a kinect recently for 20$ in hopes of putting it on the robot to do fancy visualizations. It will also require 12 volts, so I'll need to share the power between the motors and the kinect.

Note to self: to start the kinematics node do

rosrun Kinematics kinematics.py

its a capital K

So after I filtered the signal and started all the nodes on the pi, I was able to drive it with the keyboard and have it stop, however there is still some funky business going on.

  • The robot really likes to turn. In fact it likes it so much that it doesn't stop turning.
  • Sometimes it won't obey the commands, as if it read commands from somewhere else. 
  • The wheels behave independently of each other.

The serial node only works at 57600Hz, even though the arduino is supposed to be running at 230400Hz. When I was testing on the Arduino alone none of this seemed to be happening, so I think the issue lies in the serial interface, so the next step is to configure some logging. Or I could just wing it and try to get the robot to follow a path. Or just give up on the velocity aspect and only tune for position.



No comments:

Post a Comment

NEW Project Autonomous underwater vehicle!

  I have been more and more interested in Autonomous Underwater Vehicles and ocean exploration. I live on the coast with direct access to th...