User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs:control:start [2016/11/24 08:20]
Ryan Summers
cs:control:start [2018/01/28 23:05] (current)
Ryan Summers
Line 1: Line 1:
 ====== Control System ====== ====== Control System ======
-<WRAP center round important 60%> 
-Note: This section was determined through reverse-engineering by Ryan and is pending confirmation. 
-</​WRAP>​ 
 The control system follows basic [[http://​www.eurotherm.com/​pid-control-made-easy|PID theory]], but has two additional parameters called hysteresis (H) and windup (W). The hysteresis essentially creates a deadband. If the error $E$ defined in ($\ref{eq:​error}$) is below the hysteresis level, the error can be assumed as (set to) zero, and thus no corrective action is required. The windup term acts to limit the integral portion of the accumulated error. If the integral value is above the windup level, it will be truncated to the windup value. Therefore, the integral can never increase or decrease infinitely because it will always be capped by the windup. The control system follows basic [[http://​www.eurotherm.com/​pid-control-made-easy|PID theory]], but has two additional parameters called hysteresis (H) and windup (W). The hysteresis essentially creates a deadband. If the error $E$ defined in ($\ref{eq:​error}$) is below the hysteresis level, the error can be assumed as (set to) zero, and thus no corrective action is required. The windup term acts to limit the integral portion of the accumulated error. If the integral value is above the windup level, it will be truncated to the windup value. Therefore, the integral can never increase or decrease infinitely because it will always be capped by the windup.
  
Line 63: Line 60:
 $$ $$
  
-where $C_{x}$ represents the scale factor for thruster x. Take note that conceptually,​ it is easy to differentiate ​translational ​and rotational goals+where $C_{x}$ represents the scale factor for thruster x. Take note that conceptually,​ it is easy to separate ​translational ​from rotational goals
  
 $$ $$
Line 75: Line 72:
 ===== Total Force ===== ===== Total Force =====
  
-By substituting ($\ref{eq:​control:​M}$) and ($\ref{eq:​control:​C}$) into ($\ref{eq:​control}$),​ it can be seen that+$F$ in ($\ref{eq:​control}$) is the necessary force to apply to the submarine to cause a transition from the current state to a desired state. ​By substituting ($\ref{eq:​control:​M}$) and ($\ref{eq:​control:​C}$) into ($\ref{eq:​control}$),​ it can be seen that the dimensions of F are also known
  
 $$ $$
Line 98: Line 95:
 $$ $$
  
-Therefore, $F$ is also a vector with 6 elements in it. Each element of $F$ is the summation of each of the rows of $M$ multiplied by the weights in $C$.+Therefore, $F$ is also a vector with 6 elements in it. Each element of $F$ is the summation of each of the rows of $M$ multiplied by the weights in $C$. Because the mass and inertial moments of the submarine are also known, $F$ can also be calculated utilizing the current and desired state.
  
 ===== Solving the Equation ===== ===== Solving the Equation =====
-Now that all of the parameters of ($\ref{eq:​control}$) have been defined, we can use it to find our control. Notice that there are two knowns within the system, both $M$ and $F$ can be analytically determined. $M$ can be found by measuring the position and orientation of each thruster. $F$ results from the desired position of the sub. To determine $F$, P, I, D, W, H, and Error need to be known. Let+Now that all of the parameters of ($\ref{eq:​control}$) have been defined, we can use it to find our control. Notice that there are two knowns within the system, both $M$ and $F$. $M$ can be found by measuring the position and orientation of each thruster. $F$ results from the desired position of the sub. To determine $F$, P, I, D, W, H, and Error need to be known. Let
  
 $$ $$
Line 126: Line 123:
 $$ $$
  
-after both windup and hysteresis are applied to Error. Note that $E'$ is the derivative of $E$ over time, $I$ is the integral state for the accumulated error for each of the states within $E$, and $K_x$ are the respective P, I, and D weights.+after both windup and hysteresis are applied to $E$. Note that $E'$ is the derivative of $E$ over time, $I$ is the integral state for the accumulated error for each of the states within $E$, and $K_x$ are the respective P, I, and D weights.
  
 Because both $F$ and $M$ are known, ($\ref{eq:​control}$) can be solved for $C$ Because both $F$ and $M$ are known, ($\ref{eq:​control}$) can be solved for $C$
Line 161: Line 158:
  
 ====== Control System Notes====== ====== Control System Notes======
-1. When tuning pitch and roll tune PID params ​while the sub is moving. This is because we only currently care about keeping the sub level while moving.+1. When tuning pitch and roll PID params, tune them just to keep the sub stable when moving ​forward/​strafing. This is because we only currently care about keeping the sub level while moving, don't really care as much about overshoot when moving between different pitch/roll angles.