mirror of
https://github.com/sinseman44/PyCNC.git
synced 2026-07-16 08:37:09 +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_Z = 600
|
||||
MAX_VELOCITY_MM_PER_MIN_E = 1500
|
||||
MIN_VELOCITY_MM_PER_MIN = 1
|
||||
# Average velocity for endstop calibration procedure
|
||||
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),
|
||||
self._convertCoordinates)
|
||||
# check parameters
|
||||
if velocity <= 0:
|
||||
raise GMachineException("negative feed speed")
|
||||
if velocity < MIN_VELOCITY_MM_PER_MIN:
|
||||
raise GMachineException("feed speed too low")
|
||||
# select command and run it
|
||||
if c == 'G0': # rapid move
|
||||
vl = max(MAX_VELOCITY_MM_PER_MIN_X,
|
||||
|
||||
@@ -75,6 +75,8 @@ class TestGMachine(unittest.TestCase):
|
||||
m = GMachine()
|
||||
self.assertRaises(GMachineException,
|
||||
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"
|
||||
+ str(MAX_VELOCITY_MM_PER_MIN_X)))
|
||||
m.do_command(GCode.parse_line("G1Y100F"
|
||||
|
||||
Reference in New Issue
Block a user