numerical methods for calculating PID equivalent functions

Hi,

Can a partial differential equation be numerically calculated to give a function that is equivalent to a PID loop for controlling a multivariable system (ie a lunar lander with yaw/pitch/thrust to land on a given X/Y coordinate from a given altitude)?

Do partial differential equation solvers ie for the heat equation, also work for large numbers of variables, ie 10?

Is this method useful for this:

formatting link

Also does anyone know of existing code or a website that can be used to generate these types of solutions?

cheers, Jamie

Reply to
Jamie M
Loading thread data ...

Numerical integration is routine, and can be pretty accurate (if you are ca reful to avoid pathological situations, like dividing by zero).

My Ph.D. work used the Fletcher-Powell multi-parameter non-linear curve fit ting procedure to find the three paratetmeters (starting concentration, end

-concentration and rate constant) that fitted a numerically integrated rate constant to a string of observed reagent concentrations.

You need more observation than parameters to get a unique solution, and the observations do have to constrain all the parameters - I could reliably ex tract three parameters from my strings of several hundred observations,but trying to extract a fourth - the thermal resistance of the reaction medium

- left me with confidence limits rather larger than my parameter space.

That's kind of basic. The nice part of Fletcher-Powell least squares minimi sation is that it documents the least squares surface around the best-fit p arameter set, which allows you to extract confidence limits on how well you r data defines your parameters.

Straight numerical methods can get you to the same solution, but they don't tell you how reliable/sensitive it is.

Mu Ph.D. thesis cites H.H Rosenbrook and C. Storey's "Computational Techniq ues for Chemical Engineers" Vol 7 in Pergamon's International Series Monogr aphs in Chemical Engineering from 1964, but it wasn't the only, or the most useful reference I used (which was probably the M.Sc. Thesis written by on e of the demonstrators in the Theory of Computation Course that I took at t he time.

There should be lots of stuff around, but I'm way out of touch with that ar ea.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

Sounds an awful lot like a quadcopter navigation problem -- you may find lots of current work there in the form of University senior projects.

For a lunar lander-ish problem it'd be yaw, pitch, _roll_ and thrust -- you need to control all three axes of rotation. At some small loss of optimality you could separate thrust in the direction of gravity from side thrust, the one controlled primarily by throttling the main motor, and the other controlled by pitch, roll, and (indirectly), yaw.

--
www.wescottdesign.com
Reply to
Tim Wescott

Hi,

Maybe some software like this would work?

formatting link

(also has specifiable accuracy)

cheers, Jamie

Reply to
Jamie M

Hi,

I was thinking that an N-dimensional matrix could be used maybe, where each input variable is a dimension in the matrix and quantized to say

10 different values for each variable (or more if required for higher resolution). Once this matrix is built it will hold all the possible quantized states of the system, including initial state, final state and any intermediate state (the matrix could be very large if there are many variables). All that is required to finish the algorithm is to find a good path through the matrix by moving one row/column at a time from the initial state to the final state. This could be calculated real time with a path finding algorithm that tries to maximize/minimize calculated values based on the variables, or else it could be found via by exploring many possible paths and narrowing the number of them down as they become impossible due to being a dead end, ie not able to traverse to the end state, which may or may not require pre-written rules to limit valid traversal paths.

Building up a big state matrix like this might start to be similar to building a neural network, which makes sense as they are used for control algorithms too, but to limit the matrix size, they use techniques like this:

formatting link

(wild brainstorming mode off!)

cheers, Jamie

Reply to
Jamie M

if you have a MIMO (multiple inputs, multiple outputs) system and you can completely identify the system, the best is to use a "state control system".

For example:

formatting link
formatting link

Bye Jack

--
Yoda of Borg am I! Assimilated shall you be! Futile resistance is, hmm?
Reply to
Jack

Not a good idea. "Hill climbing" methods go from plausible solutions to better solutions, and - for well-conditioned problems - can get to the best solution remarkably quickly.

Scatter-gun searching in multi-parameter space can use up a lot of time to get someplace that isn't all that interesting.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

Hi,

Thanks, I recall Tim Wescott mentioning this a long time ago to me, but I settled on a simple PID loop doh! :)

cheers, Jamie

Reply to
Jamie M

yep, 95% of the time a PID is quite enough :)

Bye Jack

--
Yoda of Borg am I! Assimilated shall you be! Futile resistance is, hmm?
Reply to
Jack

Hi,

I am actually thinking of something more like the state space control system, but with all the MIMO states in the matrix, and possibly hierarchical matrices as well depending on if the system can be broken down hierarchically.

So for a system with yaw/pitch/roll/throttle1,2,3,4 (total of seven dimensions) for acrobatic quadcopter control for example, if each variable is given 100 possible states, that is 10^14 elements in the 7 dimensional matrix corresponding to each of the possible state configurations.

This matrix would be configured as a spare matrix, so that all elements are empty and unallocated until filled to save space.

Now the next step is to fill "good" states, so to do that either a real or simulated quadcopter flight (or large sets of flight data) are loaded into the matrix for the specific quadcopter being used. This will generate a lot of data in the matrix, but still it will be 99.9%+ empty, and the generated data will be valid flight data only.

Once the flight data is entered a data mining type algorithm can be used to generate "traversal paths" within the 7 dimensional matrix that are weighted based on how traveled the state space is from one area to another, this would correspond to common maneuvers correlated to all the other state space variables.

Once all these valid paths are identified, they can be used for actual autonomous control of the craft.

For autonomous flight, by looking at the actual yaw/pitch/roll of the quadcopter, this can be referenced to all the states in the 7 dimensional matrix that have similar yaw/pitch/rolls, and then based on the desired outcome (ie stabilize the craft pitch/yaw/roll to zero degrees) the set of traversal paths that can likely accomplish this can be selected from, and the actual yaw/pitch/roll towards zero can be recorded back into the state space table to reenforce this path (the next time it is calculated from the "data mining" or "path fitness" algorithm), ideally this would run in real time to update the state space continuously.

This system can be paired with specific simplified "pre known" common acrobatic maneuvers that can be mapped onto the larger state space in a somewhat experimental way to aid in automatic learning of maneuvers, like a training manual or dictionary of valid flight maneuvers.

These state spaces can be built hierarchically, ie this acrobatic/stabilization state space can exist somewhat independent of a higher level state space that is used for higher level navigation or specific mission goals etc.

The lower level state spaces are more concerned with craft survival in this case, ie restricting the craft to allowable safe maneuvers, while the higher level state spaces might be concerned with survival in reference to the ground or max velocities/altitudes etc, and next higher level state spaces would be for waypoint following or mission goals, but the low level state spaces would always take priority, but could have feedback from higher level state spaces to influence the specific state space traversal path taken.

geez I thought I turned brainstorming mode off :D

cheers, Jamie

Reply to
Jamie M

oops meant to say "sparse matrix"

Reply to
Jamie M

nope. As far as I remember (long time passed since I did something similar) and understand your problem your copter will have 6 degree of liberty (x,y,z axes + yaw,pitch,roll) that that describes the current state of your system. The system will have also 4 output (the throttle for the 4 propeller) that are used to modify the current state of your system (aka, move the copter around).

The problem in using the state-space controller is to get a working model of the system, that means write down the differential equations that destribes the system. Sometimes it pretty easy, sometimes is really difficult. For a copter it should be doable (and there is plenty of information out there).

Bye Jack

--
Yoda of Borg am I! Assimilated shall you be! Futile resistance is, hmm?
Reply to
Jack

Instead of using the "data mining" or "path fitness" algorithms to find good traversal paths in the n-dimensional matrix, it might be better to just calculate the vector from the current state (single n-dimensional matrix element) to the desired state (single n-dimensional matrix element), and then split the vector into subvectors so that intead of a n-dimensional straight line, it becomes a segmented line that is curvefit onto matrix elements along the path that are filled as valid flight states (most of the sparse matrix is not filled). Since these valid matrix states aren't an exact match for the actual flight, each timestep the actual aircraft sensors should be used to update the current state in the n-dimensional matrix and adjust the segmented line traversal path.

cheers, Jamie

Reply to
Jamie M

Hi,

I am trying to make a hybrid solution, instead of calculating the differential equations for a specific system, I am trying to come up with a system that is essentially an n-dimensional lookup table, that is programmed by realworld data.

cheers, Jamie

Reply to
Jamie M

It is much better to try and recast your problem so that you can find the eigenvalues and vectors of the control matrix. That way you stand some chance of understanding its stability and converting what you want to do into commands to the control surfaces quickly enough to be useful.

Your chopper will have fallen out of the sky by running out of fuel before you can invert a 7D matrix with 100 elements each direction.

Fuzzy logic methods can work for these sorts of problems on a roughly up, slightly up, same, slightly down, down basis and have been used to stop trains exactly at the mark every time. I have also seen fuzzy logic do some bizarre things even the developers could not explain.

--
Regards, 
Martin Brown
Reply to
Martin Brown

The number of rules you need goes up pretty fast with the number of dimensions, though. For my money, it would be singular-value decomposition of a linearized problem, leading to a reduced number of control parameters. Of course there are situations where that won't work, e.g. if your quadcopter gets upside down or something like that.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

The Sun will finish his fuel before you can do that ;)

Bye Jack

--
Yoda of Borg am I! Assimilated shall you be! Futile resistance is, hmm?
Reply to
Jack

That's not state-space control. I don't know what it is, but it's not state-space control.

>
--
www.wescottdesign.com
Reply to
Tim Wescott

I'm not sure what problem you're trying to solve with this.

If you know the current state of the vehicle (position & velocity, angle & rotational velocity, three axes each), and you know where you want the vehicle to go, then your known current state and your target state should be able to feed a simple function that says which rockets to fire (assuming that you're firing rockets).

Assuming that you're not estimating the vehicle state, you're putting 16 inputs into a function and getting 4 out. It's a nonlinear problem because there's rotations involved, so there's not an easy-to-find optimum, but as I said it's a solved problem in quaddie-space.

So, if the White House blows up in two months, will I be in trouble for having helped you out here?

--
www.wescottdesign.com
Reply to
Tim Wescott

Yes, but 'well conditioned' might not be the nature of the problem. Take a highest-point altitude determination in the Washington, DC area. The top of the Washington Monument is the high point. One might start a 'hill climbing' algorithm in the nearby reflecting pool (which is perfectly flat and level), and get nowhere.

Worse, some hilll climbing algorithms (Levenberg-Marquardt) use the local slope and curvature to determine step sizes (and that's a very noisy proposition when slope and curvature are both zero plus noise). Semirandom searching would work better for that problem, at least initially.

Reply to
whit3rd

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.