parallaxinc / Simple-Libraries

Contents of the SimpleIDE workspace folder and its Parallax Learn Simple Libraries subfolder.
http://learn.parallax.com/propeller-c-set-simpleide/update-your-learn-folder
21 stars 21 forks source link

Occasional 2 tick error #81

Open AndyLindsay opened 7 years ago

AndyLindsay commented 7 years ago

This sequence sometimes finishes 2 ticks from where it started.

drive_goto(128, 128); drive_goto(26, -26); drive_goto(-52, 52); drive_goto(26, -26); drive_goto(-128, -128); drive_goto(128, 192); drive_goto(-128, -192); drive_goto(192, 128); drive_goto(-192, -128);

AndyLindsay commented 7 years ago

Running hypothesis: Vibrations with two wheels correcting for distance and speed results in occasional robot momentum shifts and wheel backlashs. When the wheel goes back to it's previous state briefly and then forward again, the processor cannot know that it was actually -1 + 1 encoder increments because the system uses a single beam encoder. So, the control system code treats it as two increments in the direction the that it pulses the servos at that moment. It might be possible to determine a time signature for this and filter it out.