Skip to content

Commit

Permalink
demo branch updates 1.4.1 and 1.4.1.3
Browse files Browse the repository at this point in the history
1.4.1
Fix enable warning
enable function was commented in servo360.h and causing compiler warnings when called.

1.4.3
servo360 - Disable serial monitor
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 1b28d23 commit 5578627
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 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
11 changes: 9 additions & 2 deletions 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 @@ -162,7 +168,7 @@ int servo360_couple(int pinA, int pinB);
int servo360_setCoupleScale(int pinA, int pinB, int scale);


// int servo360_enable(int pin, int state);
int servo360_enable(int pin, int state);

/* Private */
void servo360_run(void);
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.0
v1.4.3

0 comments on commit 5578627

Please sign in to comment.