A Open loop
Command → motor
Two identical motor joints. One follows a command. One checks the result.
Command → motor
Command → measure → correct
Press Run. The dashed pointer is the target; the colored arm is the actual angle.
A larger gap creates a larger push.
Builds the extra drive needed under load.
Brakes fast movement near the target.
This is a spring-return DC motor joint, not a hobby-servo PWM emulator. The spring gives the open-loop plant a finite resting angle. Both plants have the same inertia, damping, spring, voltage limit and external load. The encoder on A is for display only.
Reduced mechanical teaching model: armature electrical dynamics are omitted, and effective damping includes motor back-EMF. Default J = 0.025 kg·m², b = 0.045 N·m·s/rad, k = 0.12 N·m/rad, Kᵥ = 0.12 N·m/V. These are illustrative parameters, not identified hardware. Internal angles use radians; the screen shows degrees.
Error e = r − θ. Gain units: Kₚ [V/rad], Kᵢ [V/(rad·s)], Kd [V·s/rad]. D uses filtered encoder velocity, so a target step does not produce derivative kick. Conditional integration prevents further windup into saturation. Contribution bars clip visually at ±12 V; numbers show the full contribution.
A fixed 10 ms controller step is independent of screen refresh and playback speed. Each control interval uses two 5 ms RK4 plant steps. The controller reads the encoder before each plant advance; live contribution values refer to that most recent control sample. Square period = 8 s; sine period = 6 s. Both start after 0.5 s. All rotations are positive counterclockwise; no artificial angle stop is imposed.
Peak overshoot is the greatest excursion beyond a fixed target, divided by the initial step size, measured so far. It is cleared or marked unavailable after settings or disturbances change. Time inside band is a continuous dwell time, not a guaranteed settling time. The tolerance is max(1°, 2% of the step size). Chart window and CSV retain the latest 120 s of samples.
Background: University of Michigan · DC motor modeling · MathWorks · PID anti-windup. This lab adds a spring-return load and an illustrative reduced model.