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

servo360 - ActivityBots with similarly asymmetric zero speed deadband servos not meeting navigation goals #144

Open AndyLindsay opened 6 years ago

AndyLindsay commented 6 years ago

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:

AndyLindsay commented 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();
}
AndyLindsay commented 6 years ago

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

AndyLindsay commented 6 years ago

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.