Skip to content

Commit

Permalink
disable brake
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Jul 25, 2024
1 parent df2f19b commit ae261af
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/torque_controlled_generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ end

function calc_acceleration(wm::TorqueControlledMachine, speed, force; set_torque=nothing, set_speed=nothing, use_brake = false)
if use_brake
if abs(set_speed) < 0.9 * wm.v_min
wm.brake = true
elseif abs(set_speed) > 1.1 * wm.v_min
wm.brake = false
end
if wm.brake
# if the brake is active the acceleration proportional to the speed
# TODO: check if this is physically correct
return wm.brake_acc * speed
end
# if abs(set_speed) < 0.9 * wm.v_min
# wm.brake = true
# elseif abs(set_speed) > 1.1 * wm.v_min
# wm.brake = false
# end
# if wm.brake
# # if the brake is active the acceleration proportional to the speed
# # TODO: check if this is physically correct
# return wm.brake_acc * speed
# end
end
# limit the acceleration
if ! isnothing(set_speed)
Expand Down

0 comments on commit ae261af

Please sign in to comment.