MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / find_axes_maximums

Method find_axes_maximums

src/ext/makerbot_driver/Gcode/Parser.py:150–171  ·  view source on GitHub ↗

Moves the given axes in the position direction until a timeout or endstop is reached This function loses the state machine's position.

(self, codes, flags, command)

Source from the content-addressed store, hash-verified

148 self.s3g.set_potentiometer_value(axis_codes[axis], value)
149
150 def find_axes_maximums(self, codes, flags, command):
151 """Moves the given axes in the position direction until a timeout
152 or endstop is reached
153 This function loses the state machine's position.
154 """
155 axes = makerbot_driver.Gcode.parse_out_axes(flags)
156 if len(axes) == 0:
157 return
158 #We need some axis information to calc the DDA speed
159 axes_feedrates, axes_SPM = self.state.get_axes_feedrate_and_SPM(axes)
160 dda_speed = makerbot_driver.Gcode.calculate_homing_DDA_speed(
161 codes['F'],
162 axes_feedrates,
163 axes_SPM
164 )
165 try:
166 self.s3g.find_axes_maximums(axes, dda_speed, self.state.profile.values[
167 'find_axis_maximum_timeout'])
168 except Exception:
169 raise
170 else:
171 self.state.lose_position(flags)
172
173 def find_axes_minimums(self, codes, flags, comment):
174 """Moves the given axes in the negative direction until a timeout

Callers

nothing calls this directly

Calls 2

lose_positionMethod · 0.45

Tested by

no test coverage detected