r/ControlTheory

Wondering about how to update my Kalman filter

I am making a cybernetic control system using input/output with the use of leontief inverse and using Bayesian with algedonic alerts to refine the model. I can summarize its work as cybernetic control architecture inspired by the cybersyn project made in Chile using Stafford Beers cybernetic planning to calculate output within a sector.

What I've built (working prototype):
• Leontief input-output model with 3x3 technical matrix, solved in real-time
• Bayesian Kalman filter achieving >90% confidence within 20 observations/ticks
• Algedonic alert escalation (Factory → Branch → Sector )
• Opsroom dashboard with live matrix visualization and Chart.js telemetry

Where I'm stuck:

  1. My Kalman filter's process noise parameter is arbitrary what's a principled way to tune it for economic time series that have structural breaks? (1 tick a second)

  2. I'm extending my Bayesian updating from just tracking factory output to also updating the A-matrix coefficients as new production data arrives. Is applying a Kalman filter to each matrix cell individually a reasonable approach, or is there a simpler method I should consider?

reddit.com
u/Salt_Salary_4127 — 7 hours ago

A Nonlinear Systems course for Energy Systems students - what would you put inside?

Hello

I am currently developing a half-semester course on Nonlinear Systems for Energy Systems engineers (renewables, smart grids, power systems, and electrical machines). The students already know standard linear control material, both in state-space and in the frequency domain. The next control course will be on predictive control.

The course is not that long: 6 weeks of 3h per week, which should include both theoretical and practical sessions. I wonder what to put in it. The course should not be overly theoretical but rather provide a useful understanding and develop competencies. Here I list some topics that I think could be included. I really need your opinion on what you would choose and how to balance the theoretical abstractions and practical aspects.

- For sure, I have to talk about linearizations: around a point and along a trajectory. Linearization along a trajectory yields LTV systems, so a bit about the stability of LTV systems.

- Frequency domain linearization - Harmonic balance and describing functions. Not sure if it is really practical, but linear dynamics + a static nonlinearity is common, and understanding the closed-loop oscillations can be good.

- The Small Gain framework is a powerful result, together with the idea of the system gains. It directly yields the Absolute stability, which is a gem for studying the linear dynamics + a static nonlinearity systems and to generalize the Nyquist criterion. Is it practical nowadays?

- Lyapunov stability (and then moving toward ISS) is the standard for theoretical studies, but can be somewhat abstract.

- Passivity, dissipativity, and port-Hamiltonian systems are (in my opinion) tightly connected to power systems and electrical/energy studies. However, it can be somewhat abstract.

- I want to talk about the extremum seeking. Not a standard thing for nonlinear systems, but it is nonlinear, and it is widely used for maximum power point tracking in energy systems.

- Also, I am thinking about an introduction to Fuzzy Systems. I see sometimes marketing sells Fuzzy Logic Controllers, so it can be nice to understand what is inside. On the other hand, today marketing sells AI controllers, so Fuzzy can be obsolete. Not sure, however, if I have something to say about AI-driven controllers.

- Talking about LTV and sector nonlinearities, I want to teach my students the basics of LMIs for Control and show some solvers. It is a powerful numerical tool that they will probably not meet in other courses (I have to check it, actually). It can add value.

So, I have to choose what to put in my 6x3h course (practice included), and I have to be selective. So any advice you have is highly appreciated, especially if you have experience with the Energy System domain.

UPD: there are also such things as AntiWindup or static nonlinearity inversions - rather practical ideas.

reddit.com
u/Arastash — 10 hours ago
▲ 9 r/ControlTheory+1 crossposts

Kalman filtering with state and observation matrix having linearly dependent terms

I'm struggling to find resources on how to approach my problem, likely because I'm not looking for the right terms or do not have the right books. I'm mainly looking for pointers to further reading, I need to really understand this.

I'm trying to filter a "GNSS-like" measurement, except that my observation terms are linearly dependent (or underdetermined? unobservable? - not sure what the correct term is!).

Suppose a 1D-case: I try to solve for a position. I observe pseudoranges to different anchors, and each pseudorange has a common, and an individual bias. The common bias is caused by my local clock errors, and the individual biases are caused by the clock errors of the anchors. Thus,

x = (p_x, b_c, b_1, b_2, ... b_n)

and

y_i = d_i + b_c + b_i

where d_i is the geometric distance, b_c the common bias, and b_i the i-th bias, each expressed in units of distance. In other words, a change in measurement could ether be casued by a change in position, in local, or in remote clock error - it's not known to me (yet) what the correct explanation of change in an observation is.

Now, in GNSS the problem is slightly different: there, the individual bias is negligible, and four (or five) measurements make the system of equations determined. However, in my case, each additional observation introduces one additional bias, meaning that the overall system of equation is always underdetermined.


I'm unsure how to approach this problem. I'm pretty sure it's possible to use a KF-variant to solve this problem, given some assumptions (in particular that the biases are slowly varying and that the common bias is much less stable than the individual ones, i.e. the remote oscillators are much better than my own one). I'm happy with some additional assumptions such as "known stationary at startup until initial biases are estimated", "remote biases are uncorrelated" or "biases are zero-mean", and I also have additional, faulty measuremens from an IMU. My actual problem is more complicated than described, but the simplified 1D-case should be sufficient to describe my fundamental problem, which, when solved, I should be able to extend to the "full" solution.

If this is fundamentally not solvable, it would be really important to know why, and if there are other filtering approaches that allow this.

reddit.com
u/IsThisOneStillFree — 18 hours ago

Our servo drives are creating crazy micro-jitter that’s blinding our optical sensors. Any fixes?

Hi everybody. dealing with a super frustrating issue on a high precision inspection rig we just deployed. On the bench everything looked perfect but in the field, our high res optical and laser distance sensors are throwing erratic readings and random noise spikes.

We hooked up an accelerometer to trace it and realized the problem isn't electrical EMI, but it’s purely mechanical vibration. The compact drives we went with are introducing tiny, high-frequency micro-jitter right at the motor shafts. The vibration amplitude is incredibly small but it’s hitting the exact natural frequency of our sensor mounts and messing up our data.

We tried rubber dampeners and software averaging on the sensor side, but it just adds way too much latency.

Has anyone managed to kill this kind of microjitter directly inside the drive firmware? Do we need to swap out our hardware for something with better current loop sampling and native notch filtering or is this just something you have to live with when using ultra small servo setups?

reddit.com
u/Fantastic-Painter828 — 23 hours ago

Deep Dive into Controls

Hello,

I’m an EEE student who recently obtained a position as a maintenance and controls technician. After my most recent semester, I’ve been shadowing the self-taught engineer at my plant full time. I feel entirely lost as my knowledge in PLCs and electrical wiring is very elementary. Everything that is explained to me feels foreign. For further background, I obtained an automation technology as well as an electronics technology certificate from my local community college. I would like to deepen my understanding in PLC programming, I do have some understanding in Studio 5000 and FactoryTalk. Any great resources or at home lab projects that would help introduce relays, drives, and motors?
Additionally, along with the lower division EE curriculum offered at my local cc, I am also pursuing Cisco CCNA classes. I believe this helps with understanding operational technology.

reddit.com
u/GRIMMMSSS — 1 day ago

Pole placement controller in real PLC

In Uni we did a pole placement controller for a Twin Rotor Motor system, the laboratory equipment however was faulty and we were unable to test it on the real equipment. My question is, how would the pole placement controller be implemented on the real PLC? Also in the Simulink model we had a observer, how would that be implemented in a PLC aswell? And is this kind of controllers actually used in real life systems, or is industrial controls just PID?

reddit.com
u/EpicDuck000 — 2 days ago

What QP solvers have you used for linear MPC in your own projects?

I’m using Python and at this moment prefer using only numpy for linear algebra. So far I’ve implemented the Hildreth QP algorithm which is simple and works for small QP problems without tuning any optimization parameters but I have hard time making other algorithms work (ALM, interior point, active set methods etc.) because they need tweaking parameters. My MPC implementation is in the lifted system matrices form described for example in https://arxiv.org/abs/2109.11986

I know using proven solvers is the common way to get around with this but for educational purposes I’m not going nuclear and use e.g. IPOPT and CasADi just yet. So coming back to the question in the title. Which QP algorithms have you implemented yourself and seem to get good results?

The Hildreth QP is mentioned in these books:

https://www.researchgate.net/profile/Mohamed-Mourad-Lafifi/post/How\_to\_design\_model\_predictive\_controller\_in\_a\_factory/attachment/5d2dae0b3843b0b9825ae2b9/AS%3A781245130735617%401563274762980/download/Model+Predictive+Control+System+Design+and+Implementation+Using+MATLAB\_Wang.pdf

https://sites.science.oregonstate.edu/\~show/old/142\_Luenberger.pdf

reddit.com
u/TimelyScientist2824 — 3 days ago

Why probabilistic code generation scares me for actual hardware

kind of a late night thought while fighting with some embedded C for a feedback loop setup.

Everyone in the broader tech space is completely obsessing over automated code generation tools right now, but ngl, using purely probabilistic models for anything that deals with physical systems feels like a massive safety hazard. if a model has a tiny chance of hallucinating a pointer mistake or an invalid state transition, that is basically a broken actuator or a ruined prototype in our world. We need absolute guarantees, not just "palausible" outputs

I was reading an interesting post about how benchmarks are finally shifting toward strict formal verification instead of just checking if the code compiles. seeing systems progress toward machine-readable logical frameworks where things are mathematically proven before deployment makes way more sense for safety-critical stuff

idk, are any of you guys actually trusting automated code for actual controler implementation yet or are we all still writing every single line by hand out of sheer paranoia?

u/rennan — 4 days ago

Stuck in Radar/Perception but passion is GNC. How to upskill and approach this situation?

Hey everyone,

I hold a Master’s in Robotics and Control with a thesis focused on Model Predictive Control (MPC). My true passion is GNC, but due to the limited number of open positions, I took a job in radar signal processing and perception for autonomous driving.

Right now, I’m struggling. I have zero passion for radars. Because of this, I'm finding it incredibly hard to motivate myself to study and improve after hours; it feels like I'm burning energy on an area I just don't care about. I want to build a strong career and I have plenty of drive to devote time and energy, but I need to channel it correctly.

I want to bridge the gap between where I am and where I want to be. How should I approach this situation?

  • How can I tie my current work in radar/perception (e.g., Kalman filtering, state estimation, tracking) into high-level GNC skills? What should I focus on studying?
  • What kind of advanced GNC/MPC personal projects actually move the needle on a resume when you already have a Master's degree?
  • How do I stay motivated to upskill when my 9-to-5 feels disconnected from my career goals?

Would appreciate any advice.

Thanks!

reddit.com
u/Huge-Leek844 — 4 days ago

How exactly does a Level-to-Flow cascade controller work?

In a level-to-flow cascade arrangement (LC sending SP to FC), I’m trying to understand what the level controller is actually doing.

Does the LC calculate and send a flowrate setpoint to the flow controller?
For example:

  • if level increases slightly → send flow SP = X m³/h
  • if level increases further → send flow SP = X + Δ m³/h

Or is the LC simply increasing/decreasing a 4–20 mA signal to the FC, and the FC interprets that somehow?
Basically, how does the cascade interaction physically and functionally work between the LC and FC in a typical DCS/PLC implementation?

https://preview.redd.it/blo5fjz9y72h1.png?width=382&format=png&auto=webp&s=4115af26d0c5e5b10fcfa4873717464b47121bb1

reddit.com
u/InteractionRude2488 — 3 days ago

Nonminimum Phase Unstable Systems?

Have you ever dealt with nonminimum phase unstable systems? Especially in practice.
If so, what was your aproach to deal with such a problem?

I know that nonminum phase systems (without instability) has the restriction on the controller gain, as a high gain will eventuell drag the stable poles from the LHP to the instable zero positions on the RHP according to the Root Locus of the open loop transfer function.

More problematic is when the system is additionally unstable. And even more problematic when the RHP pole lies right to the RHP zeros. So untill you place a zero/pole after the RHP pole, that path remains within root locus path and thus instability is not compensated.

Is it sound, to draw such conclusions based on Root Locus only? Can a output feedback controller stabilize such a system somehow?

I personally see no other way than using a state feedback controller to shape the dynamics of the whole system by placing the eigenvalues in desired locations. Am I overseeing something minor maybe?

Would like to hear your experience with such systems.

reddit.com
u/airconditioner26 — 5 days ago

Most accessible resources for optimization theory

Hi everyone, could you please suggest the most accessible resources for the students of BS Mechanical Engineering to teach them optimization theory. This could include online resources which take the subject in a very systematic and comprehensive way assuming perhaps only the knowledge of physics and mathematics. I would love to know books also, but most of them are at advanced level.

Many thanks

reddit.com
u/aamir_khaan — 6 days ago

Project help

I’m searching for a highly original engineering project idea focused on sobriety, optimization, and efficiency in electro-mechanical systems.

I’m NOT looking for generic Arduino/AI/smart-home projects.

I’m specifically searching for:
- real systems with energy waste,
- overdesigned mechanisms,
- inefficient power transmission,
- unnecessary material usage,
- poorly optimized control systems.

The project must combine:
- mechanical and/or electrical engineering,
- sensors or feedback control,
- power + information chain modeling,
- optimization under constraints.

Domains:
- motors, hacheurs, power conversion,
- control systems / asservissement,
- sensors & ADC/DAC,
- kinematics & mechanical transmission,
- functional/system analysis.

The final project must remain prototype-feasible for a CPGE/high-school engineering level.

If you know an industrial problem, machine behavior, or niche inefficient system that could inspire such a project, I’d love to hear it.

reddit.com
u/NarrowFlan9248 — 6 days ago

MIT Humanoid – Convex MPC (Updated)

Read Me!

Update Log:

  • Optimized matrix building process before QP solving to fix simulation lag (Now runs much faster)
  • Resolved COP constraint errors to achieve stable heading and yaw control

Next goal: walking on unknown terrain

u/ispaik06 — 7 days ago

Can't reproduce an exmaple from textbook no matter what, Adaptive Dynamic programming / Adaptive optimal Control

Hi everyone!

I am trying to reproduce an example from a textbook step by step, but I cannot get the same result, no matter what i try

The example is about value iteration / adaptive dynamic programming for a discrete-time LQR problem. The system is a 4-state linear system obtained by discretizing a continuous-time model with zero-order hold and sampling time (T_s = 0.01) s.

What the authors say is that they use value iteration and estimate the parameters of (P) online using batch least squares every 15 data points collected from the trajectory. Then they update the controller and continue iterating. According to the book, this converges to the correct Riccati solution. (Exmple is at page 41 of this book :

https://lewisgroup.uta.edu/2019%2006%20RL%20short%20course%20SEU/RL%20papers/Optimal%20Adaptive%20Control-%20Lewis-%20full%20book.pdf)

I tried to reproduce exactly the same procedure in MATLAB, using the same type of quadratic features and solving the least-squares problem every 15 samples, but when I do this I do not have enough independent features to solve the problem correctly. The regression matrix quickly becomes rank deficient or nearly singular because the trajectory converges and the states lose excitation.

If I artificially collect much more data, or use many random resets of the initial condition, or generate many trajectories, then the estimation starts working much better and the learned (P) gets close to the true solution. But the book explicitly seems to suggest that the method works just by updating every 15 points along the trajectory.

And this is my code: https://pastebin.com/YkpUiNYj

These are the result from the book :

https://preview.redd.it/iwvbdmovbh1h1.png?width=709&format=png&auto=webp&s=9fccc356111cbb9aa64d1db02b8e06f59b0c0a5e

And these are mine:

https://preview.redd.it/ph51herzbh1h1.png?width=501&format=png&auto=webp&s=c23d574e53ca6e66ca82ad3eccf9b1b143e7d411

i tried longer simulation time, different initial position, checking for rank but nothing seems to came close to their solution.

Has anyone worked with this before?? Thank a lot for your help!

reddit.com
u/maiosi2 — 7 days ago
▲ 44 r/ControlTheory+3 crossposts

DTC with Third Harmonic Injection as a modulator

I’m currently working on a simulation project based on DTC with Third Harmonic Injection PWM (DTC-THIPWM) for an induction motor drive.

Instead of using the classical DTC approach with hysteresis comparators and switching tables, I adopted a DTC-SVM-style architecture, but replaced the Space Vector Modulation stage with Third Harmonic Injection PWM (THIPWM).
The goal was to keep the fast dynamic response and decoupled torque/flux control advantages of DTC while using a PWM generation method that is simpler and computationally lighter than SVM.

The system behavior is actually good overall:

  • Speed tracks the reference correctly
  • Flux converges nicely to the reference
  • Mean electromagnetic torque converges properly as well

However, the issue is with the instantaneous electromagnetic torque.
Even though the average torque is correct, the raw torque waveform contains a large ripple that I cannot fully explain.

Simulation setup

  • Speed reference: step input at t = 0 s
  • Reference speed: 150 rad/s
  • Load torque: 5 N·m
  • Sampling time: Ts = 1e-6
  • Control period: Tol_Ts = 10*Ts
  • PWM frequency: 2 kHz

What confuses me is that:

  • The PI controllers seem validated since the mean values converge correctly
  • Rotor speed is relatively stable
  • Flux estimation looks fine
  • But the electromagnetic torque ripple remains significant in steady state

At this point I suspect the ripple could be caused by:

  • THIPWM harmonic content
  • Low PWM frequency
  • Torque estimation noise
  • Flux estimation inaccuracies
  • PI interaction
  • Or maybe replacing SVM with THIPWM fundamentally changes the voltage vector quality

Has anyone worked on something similar or seen this kind of behavior in DTC-THIPWM structures?
I’d really appreciate any insight on where this ripple could realistically come from.

u/Basic-Courage-8759 — 8 days ago

Give me some reasons to stop pursuing a career in controls

Hi, I have a bachelor's degree in Electrical and Instrumentation Engineering and an European master's degree in Control systems which I completed in June 2025. I have been searching and applying for Controls related jobs for almost 1 year and I didn't get a single interview.

Im also enlightening myself to control theory whenever I feel forgetting what i studied and developing small self projects often to stay relevant to this field and to add in my CV. But no luck still now.

I don't know what to do next with my European master's degree.🫠

reddit.com
u/zuirattigaz — 10 days ago
▲ 11 r/ControlTheory+1 crossposts

UAV pursuit-evasion diff. game with min-max optimisation

Can anybody point me in the right direction and give me some recommendations for papers, books or videos regarding the topic from the title.

reddit.com
u/DistributionShort649 — 9 days ago

Trouble Understanding Error State Kalman Filter State Transition Matrix

Hello. I am currently implementing a program for a microcontroller to do orientation estimation. I do not have a controls systems background and have been reading up on several papers to understand error state kalman filters and quaternions, though my lack of differential equations knowledge and other subjects has left me stumped on understanding this filter.
Here is the main paper I have been using to understand: https://arxiv.org/pdf/1711.02508

The main question I have is how the state transition matrix is obtained. Here is the discrete transition matrix in the paper:

https://preview.redd.it/42axjswio01h1.png?width=1008&format=png&auto=webp&s=fa24bf0acd9184dc351b662bf161b5662e54d764

They define R as the rotation matrix from a quaternion:

https://preview.redd.it/ror8mwsap01h1.png?width=1008&format=png&auto=webp&s=2a17281592d08d79b10009e165587db58f2bd5a3

What I don't understand is passing in the accelerometer values in equation 311; on the 3rd column and 3rd row, they pass in the measured accelerometer minus the accelerometer bias into this rotation matrix equation. Is this meant to be obtained from the roll and pitch values?... Also for the other R values in the equation, is that just assumed to be my orientation equation from the gyro? And is it appropriate to use accelerometer values in the state transition matrix if the goal is to just do orientation estimation?

A lot of my confusion comes from looking at different implementations and other papers of the same problem (orientation estimation, sometimes with position as well). The F matrices I see in these implementations look nothing like what I have seen on here, and I am not really grasping how this transition matrix very well. I've looked at several resources and am a bit overwhelmed by the differences.

Any help would be greatly appreciated, thank you ^^

reddit.com
u/ComplexMotives99 — 10 days ago

Are there different compensation tiers for Control Engineers like there is in Software?

So I was reading a post about how tech compensation has different "tiers", where similar roles can have wildly different compensation depending on the company type. E.g.: a SWE will make more at a hedge fund than at FAANG, and more at a FAANG than at a traditional company.

Is this also true for Controls/GNC? I've always had the impression that basically all companies have broadly the same pay ranges, with bigger companies paying at most 10-20% more for similar positions, with most of the compensation difference coming from experience.

u/1t_ — 10 days ago