uStepper S
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
uStepperS Class Reference

Prototype of class for accessing all features of the uStepper S in a single object. More...

#include <uStepperS.h>

Collaboration diagram for uStepperS:
Collaboration graph

Public Member Functions

 uStepperS ()
 Constructor of uStepper class. More...
 
 uStepperS (float acceleration, float velocity)
 Overloaded Constructor of uStepper class. More...
 
void init (void)
 Internal function to prepare the uStepperS in the constructor. More...
 
void setup (uint8_t mode=NORMAL, uint16_t stepsPerRevolution=200, float pTerm=10.0, float iTerm=0.0, float dTerm=0.0, uint16_t dropinStepSize=16, bool setHome=true, uint8_t invert=0, uint8_t runCurrent=50, uint8_t holdCurrent=30)
 Initializes the different parts of the uStepper S object. More...
 
void setRPM (float rpm)
 Set the velocity in rpm. More...
 
void setMaxAcceleration (float acceleration)
 Set the maximum acceleration of the stepper motor. More...
 
void setMaxDeceleration (float deceleration)
 Set the maximum deceleration of the stepper motor. More...
 
void setMaxVelocity (float velocity)
 Set the maximum velocity of the stepper motor. More...
 
void setCurrent (double current)
 Set motor output current. More...
 
void setHoldCurrent (double current)
 Set motor hold current. More...
 
void moveSteps (int32_t steps)
 Make the motor perform a predefined number of steps. More...
 
void moveAngle (float angle)
 Makes the motor rotate a specific angle relative to the current position. More...
 
void moveToAngle (float angle)
 Makes the motor rotate a specific angle relative to the current position. More...
 
void runContinous (bool dir)
 Make the motor rotate continuously. More...
 
float angleMoved (void)
 Get the angle moved from reference position in degrees. More...
 
bool getMotorState (uint8_t statusType=POSITION_REACHED)
 Get the current motor driver state. More...
 
void stop (bool mode=HARD)
 Stop the motor. More...
 
void enableStallguard (int8_t threshold=4, bool stopOnStall=false)
 Enable TMC5130 StallGuard. More...
 
void disableStallguard (void)
 Disables the builtin stallguard offered from TMC5130, and reenables StealthChop. More...
 
void clearStall (void)
 Clear the stallguard, reenabling the motor to return to its previous operation. More...
 
bool isStalled (void)
 This method returns a bool variable indicating wether the motor is stalled or not. Uses the default stallguard threshold, unless this has been changed by .enableStallguard() More...
 
bool isStalled (int8_t threshold)
 This method returns a bool variable indicating wether the motor is stalled or not. The stallguard is sensitive to the speed of the motor, as the torque available is a function of the speed. Therefore, it is necessary to change the treshold according to the application. A higher treshold makes the stallguard less sensitive to external loads, meaning that, the higher the application speed, the higher the treshold has to be for the stall guard to perform well. More...
 
void setBrakeMode (uint8_t mode, float brakeCurrent=25.0)
 
More...
 
void enablePid (void)
 This method reenables the PID after being disabled. More...
 
void disablePid (void)
 This method disables the PID until calling enablePid. More...
 
void enableClosedLoop (void)
 This method reenables the closed loop mode after being disabled. More...
 
void disableClosedLoop (void)
 This method disables the closed loop mode until calling enableClosedLoop. More...
 
void setControlThreshold (float threshold)
 This method sets the control threshold for the closed loop position control in microsteps - i.e. it is the allowed control error. 10 microsteps is suitable in most applications. More...
 
float moveToEnd (bool dir, float rpm=40.0, int8_t threshold=4)
 Moves the motor to its physical limit, without limit switch. More...
 
float getPidError (void)
 This method returns the current PID error. More...
 
void setProportional (float P)
 This method is used to change the PID proportional parameter P. More...
 
void setIntegral (float I)
 This method is used to change the PID integral parameter I. More...
 
void setDifferential (float D)
 This method is used to change the PID differential parameter D. More...
 
void invertDropinDir (bool invert)
 This method is used to invert the drop-in direction pin interpretation. More...
 
void dropinCli ()
 This method is used to tune Drop-in parameters. After tuning uStepper S, the parameters are saved in EEPROM. More...
 
void parseCommand (String *cmd)
 This method is used for the dropinCli to take in user commands. More...
 
void dropinPrintHelp ()
 This method is used to print the dropinCli menu explainer: More...
 
void checkOrientation (float distance=10)
 This method is used to check the orientation of the motor connector. More...
 

Public Attributes

uStepperDriver driver
 
uStepperEncoder encoder
 

Private Member Functions

uint8_t SPI (uint8_t data)
 
void setSPIMode (uint8_t mode)
 
void chipSelect (uint8_t pin, bool state)
 
void filterSpeedPos (posFilter_t *filter, int32_t steps)
 
float pid (float error)
 
bool loadDropinSettings (void)
 
void saveDropinSettings (void)
 
uint8_t dropinSettingsCalcChecksum (dropinCliSettings_t *settings)
 

Private Attributes

float maxVelocity
 
float maxAcceleration
 
float maxDeceleration
 
bool invertPidDropinDirection
 
float rpmToVelocity
 
float angleToStep
 
uint16_t microSteps
 
uint16_t fullSteps
 
uint16_t dropinStepSize
 
int32_t stepCnt
 
float stepsPerSecondToRPM
 
float RPMToStepsPerSecond
 
volatile posFilter_t externalStepInputFilter
 
float currentPidSpeed
 
volatile uint8_t mode
 
float pTerm
 
float iTerm
 
float dTerm
 
bool brake
 
volatile bool pidDisabled
 
volatile float controlThreshold = 10
 
volatile bool stall
 
volatile int32_t pidPositionStepsIssued = 0
 
volatile float currentPidError
 
int8_t stallThreshold = 4
 
bool stallStop = false
 
bool stallEnabled = false
 
dropinCliSettings_t dropinSettings
 

Friends

class uStepperDriver
 
class uStepperEncoder
 
void used
 
void interrupt0 (void)
 Used by dropin feature to take in step pulses. More...
 
void TIMER1_COMPA_vect (void) __attribute__((signal
 Interrupt routine for critical tasks. More...
 

Detailed Description

Prototype of class for accessing all features of the uStepper S in a single object.

This class enables the user of the library to access all features of the uStepper S board, by use of a single object.

Definition at line 272 of file uStepperS.h.

Constructor & Destructor Documentation

◆ uStepperS() [1/2]

uStepperS::uStepperS ( )

Constructor of uStepper class.

Definition at line 34 of file uStepperS.cpp.

Here is the call graph for this function:

◆ uStepperS() [2/2]

uStepperS::uStepperS ( float  acceleration,
float  velocity 
)

Overloaded Constructor of uStepper class.

Definition at line 46 of file uStepperS.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ angleMoved()

float uStepperS::angleMoved ( void  )

Get the angle moved from reference position in degrees.

Returns
The angle moved in degrees.

Definition at line 481 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkOrientation()

void uStepperS::checkOrientation ( float  distance = 10)

This method is used to check the orientation of the motor connector.

Parameters
[in]distance- the amount of degrees the motor shaft should rotate during orientation determination.

Definition at line 92 of file uStepperS.cpp.

Here is the call graph for this function:

◆ chipSelect()

void uStepperS::chipSelect ( uint8_t  pin,
bool  state 
)
private

◆ clearStall()

void uStepperS::clearStall ( void  )

Clear the stallguard, reenabling the motor to return to its previous operation.

Definition at line 319 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disableClosedLoop()

void uStepperS::disableClosedLoop ( void  )

This method disables the closed loop mode until calling enableClosedLoop.

Definition at line 640 of file uStepperS.cpp.

Here is the call graph for this function:

◆ disablePid()

void uStepperS::disablePid ( void  )

This method disables the PID until calling enablePid.

Definition at line 628 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ disableStallguard()

void uStepperS::disableStallguard ( void  )

Disables the builtin stallguard offered from TMC5130, and reenables StealthChop.

Definition at line 312 of file uStepperS.cpp.

Here is the call graph for this function:

◆ dropinCli()

void uStepperS::dropinCli ( )

This method is used to tune Drop-in parameters. After tuning uStepper S, the parameters are saved in EEPROM.

Usage:

Set Proportional constant: 'P=10.002;' Set Integral constant: 'I=10.002;' Set Differential constant: 'D=10.002;' Invert Direction: 'invert;' Get Current PID Error: 'error;' Get Run/Hold Current Settings: 'current;' Set Run Current (percent): 'runCurrent=50.0;' Set Hold Current (percent): 'holdCurrent=50.0;'

Definition at line 1172 of file uStepperS.cpp.

Here is the call graph for this function:

◆ dropinPrintHelp()

void uStepperS::dropinPrintHelp ( )

This method is used to print the dropinCli menu explainer:

            Usage:
        Show this command list: 'help;'
        Get PID Parameters: 'parameters;'
        Set Proportional constant: 'P=10.002;'
        Set Integral constant: 'I=10.002;'
        Set Differential constant: 'D=10.002;'
        Invert Direction: 'invert;'
        Get Current PID Error: 'error;'
        Get Run/Hold Current Settings: 'current;'
        Set Run Current (percent): 'runCurrent=50.0;'
        Set Hold Current (percent): 'holdCurrent=50.0;' 

Definition at line 1198 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ dropinSettingsCalcChecksum()

uint8_t uStepperS::dropinSettingsCalcChecksum ( dropinCliSettings_t settings)
private

Definition at line 1245 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ enableClosedLoop()

void uStepperS::enableClosedLoop ( void  )

This method reenables the closed loop mode after being disabled.

Definition at line 635 of file uStepperS.cpp.

Here is the call graph for this function:

◆ enablePid()

void uStepperS::enablePid ( void  )

This method reenables the PID after being disabled.

Definition at line 621 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ enableStallguard()

void uStepperS::enableStallguard ( int8_t  threshold = 4,
bool  stopOnStall = false 
)

Enable TMC5130 StallGuard.

            This function enables the builtin stallguard offered from TMC5130 stepper driver.
            The threshold should be tuned as to trigger stallguard before a step is lost.
Parameters
threshold- stall sensitivity. A value between -64 and +63
stopOnStall- should the driver automatic stop the motor on a stall

Definition at line 301 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filterSpeedPos()

void uStepperS::filterSpeedPos ( posFilter_t filter,
int32_t  steps 
)
private

Definition at line 503 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ getMotorState()

bool uStepperS::getMotorState ( uint8_t  statusType = POSITION_REACHED)

Get the current motor driver state.

        This function is used to check some internal status flags of the driver.
        The argument is used to specify the flag to check

param[in] statusType - status flag to check. Possible values: POSITION_REACHED - has last commanded position been reached? VELOCITY_REACHED - has last commanded velocity been reached? STANDSTILL - Are the motor currently stopped? STALLGUARD2 - Has the stallguard been trickered?

Returns
The angle moved.

Definition at line 82 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPidError()

float uStepperS::getPidError ( void  )

This method returns the current PID error.

Returns
PID error (float)

Definition at line 676 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ init()

void uStepperS::init ( void  )

Internal function to prepare the uStepperS in the constructor.

Definition at line 57 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invertDropinDir()

void uStepperS::invertDropinDir ( bool  invert)

This method is used to invert the drop-in direction pin interpretation.

Parameters
[in]invert- 0 = not inverted, 1 = inverted

Definition at line 762 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ isStalled() [1/2]

bool uStepperS::isStalled ( int8_t  threshold)

This method returns a bool variable indicating wether the motor is stalled or not. The stallguard is sensitive to the speed of the motor, as the torque available is a function of the speed. Therefore, it is necessary to change the treshold according to the application. A higher treshold makes the stallguard less sensitive to external loads, meaning that, the higher the application speed, the higher the treshold has to be for the stall guard to perform well.

Parameters
[in]threshold- Threshold for stallguard. A value between -64 and +63
Returns
0 = not stalled, 1 = stalled

Definition at line 329 of file uStepperS.cpp.

Here is the call graph for this function:

◆ isStalled() [2/2]

bool uStepperS::isStalled ( void  )

This method returns a bool variable indicating wether the motor is stalled or not. Uses the default stallguard threshold, unless this has been changed by .enableStallguard()

Returns
0 = not stalled, 1 = stalled

Definition at line 324 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ loadDropinSettings()

bool uStepperS::loadDropinSettings ( void  )
private

Definition at line 1217 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveAngle()

void uStepperS::moveAngle ( float  angle)

Makes the motor rotate a specific angle relative to the current position.

         This function makes the motor a rotate by a specific angle relative to 
        the current position, using the acceleration profile. The motor will accelerate
         at the rate set by setMaxAcceleration(), decelerate at the rate set by 
        setMaxDeceleration() and eventually reach the speed set
         by setMaxVelocity() function. The direction of rotation
         is set by the sign of the commanded angle to move
Parameters
[in]angle- Angle to move. an input value of 300 makes the motor go 300 degrees in CW direction, and an input value of -300 makes the motor move 300 degrees in CCW direction.

Definition at line 266 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveSteps()

void uStepperS::moveSteps ( int32_t  steps)

Make the motor perform a predefined number of steps.

        This function makes the motor perform a predefined number of
        steps, using the acceleration profile. The motor will accelerate
        at the rate set by setMaxAcceleration(), decelerate at the rate set by setMaxDeceleration() and eventually reach the speed set
        by setMaxVelocity() function. The direction of rotation
        is set by the sign of the commanded steps to perform
Parameters
[in]steps- Number of steps to be performed. an input value of 300 makes the motor go 300 steps in CW direction, and an input value of -300 makes the motor move 300 steps in CCW direction.

Definition at line 251 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveToAngle()

void uStepperS::moveToAngle ( float  angle)

Makes the motor rotate a specific angle relative to the current position.

         This function makes the motor a rotate by a specific angle relative to 
        the current position, using the acceleration profile. The motor will accelerate
         at the rate set by setMaxAcceleration(), decelerate at the rate set by 
        setMaxDeceleration() and eventually reach the speed set
         by setMaxVelocity() function. The direction of rotation
         is set by the sign of the commanded angle to move
Parameters
[in]angle- Angle to move. an input value of 300 makes the motor go 300 degrees in CW direction, and an input value of -300 makes the motor move 300 degrees in CCW direction.

Definition at line 283 of file uStepperS.cpp.

Here is the call graph for this function:

◆ moveToEnd()

float uStepperS::moveToEnd ( bool  dir,
float  rpm = 40.0,
int8_t  threshold = 4 
)

Moves the motor to its physical limit, without limit switch.

         This function, makes the motor run continously, untill the
        encoder detects a stall, at which point the motor is assumed
        to be at it's limit.
Parameters
[in]dirDirection to search for limit
[in]rpmRPM of the motor while searching for limit
[in]thresholdSensitivity of stall detection (-64 to +63), low is more sensitive
Returns
Degrees turned from calling the function, till end was reached

Definition at line 645 of file uStepperS.cpp.

Here is the call graph for this function:

◆ parseCommand()

void uStepperS::parseCommand ( String *  cmd)

This method is used for the dropinCli to take in user commands.

Parameters
[in]cmd- input from terminal for dropinCli

Definition at line 767 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pid()

float uStepperS::pid ( float  error)
private

Definition at line 681 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ runContinous()

void uStepperS::runContinous ( bool  dir)

Make the motor rotate continuously.

        This function makes the motor rotate continuously, using the
        acceleration profile.
Parameters
[in]dir- Can be set to "CCW" or "CW" (without the quotes)

Definition at line 468 of file uStepperS.cpp.

Here is the call graph for this function:

◆ saveDropinSettings()

void uStepperS::saveDropinSettings ( void  )
private

Definition at line 1238 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBrakeMode()

void uStepperS::setBrakeMode ( uint8_t  mode,
float  brakeCurrent = 25.0 
)


Parameters
[in]mode- this parameter specifies how the motor should brake during standstill. available modes: FREEWHEELBRAKE - This will result in no holding torque at standstill COOLBRAKE 1 - This will make the motor brake by shorting the two bottom FET's of the H-Bridge. This will provide less holding torque, but will significantly reduce driver heat HARDBRAKE 2 - This will make the motor brake by sending the full specified current through the coils. This will provide high holding torque, but will make the driver (and motor) dissipate power
[in]brakeCurrent(optional) - if HARDBRAKE is use as mode, this argument can set the current to use for braking (0-100% of 2A). If argument is not specified, the motor will brake with 25% of max current

Definition at line 343 of file uStepperS.cpp.

Here is the call graph for this function:

◆ setControlThreshold()

void uStepperS::setControlThreshold ( float  threshold)

This method sets the control threshold for the closed loop position control in microsteps - i.e. it is the allowed control error. 10 microsteps is suitable in most applications.

Definition at line 617 of file uStepperS.cpp.

◆ setCurrent()

void uStepperS::setCurrent ( double  current)

Set motor output current.

        This function allows the user to change the current setting of the motor driver.
Parameters
[in]current- Desired current in percent (0% - 100%)

Definition at line 441 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDifferential()

void uStepperS::setDifferential ( float  D)

This method is used to change the PID differential parameter D.

Parameters
[in]D- PID differential part D

Definition at line 757 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ setHoldCurrent()

void uStepperS::setHoldCurrent ( double  current)

Set motor hold current.

        This function allows the user to change the current setting of the motor driver.
Parameters
[in]current- Desired hold current in percent (0% - 100%)

Definition at line 454 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIntegral()

void uStepperS::setIntegral ( float  I)

This method is used to change the PID integral parameter I.

Parameters
[in]I- PID integral part I

Definition at line 752 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ setMaxAcceleration()

void uStepperS::setMaxAcceleration ( float  acceleration)

Set the maximum acceleration of the stepper motor.

        This function lets the user set the max acceleration used 
        by the stepper driver.
Parameters
[in]acceleration- Maximum acceleration in steps/s^2

Definition at line 418 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxDeceleration()

void uStepperS::setMaxDeceleration ( float  deceleration)

Set the maximum deceleration of the stepper motor.

        This function lets the user set the max deceleration used 
        by the stepper driver.
Parameters
[in]deceleration- Maximum deceleration in steps/s^2

Definition at line 430 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxVelocity()

void uStepperS::setMaxVelocity ( float  velocity)

Set the maximum velocity of the stepper motor.

        This function lets the user set the max velocity used 
        by the stepper driver.
Parameters
[in]velocity- Maximum velocity in steps/s

Definition at line 407 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProportional()

void uStepperS::setProportional ( float  P)

This method is used to change the PID proportional parameter P.

Parameters
[in]P- PID proportional part P

Definition at line 747 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ setRPM()

void uStepperS::setRPM ( float  rpm)

Set the velocity in rpm.

        This function lets the user set the velocity of the motor in rpm. 
        A negative value switches direction of the motor.
Parameters
[in]rpm- The velocity in rotations per minute

Definition at line 364 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSPIMode()

void uStepperS::setSPIMode ( uint8_t  mode)
private

Definition at line 381 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ setup()

void uStepperS::setup ( uint8_t  mode = NORMAL,
uint16_t  stepsPerRevolution = 200,
float  pTerm = 10.0,
float  iTerm = 0.0,
float  dTerm = 0.0,
uint16_t  dropinStepSize = 16,
bool  setHome = true,
uint8_t  invert = 0,
uint8_t  runCurrent = 50,
uint8_t  holdCurrent = 30 
)

Initializes the different parts of the uStepper S object.

        This function initializes the different parts of the uStepper S
        object, and should be called in the setup() function of the
        arduino sketch. This function is needed as some things, like
        the timer can not be setup in the constructor, since arduino
        for some strange reason, resets a lot of the AVR registers
        just before entering the setup() function.
Parameters
[in]modeDefault is normal mode. Pass the constant "DROPIN" to configure the uStepper to act as dropin compatible to the stepstick. Pass the constant "PID", to enable closed loop feature for regular movement functions, such as moveSteps()
[in]stepsPerRevolutionNumber of fullsteps per revolution
[in]pTermThe proportional coefficent of the DROPIN PID controller
[in]iTermThe integral coefficent of the DROPIN PID controller
[in]dTermThe differential coefficent of the DROPIN PID controller
[in]dropinStepSizenumber of steps per fullstep, send from external dropin controller
[in]setHomeWhen set to true, the encoder position is Reset. When set to false, the encoder position is not reset.
[in]invertInverts the motor direction for dropin feature. 0 = NOT invert, 1 = invert. this has no effect for other modes than dropin
[in]runCurrentSets the current (in percent) to use while motor is running.
[in]holdCurrentSets the current (in percent) to use while motor is NOT running

Definition at line 154 of file uStepperS.cpp.

Here is the call graph for this function:

◆ SPI()

uint8_t uStepperS::SPI ( uint8_t  data)
private

Definition at line 396 of file uStepperS.cpp.

Here is the caller graph for this function:

◆ stop()

void uStepperS::stop ( bool  mode = HARD)

Stop the motor.

            This function stops any ongoing motor movement. The "mode" argument
        determines whether the motor should stop with or without
        a deceleration phase
Parameters
mode- can be set to "HARD" for no deceleration phase or "SOFT" for deceleration phase.

Definition at line 486 of file uStepperS.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ interrupt0

void interrupt0 ( void  )
friend

Used by dropin feature to take in step pulses.

        This interrupt routine is used by the dropin feature to keep
        track of step and direction pulses from main controller

Definition at line 539 of file uStepperS.cpp.

◆ TIMER1_COMPA_vect

void TIMER1_COMPA_vect ( void  )
friend

Interrupt routine for critical tasks.

    This interrupt routine is in charge of sampling the encoder, process the data and handle PID

Definition at line 574 of file uStepperS.cpp.

◆ used

friend void used
friend

Definition at line 278 of file uStepperS.h.

◆ uStepperDriver

friend class uStepperDriver
friend

Definition at line 275 of file uStepperS.h.

◆ uStepperEncoder

friend class uStepperEncoder
friend

Definition at line 276 of file uStepperS.h.

Member Data Documentation

◆ angleToStep

float uStepperS::angleToStep
private

Definition at line 713 of file uStepperS.h.

◆ brake

bool uStepperS::brake
private

Definition at line 735 of file uStepperS.h.

◆ controlThreshold

volatile float uStepperS::controlThreshold = 10
private

This variable sets the threshold for activating/deactivating closed loop position control - i.e. it is the allowed error in steps for the control

Definition at line 738 of file uStepperS.h.

◆ currentPidError

volatile float uStepperS::currentPidError
private

Definition at line 745 of file uStepperS.h.

◆ currentPidSpeed

float uStepperS::currentPidSpeed
private

Definition at line 726 of file uStepperS.h.

◆ driver

uStepperDriver uStepperS::driver

Instantiate object for the driver

Definition at line 282 of file uStepperS.h.

◆ dropinSettings

dropinCliSettings_t uStepperS::dropinSettings
private

Definition at line 766 of file uStepperS.h.

◆ dropinStepSize

uint16_t uStepperS::dropinStepSize
private

Definition at line 717 of file uStepperS.h.

◆ dTerm

float uStepperS::dTerm
private

Definition at line 734 of file uStepperS.h.

◆ encoder

uStepperEncoder uStepperS::encoder

Instantiate object for the Encoder

Definition at line 285 of file uStepperS.h.

◆ externalStepInputFilter

volatile posFilter_t uStepperS::externalStepInputFilter
private

Definition at line 724 of file uStepperS.h.

◆ fullSteps

uint16_t uStepperS::fullSteps
private

Definition at line 716 of file uStepperS.h.

◆ invertPidDropinDirection

bool uStepperS::invertPidDropinDirection
private

Definition at line 711 of file uStepperS.h.

◆ iTerm

float uStepperS::iTerm
private

This variable contains the integral coefficient used by the PID

Definition at line 732 of file uStepperS.h.

◆ maxAcceleration

float uStepperS::maxAcceleration
private

This variable contains the maximum acceleration in steps/s to be used. The can be set and read by the user of the library using the functions setMaxAcceleration()

Definition at line 709 of file uStepperS.h.

◆ maxDeceleration

float uStepperS::maxDeceleration
private

Definition at line 710 of file uStepperS.h.

◆ maxVelocity

float uStepperS::maxVelocity
private

This variable contains the maximum velocity in steps/s, the motor is allowed to reach at any given point. The user of the library can set this by use of the setMaxVelocity()

Definition at line 703 of file uStepperS.h.

◆ microSteps

uint16_t uStepperS::microSteps
private

Definition at line 715 of file uStepperS.h.

◆ mode

volatile uint8_t uStepperS::mode
private

This variable is used to indicate which mode the uStepper is running in (Normal, dropin or pid)

Definition at line 729 of file uStepperS.h.

◆ pidDisabled

volatile bool uStepperS::pidDisabled
private

Definition at line 736 of file uStepperS.h.

◆ pidPositionStepsIssued

volatile int32_t uStepperS::pidPositionStepsIssued = 0
private

Definition at line 744 of file uStepperS.h.

◆ pTerm

float uStepperS::pTerm
private

Definition at line 730 of file uStepperS.h.

◆ RPMToStepsPerSecond

float uStepperS::RPMToStepsPerSecond
private

Definition at line 722 of file uStepperS.h.

◆ rpmToVelocity

float uStepperS::rpmToVelocity
private

Definition at line 712 of file uStepperS.h.

◆ stall

volatile bool uStepperS::stall
private

This variable holds information on wether the motor is stalled or not. 0 = OK, 1 = stalled

Definition at line 741 of file uStepperS.h.

◆ stallEnabled

bool uStepperS::stallEnabled = false
private

Flag to keep track of stallguard

Definition at line 754 of file uStepperS.h.

◆ stallStop

bool uStepperS::stallStop = false
private

This variable hold the default state for Stallguard (stopOnStall)

Definition at line 751 of file uStepperS.h.

◆ stallThreshold

int8_t uStepperS::stallThreshold = 4
private

This variable holds the default stall threshold, but can be updated by the user.

Definition at line 748 of file uStepperS.h.

◆ stepCnt

int32_t uStepperS::stepCnt
private

Definition at line 719 of file uStepperS.h.

◆ stepsPerSecondToRPM

float uStepperS::stepsPerSecondToRPM
private

Definition at line 721 of file uStepperS.h.


The documentation for this class was generated from the following files: