MTK Control System with Current Not Working

madtorresga
Mon, 02 Jun 2025 13:00:04 +0000
New to Julia

Hello! I’m trying to implement this exact same example, but controlling with the current that passes through the resistance instead of the speed in speed_sensor.w.

    @equations begin
        #...
       #connect(current_sensor.i, :y, feedback.input2) #not working
        feedback.input2 ~ current_sensor.i
        connect(R1.n, current_sensor.p)
        connect(current_sensor.n, L1.p)
        #...
    end

@named model = DCMotor()

sys = structural_simplify(model)

At structural_simplify it gives ERROR: MethodError: no method matching -(::SymbolicUtils.BasicSymbolic{Real}, ::ODESystem) The function `-` exists, but no method is defined for this combination of argument types.
Since I’ve had similar issues with other implementations, I figured it could be a beginner’s problem.

2 posts - 2 participants