Skip to content

Commit

Permalink
servo360 - Disable serial monitor
Browse files Browse the repository at this point in the history
I forgot to comment the #define for this setting.  It more than doubles the amount of space the library takes.
  • Loading branch information
AndyLindsay committed Oct 4, 2017
1 parent 87c31eb commit dd6a8fa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
Binary file modified Learn/Simple Libraries/Motor/libservo360/cmm/libservo360.a
Binary file not shown.
6 changes: 6 additions & 0 deletions Learn/Simple Libraries/Motor/libservo360/servo360.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -609,6 +614,7 @@ void servo360_speedControl(int p)
}
else
{
_fs[p].accelerating = 0;
_fs[p].speedTarget = _fs[p].speedReq;
//speedUpdateFlag = 0;
}
Expand Down
9 changes: 8 additions & 1 deletion Learn/Simple Libraries/Motor/libservo360/servo360.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
*/


#define _servo360_monitor_



//#define _servo360_monitor_





#ifndef SERVO360_H
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.1
v1.4.3

0 comments on commit dd6a8fa

Please sign in to comment.