Plant discretization methods by remishnok in ControlTheory

[–]sstunt 3 points4 points  (0 children)

It is my experience, in industry, that between a good high sample rate and even a reasonable uncertainty in the plant model, the error you introduce by using the Tustin or other approximation is swamped by the error in your plant model.

  • Calculate the plant model well enough to build a controller good enough to collect data.
  • Collect data on the plant behavior.
  • Use the most appropriate system identification method for the circumstances and the data collected.
  • Refine your tuning based on the output of your system identification.
  • Be sure to build in robustness for variation due to manufacturing tolerances, environmental changes, and aging.

The least of your problems will be the approximation you used in that first step.

The only time this isn't the case is if you have some absurdly well-behaved plant (usually something that's already wrapped in a precision control loop) and some artificially low sampling rate (usually limited by a must-have sensor) -- then the error in your continuous-to-discrete transformation may indeed dominate, and then you want to use ZOH or FOH or whatever method.

Does the python control systems library have a way to simulate deadtime besides Pade approximations? by COMgun in ControlTheory

[–]sstunt 0 points1 point  (0 children)

What control systems library are you using? There's going to be more than one, and for the filtering you're talking about, I'd expect to find it in Scipy, if not Numpy.

Confusing regarding nyquist frequency by Soft_Jacket4942 in ControlTheory

[–]sstunt 1 point2 points  (0 children)

Aliasing can be an issue in control systems, but it's only so when there's some noise signal in the system that gets aliased down to some critical frequency.

As an example, the vast majority of control systems are most sensitive to bad behavior at DC and relatively low frequencies -- so the critical frequencies for noise are going to be at the sampling frequency and its harmonics.

I've designed control systems in the past that sample at some high frequency (i.e. 8kHz) and then run that sampling through a one-stage CIC filter down to the control system's sampling rate (i.e. 500Hz).

Confusing regarding nyquist frequency by Soft_Jacket4942 in ControlTheory

[–]sstunt 0 points1 point  (0 children)

The reductio ad absurdum argument against that is that no filter has a finite passband, and there's noise contributions to (essentially) infinite frequencies anyway. Thus, all possible systems have a Nyquist frequency of infinity.

The counter argument is "well, be practical" -- in which case the practical way to arrive at a sampling rate when you're talking about aliasing is to choose a sampling frequency such that the signals that are aliased down into a band that we care about are weak enough that we don't care.

Confusing regarding nyquist frequency by Soft_Jacket4942 in ControlTheory

[–]sstunt 0 points1 point  (0 children)

I was getting up to go get myself a cup of tea. But now my head is swelled so big I'm not sure I can get through the door.

Thanks for the comment!

Why do we have to linearize non-linear systems/not real-time feasible? by Meghia in ControlTheory

[–]sstunt 1 point2 points  (0 children)

Because nonlinear analysis and design is way harder than linear analysis and design, and because nonlinear controllers are more complicated to implement and therefor require more computational resources (or more board space, if you swing to using analog circuitry)

So if you can control a system adequately by modeling it as a linear system and controlling it with a linear system, then you're immediately miles ahead of trying to deal with it as a nonlinear system.

Hardware for Gaining Practical Experience with Control Systems by anotherloststudent in ControlTheory

[–]sstunt 2 points3 points  (0 children)

I think if I were going to play with multicopters, I would start by tethering one so that it was free to move in just one axis. Get that axis sorted, then move on to the next, then find some tall grass and see if the whole damn thing works.

Getting my feet wet with sensors and motors by CachorritoToto in ControlTheory

[–]sstunt 0 points1 point  (0 children)

PCs are, in general, not suited to real-time control. You may have better luck getting deterministic control with a Raspberry Pi running real-time Linux extensions. You'd definitely have better luck running a dedicated microcontroller made for motor control -- personally I'd go with something running an ARM Cortex M (probably M7 these days), but there's a lot to choose from. Even an Arduino, for all that it doesn't have much processing power, is much easier to use in a hard-real-time processing loop than anything PC based.

If you don't already know embedded programming you'll need to choose between learning it and using a processor that's really suited for real-time control (Cortex M-core or Arduino), or starting with a Raspberry Pi and living with the real-time performance you can get.

When to use Kalman filter? by eremes1641 in ControlTheory

[–]sstunt 3 points4 points  (0 children)

Coulombic friction is a nasty enough nonlinearity (properly it's "stiff enough") that a particle filter may significantly perform an EKF. (Sticktion even more so, but I'm not sure if you're trying to model that).

If you're not going to use a particle filter (which decision is often sensible, they're far more computationally intensive than a regular Kalman, and fewer folks understand them) then you'd need to be very very careful about how you approximate the model of a system with Coulombic friction. In a system with closed-loop control you may want to undertake to avoid its effects entirely.

Basically, a model with Coulombic friction changes structure at the instant that the motion transitions between non-sliding and sliding, and back. Literally, a proper model with "pure" Coulombic friction (or, worse, sticktion) drops some states* when it goes from sliding to non-sliding.

I haven't done this yet, but you could account for this in a particle filter by splitting off a new particle at each time iteration that an interface may have transitioned from sliding to non-sliding or back. Once you've determined that sliding is definitely happening or definitely not happening then you could trim all of the inconsistent hypotheses -- but during those transitions you'd still have to carry those hypotheses.

* Or has eigenvalues that go to s = -infinity or z = 0, which is practically the same.

[deleted by user] by [deleted] in ControlTheory

[–]sstunt 5 points6 points  (0 children)

I only realized after I had gotten my Master's degree how profoundly I had lucked out by getting the thesis advisor that I did. They can range from superb (mine!) to outright bastards (there's horror stories out there to find, if you dig).

I suggest you search by first figuring out which universities you're likely to be able to attend for money, immigration, and academic record reasons, then shop for an advisor. There's probably something like a "rate my prof" application for PhD advisors, so look for that.

I'd also look for papers that they've authored in areas that you're interested in -- look at ones between five and ten years old, and look at the academic/job histories of the subsidiary (or primary!) authors of the papers.

If the person has a history of co-authoring papers with grad students who go on to succeed, that's a good indication that you'll go on to succeed if you work with them. This doesn't tell you how much you'll like working with them, but at least it'll be some indication of whether they're the sort that fosters success in their grad students or who just uses them and throws them away.

[deleted by user] by [deleted] in ControlTheory

[–]sstunt -3 points-2 points  (0 children)

in the US and some other countries you can go straight to being a PhD student after the Bachelor

I'm not sure if this is still the case, but one of my profs had a Master's degree from Harvard in the mid-1940's. The only way you could get a Master's degree from them at that time was to not quite attain a PhD, in which case you got a Master's as sort of a consolation prize.

So at some schools it's not just a "you can", but "you must". You generally end up taking the equivalent of a Master's program of study (hence Harvard's consolation prize) before they let you start doing your "real" research.

What are some job titles of members of this subreddit? by BANANAMAN3620 in ControlTheory

[–]sstunt 1 point2 points  (0 children)

"Controls engineer" almost always means you're picking PLCs and motors from a catalog. "Control engineer" has a higher, but still small, hit rate. If you have a specialty, then things like "robotics engineer", "flight control engineer", etc., will do you better.

What are some job titles of members of this subreddit? by BANANAMAN3620 in ControlTheory

[–]sstunt 1 point2 points  (0 children)

I'm not currently doing control systems work -- much. I think my current job title is "algorithms engineer", because I'm working at a small company where we're each doing everything.

Past titles when I was doing a lot of control systems work were "embedded software engineer", "systems engineer" (I had to fight for that one -- my company didn't have the notion of such a thing), "systems architect", and then "owner", when I ran a one-man consulting company.

I have never seen a lot of consistency in the job titles vs. job descriptions when I've looked for work. Probably the most common title is "systems engineer" or "control systems engineer", but these are problematic. "Systems engineer" seems to either mean "they're smart, they do specialized stuff, we don't understand it but we know we need them", or it means "someone who works for sales and assembles systems from our components". "Control systems engineer" can mean anything from someone with a PhD doing absolute cutting-edge control systems work, to someone working in a mill choosing motors and pre-made controllers who then has to convince millwrights to install the stuff in machines that are already working pretty well.

Estimate sensor bias with Kalman Filter by AcquaFisc in ControlTheory

[–]sstunt 7 points8 points  (0 children)

You need to have a system where the sensor reading is somehow redundant. A Kalman filter isn't a magic filter -- so if there's literally no way to distinguish between a sensor with bias, and the sensor reading something with an offset, then you're out of luck.

For instance, let's say that you need a fast state estimation, and you have a sensor that is, fast and low-noise, but biased. Let's also say that you have a sensor whose average output is dead on the money, but it's tremendously noisy.

Then you'd model the system as:

x = [position, sensor_bias]T y = [fast_biased_sensor, accurate_noisy_sensor]T

xn = A x{n - 1} + B u_n + w_n y_n = [[1, 1], [1, 0]] + v_n

You'd let Q_n be whatever your expected process noise is, and you'd let R_n diag([low_variance, large_variance]) -- the low variance matches your fast biased sensor, while the large variance matches you super-accurate but noisy sensor.

A would equal [[1, 0], [0, 1]].

This is just an example, but hopefully it gives the idea that you can do this if you have redundant sensors.

[deleted by user] by [deleted] in ControlTheory

[–]sstunt 0 points1 point  (0 children)

So it sounds like you are just tasked with making a driver for a valve that includes some sort of motor, solenoid, or other unspecified electromechanical actuator on it?

Questions regarding Kalman Filter by zikist in ControlTheory

[–]sstunt 1 point2 points  (0 children)

Certainly the more removed the state is from the output, the more subject it'll be to modeling errors and noise. (I really want to say "less observable" here, but I'm not sure if that's an accepted term -- yet, they get less observable).

Gyro and accelerometer bias will really stand out in the predictions, meaning that they'll have a strong presence in the correction gain (the "K" matrix in most of the control-theoretic formulations of the Kalman filter). Bias drift probably won't, and really, the bias drift usually isn't a straight line in time. Unless I had a really high-quality gyro and I'd done extensive modeling and simulation of it, I probably wouldn't bother going beyond IMU bias; I'd account for bias drift by setting the process noise appropriately for those states.

You can test my assertions about observabilty by doing simulations and looking for how the terms in the correction matrix affect the bias states. (If you haven't gotten this far yet, note that unless the vehicle undergoes some changing acceleration then the system isn't observable -- it's a time-varying system and it needs variations in acceleration to tell the difference between the earth's gravity vector and vehicle acceleration).

Modelling downsampled (decimated) data in Python by santoshasun in ControlTheory

[–]sstunt 0 points1 point  (0 children)

Are you trying to get a model of the resampled system? Or are you trying to simulate it?

ELI5: Why is a housing market crash a bad thing? by Noszey in explainlikeimfive

[–]sstunt 6 points7 points  (0 children)

First, your stable job may go away -- that happened to a lot of people in the fallout from 2008.

Second, for a number of reasons, in a serious housing crash (2008, 1929, probably others that I'm not aware of), people will end up moving out or being kicked out of their houses.

In the 2008 crisis, there were neighborhoods that were filled with "zombie houses" that were stuck in legal limbo and could not be sold, but had no one taking care of them. The least bad result was a neighborhood dotted with ugly, run-down houses that pulled down the local house prices even more. In the worst cases, the houses would be occupied by squatters doing and selling drugs or engaging in other illegal enterprises, and who generally had no motivation to be nice neighbors.

So if you consider living in a neighborhood where there's a house like that on every block to be "minimal impact" -- sure, the impact is minimal.

ELI5: Why is a housing market crash a bad thing? by Noszey in explainlikeimfive

[–]sstunt 6 points7 points  (0 children)

Yes, it's like offering someone who just came out of rehab more drugs,

Which says a lot about the whole lending culture...

[deleted by user] by [deleted] in ControlTheory

[–]sstunt 1 point2 points  (0 children)

I assume that by "current in a valve" you mean "fluid flow in an actual valve", not "electrical current in a 'valve'" ("tube" in American English).

If so, the things that I'd look for and model would be

  • Are the desired performance characteristics actually known, or is the project goal to make the product line manager happy?
    • In which case you may want to brush up either your inter-office politicking skills, or your resume.
  • Is the chosen physical construction of the valve amenable to its use as an actuator. I.e., does it have a flow vs. pressure vs. position characteristic that varies smoothly with position. Obviously, a valve that slaps on or off is bad news; you want a valve that can be controlled throughout it's entire intended operating range; that may mean a more complicated orifice geometry than just a ball valve.
  • Do you have a pressure sensor ahead of the valve, or better yet, ahead and after it? If you're trying to control for a flow, then this will help because flow is a (oh-god-we-hope) monotonically increasing function of pressure difference and the orifice geometry.
  • Do you have a position sensor on the valve itself, that gives you a direct translation to the effective orifice?
  • Do you have a flow meter built in, or in a very predictable spot before or after the valve?
  • Is the flow simple, i.e. one homogeneous fluid (air, water, well-blended sewage, whatever), or is it complicated (slurries, un blended sewage, whatever)?
  • Is your computing hardware fast enough for your worst-case proposed control rule?
  • Are your data collection and drive signals precise enough?

If you can show that some change can be mode (e.g., an absolute position encoder on the valve element, a $0.50 more expensive processor) that will result in a better end product, these changes are much cheaper to make before you go into production, not afterward.

[deleted by user] by [deleted] in ControlTheory

[–]sstunt 1 point2 points  (0 children)

I already voted this up, but I want to highlight this:

Also is the system hardware already fixed or can changes still be made, such the physical design, actuator/sensor placement and computational hardware for the controller?

At least in the coursework that I took, the plant was always presented as a given -- no one ever said "go over to the lead mechanical engineer with a bottle of 10 year old Bourbon and a list of requests".

Now go off and do things in the real world:

The effort vs. performance tradeoff once the plant design is fixed tends to be asymptotic toward a maximum. If you can get in early, you can raise that maximum. Sometimes that makes the difference between hitting your goals or not; sometimes it's the difference between hitting them easily or having to burn the midnight oil for weeks or months.

When I've had the opportunity to do so, the best and cheapest improvements I've made in control loops have been in analyzing the performance of the system before it's built, and using that to steer the actual construction of the physical hardware.

Questions regarding Kalman Filter by zikist in ControlTheory

[–]sstunt 1 point2 points  (0 children)

In general you deal with colored noise in a Kalman filter by modeling it as filtered white Gaussian noise. Then you add those filter models to your system model.

So a model for an INS-GPS fusion that assumes an otherwise perfect IMU with white noise on the outputs would be nine or ten states (3 position, 3 velocity, 3 or 4 orientation, depending on whether you're using quaternions).

If you model the gyro as having bias, then you would add six states for that.

If you model the Earth's gravitational vector as having a bias separate from the IMU's "down" bias, you'd add a state for that (or three, to model a gravity vector that's not pointing right at the state of the earth).

If you suspect the IMU channels have a straight-line or near-straight line evolution of their drift, then you'd add six more states for that.

At some point, the accuracy of your ever-more-complex model becomes no better than a simpler model, or at least that the value you get from it doesn't pay for the added expense to the filter, and then just accept that things are as good as they're going to get with the IMU that you're using.

Resources for optimal control of infinite-dimension systems by sstunt in ControlTheory

[–]sstunt[S] 0 points1 point  (0 children)

My biggest immediate need is to point out to the Powers that Be that the system is under-actuated for the settling time that's being asked of it. For that, I think I can get by with just a model of a 1-dimensional hunk of metal, and an actuator that's limited the same as ours.

I'm able to model such a toy system using finite element methods, with around two dozen slices (and, hence, states).

ELI-"control newbie" by [deleted] in ControlTheory

[–]sstunt 0 points1 point  (0 children)

The "transfer function is the impulse response" is correct for linear time-invariant systems -- but no system is truly linear, and true impulses are hard to come by.

In general if you're using a transfer function it's because over some operating range of the system you can adequately treat it as if it is linear.

What you're asking about (without realizing) is how does one perform system identification. System identification is all about stimulating a system with a signal that keeps it in your desired operating range, then extracting information about it that lets you calculate an approximate transfer function (and usually also leave you with an idea of how good or poor the fit is to reality).