mirror of
https://github.com/sinseman44/PyCNC.git
synced 2026-07-26 10:16:55 +00:00
limit min velocity
This commit is contained in:
@@ -6,6 +6,7 @@ MAX_VELOCITY_MM_PER_MIN_X = 24000
|
|||||||
MAX_VELOCITY_MM_PER_MIN_Y = 15000
|
MAX_VELOCITY_MM_PER_MIN_Y = 15000
|
||||||
MAX_VELOCITY_MM_PER_MIN_Z = 600
|
MAX_VELOCITY_MM_PER_MIN_Z = 600
|
||||||
MAX_VELOCITY_MM_PER_MIN_E = 1500
|
MAX_VELOCITY_MM_PER_MIN_E = 1500
|
||||||
|
MIN_VELOCITY_MM_PER_MIN = 1
|
||||||
# Average velocity for endstop calibration procedure
|
# Average velocity for endstop calibration procedure
|
||||||
CALIBRATION_VELOCITY_MM_PER_MIN = 300
|
CALIBRATION_VELOCITY_MM_PER_MIN = 300
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -324,8 +324,8 @@ class GMachine(object):
|
|||||||
radius = gcode.radius(Coordinates(0.0, 0.0, 0.0, 0.0),
|
radius = gcode.radius(Coordinates(0.0, 0.0, 0.0, 0.0),
|
||||||
self._convertCoordinates)
|
self._convertCoordinates)
|
||||||
# check parameters
|
# check parameters
|
||||||
if velocity <= 0:
|
if velocity < MIN_VELOCITY_MM_PER_MIN:
|
||||||
raise GMachineException("negative feed speed")
|
raise GMachineException("feed speed too low")
|
||||||
# select command and run it
|
# select command and run it
|
||||||
if c == 'G0': # rapid move
|
if c == 'G0': # rapid move
|
||||||
vl = max(MAX_VELOCITY_MM_PER_MIN_X,
|
vl = max(MAX_VELOCITY_MM_PER_MIN_X,
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class TestGMachine(unittest.TestCase):
|
|||||||
m = GMachine()
|
m = GMachine()
|
||||||
self.assertRaises(GMachineException,
|
self.assertRaises(GMachineException,
|
||||||
m.do_command, GCode.parse_line("G1X1F-1"))
|
m.do_command, GCode.parse_line("G1X1F-1"))
|
||||||
|
c = "G1X1F" + str(MIN_VELOCITY_MM_PER_MIN - 0.0000001)
|
||||||
|
self.assertRaises(GMachineException, m.do_command, GCode.parse_line(c))
|
||||||
m.do_command(GCode.parse_line("G1X100F"
|
m.do_command(GCode.parse_line("G1X100F"
|
||||||
+ str(MAX_VELOCITY_MM_PER_MIN_X)))
|
+ str(MAX_VELOCITY_MM_PER_MIN_X)))
|
||||||
m.do_command(GCode.parse_line("G1Y100F"
|
m.do_command(GCode.parse_line("G1Y100F"
|
||||||
|
|||||||
Reference in New Issue
Block a user