Skip to content

Commit

Permalink
add wcs to TorqueControlledMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed Dec 19, 2024
1 parent 8dc7b38 commit cae5396
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/WinchModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract type AbstractWinchModel end
const AWM = AbstractWinchModel

include("async_generator.jl")
include("torque_controlled_generator.jl")
include("winch_controller.jl")
include("torque_controlled_generator.jl")

end
5 changes: 4 additions & 1 deletion src/torque_controlled_generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Model of a winch with an torque controlled generator and a gearbox.
"""
@with_kw mutable struct TorqueControlledMachine <: AbstractWinchModel @deftype Float64
set::Settings
"winch speed controller"
wcs::WinchSpeedController
"minimal speed of the winch in m/s. If v_set is lower the brake is activated."
v_min = 0.2
"linear acceleration of the brake [m/s²]"
Expand All @@ -43,7 +45,8 @@ Model of a winch with an torque controlled generator and a gearbox.
end

function TorqueControlledMachine(set::Settings)
TorqueControlledMachine(set=set)
wcs = WinchSpeedController(;kp=set.p_speed, ki=set.i_speed, dt=1/set.sample_freq)
TorqueControlledMachine(set=set, wcs=wcs)
end

# calculated the motor reactance X [Ohm]
Expand Down
2 changes: 1 addition & 1 deletion src/winch_controller.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DiscretePIDs
# low level winch controller; this code will be moved to WinchControllers.jl in the future
# low level winch speed controller

mutable struct WinchSpeedController
kp::Float64
Expand Down

0 comments on commit cae5396

Please sign in to comment.