Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Early in the article it introduces the A state transition matrix and B the input matrix. What is the intuition of those matrices and where do you get them from? It seems to assume a background in Optimal Control.

The article would be better if it explained those matrixes A and B more in detail with a few simple examples. (maybe it did, but I stopped reading after that, since it builds on top of those undefined concepts)



It comes from representing your system dynamics as a set of linear equations in your state variables (which might be position, velocity, etc). The A matrix is the linear map from the previous state at time t to the next state at time t+1. The B matrix is similar, except it determines the impact of your control input u on the next state of the system.


Thanks. For an endeffector in a robot arm, the articulated motion, with friction, backlash, gearing, coriolis terms, contact etc. can be very complicated. Would/could you use a physics engine to compute the state in t and t+1 , and then compute the A matrix from that? (state as in world space position and orientation of the end effector)


Generally this process would be called linearization.

You can create a complex, nonlinear, numerical model of the full system in as much detail as you want (eg implemented in a block sim like Simulink, or MBD software like ADAMS, or just A and B matrices derived manually but incorporating nonlinearities like sin, etc).

From that you can evaluate a whole bunch of finite differences around an arbitrary state (linearization point), which are the components of the A and B matrices. This is an approximate, linear model which is "close enough" in behaviour to your real model for states that are "close" to your linearization point.

In practice if you're moving far away from your linearization point (eg a 6 DOF robot arm with large displacement of all joints), you'll need to re-compute the linearization each timestep, around the current state, and re-compute the LQR or MPC solution from this "new" approximate model.

Here's some linearization code I wrote for a library that's used to teach controls and robotics in undergrad. It takes as a input a "model" that's an arbitrary function that generates the next state from a given state, and computes the jacobian matrices by finite differences: https://github.com/SherbyRobotics/pyro/blob/43dcb112427978ff...



Thanks, the article could benefit from a bit more background like this, with a few simple examples, for example going from the (double) pendulum or cartpole equation of motions to the A matrix, same for B.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: