Skip to content

Commit

Permalink
abdrive360/servo360 - try EEPROM calibration / transfer function adju…
Browse files Browse the repository at this point in the history
…sting functions #151

Implements calibration.  ActivityBot example programs for calibration and displaying calibration settings and results ported to ActivityBot360.
  • Loading branch information
AndyLindsay committed Oct 10, 2017
1 parent f3fe072 commit e81d7bb
Show file tree
Hide file tree
Showing 25 changed files with 3,347 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
ActivityBot Display Calibration Results.c
Display interpolation table values from calibration
http://learn.parallax.com/activitybot/calibrate-your-activitybot
*/

#include "simpletools.h"
#include "servo360.h"
#include "abcalibrate360.h"

int main()
{
cal_displayResults();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ActivitiyBot Display Calibration Results.c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-fno-exceptions
>defs::-std=c99
>-lm
>BOARD::ACTIVITYBOARD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
ActivityBot Display Calibration.c
Display interpolation table values from calibration
http://learn.parallax.com/activitybot/calibrate-your-activitybot
*/

#include "simpletools.h"
#include "servo360.h"
#include "abcalibrate360.h"

int main()
{
cal_displayData();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ActivitiyBot Display Calibration.c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-fno-exceptions
>defs::-std=c99
>-lm
>BOARD::ACTIVITYBOARD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
ActivityBot Calibrate.c
Calibrate the ActivityBot's servos and encoders
http://learn.parallax.com/activitybot/calibrate-your-activitybot
*/

#include "simpletools.h"
#include "servo360.h"
#include "abcalibrate360.h"

int main()
{
cal_servoPins(12, 13);
cal_encoderPins(14, 15);

high(26);
high(27);
cal_activityBot();
low(26);
low(27);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ActivityBot Calibrate.c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-fno-exceptions
>defs::-std=c99
>-lm
>BOARD::ACTIVITYBOARD
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
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_VM_CCW, 202);
servo360_setTransferFunction(12, S360_SETTING_VB_CCW, 280);
servo360_setTransferFunction(12, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(12, S360_SETTING_VB_CW, -126 );
servo360_setTransferFunction(13, S360_SETTING_VM_CCW, 204 );
servo360_setTransferFunction(13, S360_SETTING_VB_CCW, 273);
servo360_setTransferFunction(13, S360_SETTING_VM_CW, 214);
servo360_setTransferFunction(13, S360_SETTING_VB_CW, -146);
*/


servo360_setTransferFunction(12, S360_SETTING_VM_CCW, 204);
servo360_setTransferFunction(12, S360_SETTING_VB_CCW, 273);

servo360_setTransferFunction(12, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(12, S360_SETTING_VB_CW, -133 );

servo360_setTransferFunction(13, S360_SETTING_VM_CCW, 204 );
servo360_setTransferFunction(13, S360_SETTING_VB_CCW, 253);

servo360_setTransferFunction(13, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(13, S360_SETTING_VB_CW, -146);


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();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
drive_goto variations (6).c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-fno-exceptions
>defs::-std=c99
>-lm
>BOARD::ACTIVITYBOARD
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
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_VM_CCW, 202);
servo360_setTransferFunction(12, S360_SETTING_VB_CCW, 280);
servo360_setTransferFunction(12, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(12, S360_SETTING_VB_CW, -126 );
servo360_setTransferFunction(13, S360_SETTING_VM_CCW, 204 );
servo360_setTransferFunction(13, S360_SETTING_VB_CCW, 273);
servo360_setTransferFunction(13, S360_SETTING_VM_CW, 214);
servo360_setTransferFunction(13, S360_SETTING_VB_CW, -146);
*/

/*
servo360_setTransferFunction(12, S360_SETTING_VM_CCW, 204);
servo360_setTransferFunction(12, S360_SETTING_VB_CCW, 273);
servo360_setTransferFunction(12, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(12, S360_SETTING_VB_CW, -133 );
servo360_setTransferFunction(13, S360_SETTING_VM_CCW, 204 );
servo360_setTransferFunction(13, S360_SETTING_VB_CCW, 253);
servo360_setTransferFunction(13, S360_SETTING_VM_CW, 215);
servo360_setTransferFunction(13, S360_SETTING_VB_CW, -146);
*/

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();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
drive_goto variations (7).c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-fno-exceptions
>defs::-std=c99
>-lm
>BOARD::ACTIVITYBOARD
Loading

0 comments on commit e81d7bb

Please sign in to comment.