|
@@ -45,8 +45,8 @@ class Atm_AccelStepper: public Machine {
|
|
|
long int homing_speed = 1000;
|
|
|
bool homingLow_done = 0 ;
|
|
|
bool homingHigh_done = 0 ;
|
|
|
- long int max_speed = 10000;
|
|
|
- long int acceleration = 1000;
|
|
|
+ long int max_speed = 1000;
|
|
|
+ long int acceleration = 100;
|
|
|
Atm_AccelStepper& setMaxSpeed( long int maxSpeed );
|
|
|
Atm_AccelStepper& setHomingSpeed( long int homingSpeed);
|
|
|
Atm_AccelStepper& setAcceleration( long int acc);
|
|
@@ -69,7 +69,7 @@ class Atm_AccelStepper: public Machine {
|
|
|
Atm_AccelStepper& pinReversed( bool directionInvert=false, bool stepInvert=false, bool enableInvert=false );
|
|
|
bool enabled ;
|
|
|
|
|
|
-
|
|
|
+ //limits public methods and variables
|
|
|
Atm_AccelStepper& limitLow_set(int mode = 0, int pin = -1, int reversed=0);
|
|
|
Atm_AccelStepper& limitLow_isHard(bool hardlimit = 1);
|
|
|
Atm_AccelStepper& limitLow_setThresholds (int threshold_low=510, int threshold_high = 1024);
|
|
@@ -91,7 +91,7 @@ class Atm_AccelStepper: public Machine {
|
|
|
int limitHigh_state_total = 0 ;
|
|
|
int limitHigh_buf_head ;
|
|
|
int limitHigh_avg(bool limitState);
|
|
|
- bool changed = 0 ;
|
|
|
+ bool changed = 0 ; //temp container to test if some value changed
|
|
|
|
|
|
private:
|
|
|
// ACTIONS
|
|
@@ -106,21 +106,26 @@ class Atm_AccelStepper: public Machine {
|
|
|
int event( int id );
|
|
|
void action( int id );
|
|
|
|
|
|
- void stepper_update(void);
|
|
|
|
|
|
+
|
|
|
+ //positionning private variables
|
|
|
long int _currentStep = 0;
|
|
|
long int _targetStep = 0;
|
|
|
- long int _maxStep ;
|
|
|
+ long int _maxStep = -1;
|
|
|
atm_timer_millis position_timer ;
|
|
|
int POSITION_SEND_TIMER = 50 ;
|
|
|
+ void stepper_update(void);
|
|
|
|
|
|
// bool _rotationReversed = 0 ;
|
|
|
|
|
|
+ //enable private variables
|
|
|
int _enablePin = -1;
|
|
|
bool _enableReversed = 0 ;
|
|
|
- atm_timer_millis idle_timer ;
|
|
|
- int IDLE_TIMEOUT_DURATION = 500000 ;
|
|
|
+ //enable timeout not implemented yet
|
|
|
+ // atm_timer_millis idle_timer ;
|
|
|
+ // int IDLE_TIMEOUT_DURATION = 500000 ;
|
|
|
|
|
|
+ //Limits private variables
|
|
|
int _limitLow_Pin;
|
|
|
int _limitLow_Mode = 0; //0 no limit, 1 digital, 2 analog with thresholds
|
|
|
bool _limitLow_Reversed ; //invert logic of limit switches
|
|
@@ -131,10 +136,10 @@ class Atm_AccelStepper: public Machine {
|
|
|
bool _limitHigh_Reversed ; //invert logic of limit switches
|
|
|
int _limitHigh_Thresholds[2] ; //analog value range for two analog limits
|
|
|
bool _limitHigh_Hard = 0 ;
|
|
|
- int _isHoming = 0 ;
|
|
|
+ // int _isHoming = 0 ;
|
|
|
atm_timer_millis limits_timer ;
|
|
|
int LIMIT_UPDATE_RATE = 5 ;
|
|
|
- void updateLimitSwitch();
|
|
|
+ // void updateLimitSwitch();
|
|
|
|
|
|
};
|
|
|
|