[Ian, Tega]
We are working on three fronts for the suspension plant model:
- Filters
- We now have the state-space matrices as given at the end of this post. From these matrices, we can derive transfer functions that can be used as filter inputs. For a procedure see HERE. We accomplish this using Matlab's built-in
ss(A,B,C,D); function. then we make it discrete using c2d(sys, 1/f); this gives us our discrete system running at the right frequency. We can get the transfer functions of either of these systems using tf(sys);
- from there we can copy the transfer functions into our photon filters. Tega is working on this right now.
- State-Space
- We have our matrices as listed at the end of this post. With those compiled into a discrete system in MatLab we can use the code Chris made called
rtss.m to convert this system into a .c file and a .h file.
- from there we have moved those files under the userapps folder in the docker system. then we added a c-code block to our .mdl model for the plant and pointed it at the custom c file we made. See section 7.2 of T080135-v10
- We have done all this and this should implement a custom state-space function into our .mdl file. the downside of this is that to change our SS model we have to edit the matrices we can't edit this from an medm screen. We have to recompile every time.
- Python Check
- This python check is run by Raj and will take in the state-space matrices which are given then will take transfer functions along all inputs and outputs and will compare them to what we have from the CDS model.
Here are the State-space matrices:

A few notes: If you want the values for these parameters see the .yml file or the State-space model file. I also haven't been able to find what exactly this s is in the matrices.
UPDATE [11/16/21 4:26pm]: I updated the matrices to make them more general and eliminate the "s" that I couldn't identify.
The input vector will take the form:

where x is the position, theta is the pitch, phi is the yaw, and y is the y-direction displacement
|