diff --git a/pronsole.py b/pronsole.py index 701529a..b38e72e 100755 --- a/pronsole.py +++ b/pronsole.py @@ -142,7 +142,7 @@ def estimate_duration(g): currenttravel = hypot3d(x, y, z, lastx, lasty, lastz) distance = 2* ((lastf+f) * (f-lastf) * 0.5 ) / acceleration #2x because we have to accelerate and decelerate - if distance <= currenttravel: + if distance <= currenttravel and ( lastf + f )!=0 and f!=0: moveduration = 2 * distance / ( lastf + f ) currenttravel -= distance moveduration += currenttravel/f