When Your Control Systems Final Becomes a Multi-Day Journey with AI
For non-engineers, hereβs what makes a controls final exam brutal: youβre not just solving equationsβyouβre designing a system that has to actually stabilize something unstable. Itβs the difference between calculating trajectory and actually landing the rocket.
That was my reality this week as I worked through my ME 5281 Final Examβa chemostat control system design problem spanning three days of linearization, full state feedback, observer design, and classical control theory. The kind of exam where youβre not just plugging numbers into formulas, but actually building something that has to work.
The Problem: A Bioreactor That Wonβt Cooperate
The exam centered on controlling a chemostatβessentially a bioreactor where youβre trying to maintain stable bacterial populations by controlling nutrient flow. The nonlinear dynamics look deceptively simple:
αΉ
= u - kβna
Θ§ = Ξ±kβna - kβab - kβa
αΈ = Ξ²kβab - kβnb
Where:
- n = nutrient concentration
- a = concentration of bacteria species A
- b = concentration of bacteria species B
- u = nutrient flow rate (our control input)
- kβ, kβ, kβ, kβ, Ξ±, Ξ² = reaction rate constants
Three states, one input, one output. I expected this to follow the same pattern as our homework problemsβderive the linearization, compute some gains, done in an evening.
Instead, the system had unstable equilibrium points that sent my simulations spiraling to infinity. The linearization involved partial derivatives with interacting terms that didnβt simplify cleanly. And the Simulink implementation required carefully tracking whatβs a deviation variable versus an absolute value. What I thought would take four hours stretched across three days.
Where Claude Code Actually Helped
Iβve been using Claude Code throughout this course, and this final pushed our collaboration to its limits. Hereβs what I learned about working with AI on complex engineering problems.
The Insight That Matters Most: Tool Boundaries
Claude Code canβt run MATLAB or Simulink. It can explain concepts, derive equations, and even write MATLAB code, but when it comes to actually connecting blocks and debugging why your integrator is blowing up, youβre on your own.
I spent roughly six hours on what should have been straightforward Simulink work. The exam required screenshots of working simulations, and no amount of AI assistance could replace actually building and testing the model. This is the irreducible core of engineering education: some knowledge only comes from watching your simulation explode and figuring out why.
The Good: Conceptual Clarity
When I was struggling to understand the feedback structure, Claude Code generated this ASCII diagram that finally made the signal flow click:
setPoint (x_o) ββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββββ
β βΌ β
β error βββββββ βββββββββ β
β βΌ β Ξ£ β β
β βββββββββ βββββββββββ ββββββββ β + + + ββββΊ u β
β β Ξ£ β β 1/s β β Ki βββββΆβ β β
β β + - βββββββΆβIntegratorβββββΆβ Gain β βββββββββ β
β βββββββββ βββββββββββ ββββββββ β² β
β β² β β
β β y (output) u_o ββββ β
β β β² β
β β -K*(x-x_o) βββ β
β β β² β
β βββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββ
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Full state feedback: x from observer or plant
Sometimes you just need someone to draw the picture differently. Iβd been staring at the same block diagram in the lecture notes for hours, but seeing it redrawn with explicit signal labels made the u = -K*(x - x_o) + Ki*xi + u_o structure suddenly obvious.
My original misconception was that the integral term Ki*xi was somehow separate from the feedback loopβIβd been thinking of it as a feedforward term. The diagram made clear that the integrator is processing the error between setpoint and output, accumulating over time to eliminate steady-state error. Thatβs when I finally understood why my first Simulink model wasnβt tracking the reference: Iβd wired the integrator to the wrong signal.
The Unexpected Insight: Grading My Own Work
At one point, I asked Claude Code to review my submission and βgive it a grade.β This turned out to be surprisingly usefulβnot because the grade mattered, but because it forced me to explain my work clearly enough that someone else could evaluate it.
The review confirmed several things Iβd done correctly:
- My A matrix had the expected structure (A[2,2]=0, A[3,3]=0 at equilibrium)
- The eigenvalues showed the expected unstable behavior: -0.83, 0.0643Β±1.5227j
That last point deserves explanation: a system is unstable when any eigenvalue has a positive real part. The complex pair 0.0643Β±1.5227j has a real part of +0.0643, which means perturbations from equilibrium will grow exponentially rather than decay. This is why the chemostat needs active controlβwithout it, bacteria populations will oscillate with increasing amplitude until the system crashes.
But the review also caught concrete issues Iβd missed:
- One of my transfer function derivations had a sign error in the numerator
- Iβd stated a controllability result without showing the rank calculation
- My explanation of pole placement referenced equations that werenβt in the document
I fixed all three before submitting.
What Iβd Do Differently
These insights arenβt afterthoughtsβtheyβre hard-won lessons from watching things go wrong.
Start with the end in mind. On day one, I dove straight into the analytical work: linearization, eigenvalue calculation, gain derivation. By day two, when I finally opened Simulink, I discovered that my equilibrium point calculation had a subtle error that propagated through everything. If Iβd built a simple simulation firstβeven just the open-loop nonlinear systemβI would have caught this immediately by noticing the state trajectories didnβt match my predictions.
Use Claude Code for verification, not just generation. My most valuable interactions werenβt βsolve this problem for meβ but βhereβs my solutionβdoes this make sense?β When I asked Claude Code to derive the A matrix independently, its result matched mine, which gave me confidence to move forward. When I asked it to check my observer gain calculation, it found the sign error I mentioned above.
Accept the toolβs limitations. There were several moments where I tried to describe a Simulink error message to Claude Code, hoping for a diagnosis. The responses were reasonable guesses but ultimately unhelpfulβthe actual problem was always something about how Iβd connected the blocks, which couldnβt be diagnosed without seeing the model. I eventually learned to treat Simulink debugging as solo work.
The Takeaway
If youβre using AI tools for engineering coursework, hereβs my honest assessment: theyβre excellent for understanding concepts and catching algebraic errors, but they canβt replace the hands-on experience of implementation.
The feedback controller equation u = -K*(x - x_o) + Ki*xi + u_o looks simple on paper. Understanding why each term exists, how they interact, and what happens when you wire them up wrongβthatβs where learning actually happens.
Claude Code helped me get there faster, but the final exam still required me to demonstrate that I actually understood it. Which, after this week, I think I finally do.
Update: Final grade: 94%. The points I lost were on the observer design sectionβspecifically, I didnβt adequately justify my pole placement choices. Another lesson for next time: the why matters as much as the what.