     end
   end
 
-  defp max_retries do
-    case param_read(:param_mov_nr_retry) do
-      {:ok, nr} -> floor(nr)
-      _ -> 3
-    end
-  end
-
   defp assert_axis!(axis) when is_atom(axis),
     do: axis
 

    do: String.to_existing_atom(axis)

  defp assert_axis!(axis) do
    # {:error, "unknown axis #{axis}"}
    raise("unknown axis #{axis}")
  end
end

        {:error, "emergency_lock"}

      {:error, reason} ->
        handle_movement_error(reason)

      reason ->
        handle_movement_error(reason)
    end
  end

  def handle_movement_error(reason) do
    msg = "Movement failed. #{inspect(reason)}"
    FarmbotCore.Logger.error(1, msg)
  end

  def calibrate(axis) do
