STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
lqr_motor Namespace Reference

Variables

float R = 1.0
float L = 0.5
float Ke = 0.01
float Kt = 0.01
float J = 0.01
float B = 0.1
 A = np.array([[-R / L, -Ke / L, 0], [Kt / J, -B / J, 0], [0, 1, 0]])
 C = np.array([[0, 0, 1]])
 Q = np.diag([10, 1, 100])
 R_mat = np.array([[0.01]])
 P = solve_continuous_are(A, B, Q, R_mat)
float K = np.linalg.inv(R_mat) @ B.T @ P
float dt = 0.001
float T = 5.0
 N = int(T / dt)
 t = np.linspace(0, T, N)
 x = np.zeros((3, 1))
float r = 1.0
 x_hist = np.array(x_hist)
 u_hist = np.array(u_hist)
float u = -K @ x + K[0, 2] * r
float dx = A @ x + B * u
 figsize
 label
 color
 linestyle

Variable Documentation

◆ A

lqr_motor.A = np.array([[-R / L, -Ke / L, 0], [Kt / J, -B / J, 0], [0, 1, 0]])

Definition at line 22 of file lqr_motor.py.

◆ B

lqr_motor.B = 0.1

Definition at line 17 of file lqr_motor.py.

◆ C

lqr_motor.C = np.array([[0, 0, 1]])

Definition at line 24 of file lqr_motor.py.

◆ color

lqr_motor.color

Definition at line 68 of file lqr_motor.py.

◆ dt

float lqr_motor.dt = 0.001

Definition at line 39 of file lqr_motor.py.

◆ dx

float lqr_motor.dx = A @ x + B * u

Definition at line 52 of file lqr_motor.py.

◆ figsize

lqr_motor.figsize

Definition at line 64 of file lqr_motor.py.

◆ J

float lqr_motor.J = 0.01

Definition at line 16 of file lqr_motor.py.

◆ K

float lqr_motor.K = np.linalg.inv(R_mat) @ B.T @ P

Definition at line 33 of file lqr_motor.py.

◆ Ke

float lqr_motor.Ke = 0.01

Definition at line 14 of file lqr_motor.py.

◆ Kt

float lqr_motor.Kt = 0.01

Definition at line 15 of file lqr_motor.py.

◆ L

float lqr_motor.L = 0.5

Definition at line 13 of file lqr_motor.py.

◆ label

lqr_motor.label

Definition at line 67 of file lqr_motor.py.

◆ linestyle

lqr_motor.linestyle

Definition at line 68 of file lqr_motor.py.

◆ N

lqr_motor.N = int(T / dt)

Definition at line 41 of file lqr_motor.py.

◆ P

lqr_motor.P = solve_continuous_are(A, B, Q, R_mat)

Definition at line 32 of file lqr_motor.py.

◆ Q

lqr_motor.Q = np.diag([10, 1, 100])

Definition at line 29 of file lqr_motor.py.

◆ R

float lqr_motor.R = 1.0

Definition at line 12 of file lqr_motor.py.

◆ r

lqr_motor.r = 1.0

Definition at line 45 of file lqr_motor.py.

◆ R_mat

lqr_motor.R_mat = np.array([[0.01]])

Definition at line 30 of file lqr_motor.py.

◆ T

float lqr_motor.T = 5.0

Definition at line 40 of file lqr_motor.py.

◆ t

lqr_motor.t = np.linspace(0, T, N)

Definition at line 42 of file lqr_motor.py.

◆ u

float lqr_motor.u = -K @ x + K[0, 2] * r

Definition at line 51 of file lqr_motor.py.

◆ u_hist

lqr_motor.u_hist = np.array(u_hist)

Definition at line 47 of file lqr_motor.py.

◆ x

lqr_motor.x = np.zeros((3, 1))

Definition at line 44 of file lqr_motor.py.

◆ x_hist

lqr_motor.x_hist = np.array(x_hist)

Definition at line 47 of file lqr_motor.py.