Repetier-Firmware  0.91
PrintLine Class Reference

#include <motion.h>

Public Member Functions

bool areParameterUpToDate ()
void invalidateParameter ()
void setParameterUpToDate ()
bool isStartSpeedFixed ()
void setStartSpeedFixed (bool newState)
void fixStartAndEndSpeed ()
bool isEndSpeedFixed ()
void setEndSpeedFixed (bool newState)
bool isWarmUp ()
uint8_t getWaitForXLinesFilled ()
void setWaitForXLinesFilled (uint8_t b)
bool isExtruderForwardMove ()
void block ()
void unblock ()
bool isBlocked ()
bool isCheckEndstops ()
bool isNominalMove ()
bool setNominalMove ()
void checkEndstops ()
void setXMoveFinished ()
void setYMoveFinished ()
void setZMoveFinished ()
void setXYMoveFinished ()
bool isXPositiveMove ()
bool isXNegativeMove ()
bool isYPositiveMove ()
bool isYNegativeMove ()
bool isZPositiveMove ()
bool isZNegativeMove ()
bool isEPositiveMove ()
bool isENegativeMove ()
bool isXMove ()
bool isYMove ()
bool isXOrYMove ()
bool isZMove ()
bool isEMove ()
bool isEOnlyMove ()
bool isNoMove ()
bool isXYZMove ()
bool isMoveOfAxis (uint8_t axis)
void setMoveOfAxis (uint8_t axis)
void setPositiveDirectionForAxis (uint8_t axis)
void updateAdvanceSteps (unsigned int v, uint8_t max_loops, bool accelerate)
bool moveDecelerating ()
bool moveAccelerating ()
bool isFullstepping ()
bool startXStep ()
bool startYStep ()
void startZStep ()
void updateStepsParameter ()
float safeSpeed ()
void calculateMove (float axis_diff[], uint8_t pathOptimize)
void logLine ()
long getWaitTicks ()
void setWaitTicks (long wait)

Static Public Member Functions

static void resetPathPlanner ()
static bool hasLines ()
static void setCurrentLine ()
static void removeCurrentLineForbidInterrupt ()
static void pushLine ()
static PrintLinegetNextWriteLine ()
static void computeMaxJunctionSpeed (PrintLine *previous, PrintLine *current)
static long bresenhamStep ()
static void waitForXFreeLines (uint8_t b=1)
static void forwardPlanner (uint8_t p)
static void backwardPlanner (uint8_t p, uint8_t last)
static void updateTrapezoids ()
static uint8_t insertWaitMovesIfNeeded (uint8_t pathOptimize, uint8_t waitExtraLines)
static void queueCartesianMove (uint8_t check_endstops, uint8_t pathOptimize)
static void moveRelativeDistanceInSteps (long x, long y, long z, long e, float feedrate, bool waitEnd, bool check_endstop)
static void previousPlannerIndex (uint8_t &p)
static void nextPlannerIndex (uint8_t &p)

Data Fields

long stepsRemaining
 Remaining steps, until move is finished.

Static Public Attributes

static PrintLinecur = 0
 Current printing line.
static volatile uint8_t linesCount = 0
 Number of lines cached 0 = nothing to do.

Private Attributes

uint8_t primaryAxis
volatile uint8_t flags
long timeInTicks
uint8_t joinFlags
uint8_t halfStep
 4 = disabled, 1 = halfstep, 2 = fulstep
uint8_t dir
 Direction of movement. 1 = X+, 2 = Y+, 4= Z+, values can be combined.
long delta [4]
 Steps we want to move.
long error [4]
 Error calculation for Bresenham algorithm.
float speedX
 Speed in x direction at fullInterval in mm/s.
float speedY
 Speed in y direction at fullInterval in mm/s.
float speedZ
 Speed in z direction at fullInterval in mm/s.
float speedE
 Speed in E direction at fullInterval in mm/s.
float fullSpeed
 Desired speed mm/s.
float invFullSpeed
 1.0/fullSpeed for fatser computation
float accelerationDistance2
 Real 2.0*distanceÜacceleration mm²/s²
float maxJunctionSpeed
 Max. junction speed between this and next segment.
float startSpeed
 Staring speed in mm/s.
float endSpeed
 Exit speed in mm/s.
float minSpeed
float distance
ticks_t fullInterval
 interval at full speed in ticks/step.
unsigned int accelSteps
 How much steps does it take, to reach the plateau.
unsigned int decelSteps
 How much steps does it take, to reach the end speed.
unsigned long accelerationPrim
 Acceleration along primary axis.
unsigned long fAcceleration
 accelerationPrim*262144/F_CPU
speed_t vMax
 Maximum reached speed in steps/s.
speed_t vStart
 Starting speed in steps/s.
speed_t vEnd
 End speed in steps/s.

Static Private Attributes

static volatile bool nlFlag
static uint8_t linesPos = 0
 Position for executing line movement.
static PrintLine lines []
 Cache for print moves.
static uint8_t linesWritePos = 0
 Position where we write the next cached line move.

Friends

class UIDisplay

Member Function Documentation

bool areParameterUpToDate ( ) [inline]
void backwardPlanner ( uint8_t  start,
uint8_t  last 
) [inline, static]

Compute the maximum speed from the last entered move. The backwards planner traverses the moves from last to first looking at deceleration. The RHS of the accelerate/decelerate ramp.

start = last line inserted last = last element until we check

void block ( ) [inline]
long bresenhamStep ( ) [static]
void calculateMove ( float  axis_diff[],
uint8_t  pathOptimize 
)
void checkEndstops ( ) [inline]
void computeMaxJunctionSpeed ( PrintLine previous,
PrintLine current 
) [inline, static]
void fixStartAndEndSpeed ( ) [inline]
void forwardPlanner ( uint8_t  p) [inline, static]
static PrintLine* getNextWriteLine ( ) [inline, static]
uint8_t getWaitForXLinesFilled ( ) [inline]
long getWaitTicks ( ) [inline]
static bool hasLines ( ) [inline, static]
uint8_t insertWaitMovesIfNeeded ( uint8_t  pathOptimize,
uint8_t  waitExtraLines 
) [static]

Check if move is new. If it is insert some dummy moves to allow the path optimizer to work since it does not act on the first two moves in the queue. The stepper timer will spot these moves and leave some time for processing.

void invalidateParameter ( ) [inline]
bool isBlocked ( ) [inline]
bool isCheckEndstops ( ) [inline]
bool isEMove ( ) [inline]
bool isEndSpeedFixed ( ) [inline]
bool isENegativeMove ( ) [inline]
bool isEOnlyMove ( ) [inline]
bool isEPositiveMove ( ) [inline]
bool isExtruderForwardMove ( ) [inline]
bool isFullstepping ( ) [inline]
bool isMoveOfAxis ( uint8_t  axis) [inline]
bool isNominalMove ( ) [inline]
bool isNoMove ( ) [inline]
bool isStartSpeedFixed ( ) [inline]
bool isWarmUp ( ) [inline]
bool isXMove ( ) [inline]
bool isXNegativeMove ( ) [inline]
bool isXOrYMove ( ) [inline]
bool isXPositiveMove ( ) [inline]
bool isXYZMove ( ) [inline]
bool isYMove ( ) [inline]
bool isYNegativeMove ( ) [inline]
bool isYPositiveMove ( ) [inline]
bool isZMove ( ) [inline]
bool isZNegativeMove ( ) [inline]
bool isZPositiveMove ( ) [inline]
void logLine ( )
bool moveAccelerating ( ) [inline]
bool moveDecelerating ( ) [inline]
void moveRelativeDistanceInSteps ( long  x,
long  y,
long  z,
long  e,
float  feedrate,
bool  waitEnd,
bool  checkEndstop 
) [static]

Move printer the given number of steps. Puts the move into the queue. Used by e.g. homing commands.

static void nextPlannerIndex ( uint8_t &  p) [inline, static]
static void previousPlannerIndex ( uint8_t &  p) [inline, static]
static void pushLine ( ) [inline, static]
void queueCartesianMove ( uint8_t  check_endstops,
uint8_t  pathOptimize 
) [static]

Put a move to the current destination coordinates into the movement cache. If the cache is full, the method will wait, until a place gets free. During wait communication and temperature control is enabled.

Parameters:
check_endstopsRead endstop during move.
static void removeCurrentLineForbidInterrupt ( ) [inline, static]
static void resetPathPlanner ( ) [inline, static]
float safeSpeed ( ) [inline]
static void setCurrentLine ( ) [inline, static]
void setEndSpeedFixed ( bool  newState) [inline]
void setMoveOfAxis ( uint8_t  axis) [inline]
bool setNominalMove ( ) [inline]
void setParameterUpToDate ( ) [inline]
void setPositiveDirectionForAxis ( uint8_t  axis) [inline]
void setStartSpeedFixed ( bool  newState) [inline]
void setWaitForXLinesFilled ( uint8_t  b) [inline]
void setWaitTicks ( long  wait) [inline]
void setXMoveFinished ( ) [inline]
void setXYMoveFinished ( ) [inline]
void setYMoveFinished ( ) [inline]
void setZMoveFinished ( ) [inline]
bool startXStep ( ) [inline]
bool startYStep ( ) [inline]
void startZStep ( ) [inline]
void unblock ( ) [inline]
void updateAdvanceSteps ( unsigned int  v,
uint8_t  max_loops,
bool  accelerate 
) [inline]

Update parameter used by updateTrapezoids

Computes the acceleration/decelleration steps and advanced parameter associated.

void updateTrapezoids ( ) [static]

This is the path planner.

It goes from the last entry and tries to increase the end speed of previous moves in a fashion that the maximum jerk is never exceeded. If a segment with reached maximum speed is met, the planner stops. Everything left from this is already optimal from previous updates. The first 2 entries in the queue are not checked. The first is the one that is already in print and the following will likely become active.

The method is called before lines_count is increased!

void waitForXFreeLines ( uint8_t  b = 1) [static]

Friends And Related Function Documentation

friend class UIDisplay [friend]

Field Documentation

float accelerationDistance2 [private]

Real 2.0*distanceÜacceleration mm²/s²

unsigned long accelerationPrim [private]

Acceleration along primary axis.

unsigned int accelSteps [private]

How much steps does it take, to reach the plateau.

PrintLine * cur = 0 [static]

Current printing line.

unsigned int decelSteps [private]

How much steps does it take, to reach the end speed.

long delta[4] [private]

Steps we want to move.

uint8_t dir [private]

Direction of movement. 1 = X+, 2 = Y+, 4= Z+, values can be combined.

float distance [private]
float endSpeed [private]

Exit speed in mm/s.

long error[4] [private]

Error calculation for Bresenham algorithm.

unsigned long fAcceleration [private]

accelerationPrim*262144/F_CPU

volatile uint8_t flags [private]
ticks_t fullInterval [private]

interval at full speed in ticks/step.

float fullSpeed [private]

Desired speed mm/s.

uint8_t halfStep [private]

4 = disabled, 1 = halfstep, 2 = fulstep

float invFullSpeed [private]

1.0/fullSpeed for fatser computation

uint8_t joinFlags [private]
PrintLine lines [static, private]

Cache for print moves.

volatile uint8_t linesCount = 0 [static]

Number of lines cached 0 = nothing to do.

uint8_t linesPos = 0 [static, private]

Position for executing line movement.

uint8_t linesWritePos = 0 [static, private]

Position where we write the next cached line move.

float maxJunctionSpeed [private]

Max. junction speed between this and next segment.

float minSpeed [private]
volatile bool nlFlag [static, private]
uint8_t primaryAxis [private]
float speedE [private]

Speed in E direction at fullInterval in mm/s.

float speedX [private]

Speed in x direction at fullInterval in mm/s.

float speedY [private]

Speed in y direction at fullInterval in mm/s.

float speedZ [private]

Speed in z direction at fullInterval in mm/s.

float startSpeed [private]

Staring speed in mm/s.

Remaining steps, until move is finished.

long timeInTicks [private]
speed_t vEnd [private]

End speed in steps/s.

speed_t vMax [private]

Maximum reached speed in steps/s.

speed_t vStart [private]

Starting speed in steps/s.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Defines