## Feedback Control ![[Pasted image 20240930211415.png|350]] is equivalent to $Y_{1}(s)=\frac{G_{1}(s)}{1+G_{1}(s)G_{2}(s)}R_{1}(s).$ ### Second Order Response | Metric | Formula | Description | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | | **Damping Coefficient** | $\begin{align}\zeta &= \cos(\theta) \\ &\approx \sqrt{ \frac{\ln(OS)^{2}}{\pi^{2}+\ln(OS)^{2}} } \\ &\approx \frac{\tau}{\omega_{n}}\end{align}{}$ | Percent critical damping | | **Damped Frequency** | ${} \omega_{d}=\sin(\theta_{s})\omega_{n} {}$ | Frequency of damped system | | **Rise Time** | $t_{r} \approx \frac{1.8}{w_{n}}$ | Time between 10% and 90% of setpoint | | **Overshoot** | ${} \begin{align}\%OS &\approx 100 e^{-\pi\zeta/\sqrt{ 1-\zeta^{2} }} \\&= 100 e^{-\pi/\tan\theta}\end{align} {}lt;br> | Max value divided by setpoint | | **Peak Time** | $t_{p} = \frac{\pi}{\omega_{d}}$ | Time to reach max overshoot point | | **Settling Time** | $t_{s}= \frac{\ln(0.02)}{\zeta\omega_{n}} \approx \frac{3.91}{\sigma}$ | Time for transients to decay to 2% of setpoint | ![[Pasted image 20240927135513.png|500]] ### PID Control | | PD | PI | PID | | ----------------- | ----------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------- | | **$C(s)$** | $K(s+z)$ | ${} \frac{K(s+z)}{s} {}$ | $\frac{K(s+z)^{2}}{s}$ | | **$C(s)$** | $K_{p}+K_{d}s$ | $K_{p}+ \frac{K_{i}}{s}$ | $K_{p}+\frac{K_{i} }{s} +K_{d}s$ | | **$e_{ss}$** Step | ${} \frac{1}{1+G(0)} {}$ | 0 | 0 | | **$e_{ss}$** Ramp | $\infty$ | C | 0 | | | Steady state error | overshoot or instability | | | | Weak to noise <br>(derivative term) | | | | Root Locus Design | Deficiency angle | Add $\frac{1}{s}$ to plant, then use PD method | Add integrator to plant, then solve double PD with defficiency angle | ### Lead-Lag Control General controller design with frequency response targets. ## Root Locus Design ### Root Locus The root locus is the complex-plane plot of all values $s$ for which the *characteristic equation* holds for some positive real value of $K$: $ 1 + K G(s)=0 $ The poles of $G_{cl}$ must satisfy the characteristic equation. This equation can be broken down into - the **magnitude condition**: $\lvert G(s) \rvert =\frac{1}{K}$ - the **angle condition:** $\angle G(s) = \sum ^{m}_{i=1} \angle(s-z_{i}) - \sum_{i=1}^{n} \angle(s-p_{i})$ The angle condition can be rewritten as $ \sum \phi_{i}-\sum\theta_{i} = (2n + 1)\pi $ Which can be used to derive rules for drawing the root locus but honestly let's just use `rlocus(sys)` in Matlab. ![[Pasted image 20240927005834.png|500]] ### Controller Design 1. Compute desired closed-loop pole to satisfy steady state error requirement 2. Compute deficiency angle for the desired pole $ \angle \psi = -180° - \angle P(s)|_{s=d} $ 3. Determine $p$ and $z$ such that $\angle C(s)|_{c=d} = \phi$ using angle condition or bisection method 4. Determine gain $K$ from magnitude condition $ K = \frac{1}{\left\lvert \frac{s+z}{s+p} \cdot P(s)|_{s=d} \right\rvert } $ ## Frequency Response ### Bode Plots ### Controller Design