limit min velocity

This commit is contained in:
Nikolay Khabarov
2017-07-01 03:14:45 +03:00
parent 1c88c8ad41
commit e441b5dc1f
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -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
View File
@@ -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,
+2
View File
@@ -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"