gnea\grbl-Mega  1.0f
Source Code Documentation ( Internal Workings )
limits.c File Reference
#include "grbl.h"

Go to the source code of this file.

Macros

#define HOMING_AXIS_SEARCH_SCALAR   1.5
 Homing axis search distance multiplier. Computed by this value times the cycle travel. More...
 
#define HOMING_AXIS_LOCATE_SCALAR   5.0
 Must be > 1 to ensure limit switch is cleared. More...
 

Functions

void limits_init ()
 Initialize the limits module. More...
 
void limits_disable ()
 Disables hard limits. More...
 
uint8_t limits_get_state ()
 Returns limit state as a bit-wise uint8 variable. Each bit indicates an axis limit, where. More...
 
 ISR (LIMIT_INT_vect)
 This is the Limit Pin Change Interrupt, which handles the hard limit feature. A bouncing. More...
 
void limits_go_home (uint8_t cycle_mask)
 NOTE: Only the abort realtime command can interrupt this process. More...
 
void limits_soft_check (float *target)
 Performs a soft limit check. Called from mc_line() only. Assumes the machine has been homed,. More...
 

Macro Definition Documentation

#define HOMING_AXIS_LOCATE_SCALAR   5.0

Must be > 1 to ensure limit switch is cleared.

Definition at line 29 of file limits.c.

#define HOMING_AXIS_SEARCH_SCALAR   1.5

Homing axis search distance multiplier. Computed by this value times the cycle travel.

Must be > 1 to ensure limit switch will be engaged.

Definition at line 26 of file limits.c.

Function Documentation

ISR ( LIMIT_INT_vect  )

This is the Limit Pin Change Interrupt, which handles the hard limit feature. A bouncing.

NOTE: Do not attach an e-stop to the limit pins, because this interrupt is disabled during

< Initiate system kill.

< Indicate hard limit critical event

Definition at line 96 of file limits.c.

void limits_disable ( )

Disables hard limits.

< Disable specific pins of the Pin Change Interrupt

< Disable Pin Change Interrupt

Definition at line 57 of file limits.c.

uint8_t limits_get_state ( )

Returns limit state as a bit-wise uint8 variable. Each bit indicates an axis limit, where.

Returns limit state as a bit-wise uint8 variable.

Definition at line 66 of file limits.c.

void limits_go_home ( uint8_t  cycle_mask)

NOTE: Only the abort realtime command can interrupt this process.

Perform one portion of the homing cycle based on the input settings.

Todo:
Move limit pin-specific calls to a general function for portability.

NOTE: settings.max_travel[] is stored as a negative value.

NOTE: This happens to compile smaller than any other implementation tried.

< [sqrt(N_AXIS)] Adjust so individual axes all move at homing rate.

< Set current homing rate.

< Bypass mc_line(). Directly plan homing motion.

< Set to execute homing motion and clear existing flags.

< Prep and fill segment buffer from newly planned block.

< Initiate motion

< Check and prep segment buffer.

NOTE: Should take no longer than 200us.

< Stop motors, if they are running.

< Immediately force kill steppers and reset step segment buffer.

< Delay to allow transient dynamics to dissipate.

NOTE: settings.max_travel[] is stored as a negative value.

< Return step control to normal operation.

Definition at line 145 of file limits.c.

void limits_init ( )

Initialize the limits module.

< Set as input pins

< Enable internal pull-up resistors. Normal high operation.

< Enable specific pins of the Pin Change Interrupt

< Enable Pin Change Interrupt

Definition at line 32 of file limits.c.

void limits_soft_check ( float *  target)

Performs a soft limit check. Called from mc_line() only. Assumes the machine has been homed,.

Check for soft limit violations.

NOTE: Used by jogging to limit travel within soft-limit volume.

< Issue system reset and ensure spindle and coolant are shutdown.

< Indicate soft limit critical event

< Execute to enter critical event loop and system abort

Definition at line 342 of file limits.c.