Open AndyLindsay opened 6 years ago
Well, "Increasing", not so much. It only causes oscillations when the ActivityBot is supposed to be at rest.
However, picking S360_SETTING_VB_CCW and S360_SETTING_VB_CW relative to the motion start/stop thresholds has significant potential.
This commit to the Dev branch supports adjusting the "start moving" thresholds:
Defaults for y = mx + b calculations to determine transfer fuction from a requested speed that has converted to 4069ths of a rotation per second:
Constants for adjusting the CCW and CW m and b in the transfer function's y = mx + b:
Function for adjusting start pulse duration:
int servo360_setTransferFunction(int pin, int constant, int value);
Here is an example that corrected servos tested to start moving CW between 1480 and 1490 us and CCW 1530 and 140 us.
/*
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);
servo360_setTransferFunction(12, S360_SETTING_VB_CCW, 250);
servo360_setTransferFunction(12, S360_SETTING_VB_CW, -75);
servo360_setTransferFunction(13, S360_SETTING_VB_CCW, 250 );
servo360_setTransferFunction(13, S360_SETTING_VB_CW, -75);
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();
}
Might alleviate swerves at start in: servo360 - ActivityBots with similarly asymmetric zero speed deadband not meeting navigation goals