Open AndyLindsay opened 6 years ago
/*
drive_goto variations.c
This code demonstrates the problem in ActivityBots with servos that both have
the similar zero speed deadband offsets near the allowable limits. Example
instead of 1480 to 1520, both servos hare 1490 to 1530 us zero speed deadbands.
The monitor (with SimpleIDE Terminal) functions have no effect unless you build
the libservo360 project with this un-commented:
#define _servo360_monitor_
For best results, use the Parallax WX ESP8266 WiFi Module - DIP for programming
and terminal display.
https://www.parallax.com/product/32420d
Make sure to re-comment it when done because it takes a signfiicant program memory.
*/
#include "simpletools.h"
#include "abdrive360.h"
int main()
{
drive_speed(0, 0);
pause(1000);
servo360_monitorRun();
pause(1000);
drive_goto(192, 192);
pause(1000);
drive_goto(-28, 28);
pause(1000);
drive_goto(28 * 2, -28 * 2);
pause(1000);
drive_goto(-28, 28);
pause(1000);
drive_goto(-192, -192);
pause(1000);
drive_goto(128, 192);
pause(1000);
drive_goto(-128, -192);
pause(1000);
drive_goto(192, 128);
pause(1000);
drive_goto(-192, -128);
pause(1000);
servo360_monitorEnd();
}
The same sign, larger pv values on both servos between maneuvers (csop: 2) translates into one wheel being too far forward and the other being too far behind. ActivityBot with asymetric zero speed offset servos .txt
Note that with servos that don't have the offset, the problem isn't so obvious. ActivityBot with non-zero speed offset servos .txt
Setting transfer function deadband limits at 2/3 motion start/stop edges results in some correction. This might change a less muted m is used in the transfer function. It currently uses 180, but the actual 250 in combo with something like 1/2 motion start/stop edges might turn out to work well. more testing is needed.
Put two servos with the same asymmetric -10 + 30 us deadband on a robot, and:
Control system settings aggressive enough to correct this seem to cause unstable behavior, so some other approaches to correct this should be investigated: