40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
 40m Log Not logged in
 Tue Nov 9 13:40:02 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Tue Nov 9 16:55:52 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Tue Nov 9 18:05:03 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Mon Nov 15 15:12:28 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Tue Nov 16 17:29:49 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Thu Nov 18 20:00:43 2021, Ian MacMillan, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Mon Nov 22 16:38:26 2021, Tega, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics Mon Jan 24 17:10:25 2022, Tega, Summary, Computer Scripts / Programs, SUS Plant Plan for New Optics
Message ID: 16466     Entry time: Mon Nov 15 15:12:28 2021     In reply to: 16462     Reply to this: 16469
 Author: Ian MacMillan Type: Summary Category: Computer Scripts / Programs Subject: SUS Plant Plan for New Optics

[Ian, Tega]

We are working on three fronts for the suspension plant model:

1. Filters
1. 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);
2. from there we can copy the transfer functions into our photon filters.  Tega is working on this right now.
2. State-Space
1. 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.
2. 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
3. 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.
3. Python Check
1. 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=\begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ -\omega_x^2(1+i/Q_{x}) & -\gamma_x & \omega_xb & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ \frac{\omega_{\theta}^2}{l+b} & 0 & -\omega_{\theta}^2(1+i/Q_{\theta}) & -\gamma_{\theta} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & -\omega_{\phi}^2(1+i/Q_{\phi}) & -\gamma_{\phi} & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & -\omega_{y}^2(1+i/Q_{y}) & -\gamma_{y}\end{bmatrix}$

$B=\begin{bmatrix} 0 & 0 & 0 & 0 \\ \frac{1}{m} & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & \frac{R_m}{I_{\theta}} & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & \frac{R_m}{I_{\phi}} & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & \frac{1}{m} \end{bmatrix}$      $C=\begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \end{bmatrix}$      $D=\begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix}$

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:

$\begin{bmatrix} x \\ \dot{x} \\ \theta \\ \dot{\theta} \\ \phi \\ \dot{\phi} \\ y \\ \dot{y} \end{bmatrix}$

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

ELOG V3.1.3-