diff --git a/Learn/Simple Libraries/Motor/libservo360/cmm/libservo360.a b/Learn/Simple Libraries/Motor/libservo360/cmm/libservo360.a index ab5cf292..cff7fa29 100644 Binary files a/Learn/Simple Libraries/Motor/libservo360/cmm/libservo360.a and b/Learn/Simple Libraries/Motor/libservo360/cmm/libservo360.a differ diff --git a/Learn/Simple Libraries/Motor/libservo360/servo360.c b/Learn/Simple Libraries/Motor/libservo360/servo360.c index 94c91717..1d629cca 100644 --- a/Learn/Simple Libraries/Motor/libservo360/servo360.c +++ b/Learn/Simple Libraries/Motor/libservo360/servo360.c @@ -121,6 +121,8 @@ void servo360_mainLoop() { int compensate = _fs[_fs[p].couple].lag - _fs[p].lag; compensate = _fs[p].coupleScale * compensate / S360_SCALE_DEN_COUPLE; + //if(_fs[p].accelerating || _fs[_fs[p].couple].accelerating) + // compensate *= 4; if(compensate > 500) compensate = 500; // Limits pulse deviation to 50 us @@ -131,6 +133,8 @@ void servo360_mainLoop() { int compensate = _fs[p].lag - _fs[_fs[p].couple].lag; compensate = _fs[p].coupleScale * compensate / S360_SCALE_DEN_COUPLE; + //if(_fs[p].accelerating || _fs[_fs[p].couple].accelerating) + // compensate *= 4; if(compensate > 500) compensate = 500; if(_fs[_fs[p].couple].speedOut > 0) _fs[_fs[p].couple].speedOut -= compensate; @@ -598,6 +602,7 @@ void servo360_speedControl(int p) { if( abs(speedDifference) > _fs[p].rampStep) { + _fs[p].accelerating = 1; if(speedDifference > 0) { _fs[p].speedTarget += _fs[p].rampStep; @@ -609,6 +614,7 @@ void servo360_speedControl(int p) } else { + _fs[p].accelerating = 0; _fs[p].speedTarget = _fs[p].speedReq; //speedUpdateFlag = 0; } diff --git a/Learn/Simple Libraries/Motor/libservo360/servo360.h b/Learn/Simple Libraries/Motor/libservo360/servo360.h index d06a1925..c7db9568 100644 --- a/Learn/Simple Libraries/Motor/libservo360/servo360.h +++ b/Learn/Simple Libraries/Motor/libservo360/servo360.h @@ -10,7 +10,13 @@ */ -#define _servo360_monitor_ + + + +//#define _servo360_monitor_ + + + #ifndef SERVO360_H @@ -290,6 +296,7 @@ typedef volatile struct servo360_s volatile int drive; volatile int stepDir; volatile int lag; + volatile int accelerating; // position control system volatile int Kp; diff --git a/Learn/Simple Libraries/Motor/libservo360/servo360_connect.c b/Learn/Simple Libraries/Motor/libservo360/servo360_connect.c index 2f70f506..eda4d5b3 100644 --- a/Learn/Simple Libraries/Motor/libservo360/servo360_connect.c +++ b/Learn/Simple Libraries/Motor/libservo360/servo360_connect.c @@ -93,6 +93,7 @@ int servo360_connect(int pinControl, int pinFeedback) _fs[p].couple = 0; _fs[p].coupleScale = 0; + _fs[p].accelerating = 0; _fs[p].feedback = 1; diff --git a/Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360/cmm/libabdrive360.a b/Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360/cmm/libabdrive360.a index 07f32bba..0ca2b0e8 100644 Binary files a/Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360/cmm/libabdrive360.a and b/Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360/cmm/libabdrive360.a differ diff --git a/version.txt b/version.txt index 66d62a80..92f76b42 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.4.1 +v1.4.3