# Control questions [Toc] ## Basic theories ### Poles & zeros * Given transfer function, what insights could we derive? Ans: 1. stability of a linear system could be determined directly from its TF. Stable iff all components in homogenoues response would decay to zero as time increases, and this time constant is directly determined by the system poles. 2. Frequency response: how the sys reseponse to different frequencies of input signals. Bring in complex numbers into the tf and evaluate the mag & phase --> freq response of the system. --> anayze sytems behaviors at different freqiencies, identify resonant frequencies, how system amplify or attenuate specific frequency components. * If exist poles in RHP, what would happen? Ans: Means that there is a poles with positive real part (including lying on the img axis), and this component in the output owuld increase without bound, casuing the sytem to be unstable. * Poles effect? Ans: Roots of characteristic equations. The location in the complex s-plane determines the systems' transient response, settling time, overshoot, and toher dynamic properties. * How poles & zeros affect system stability? * A pole at the origin of the s-plane? Meaning? Ans: pure integration term in the TF --> infinite gain at zero freq. * A zero at the origin of s-plane? Meaning? Ans: pure differential term in the TF --> zero gain at zero freq. * What are dominant poles? * Pole-zero cancellation? * Effect of adding poles /zeros * Important properties of transient response? Ans: 1. Overshoot 2. Rise time 3. settling time * What are some considerations or trade-offs when arranging poles w.r.t. dominant ones? ### Root locus * What is plotted? Plot of closed-loop poles locations, i.e., the roots of the characteristic equation of the closed-loop system, for all gain values And characteristic of transient response of closed-loop system is closely related to the pole location --> give designes information for gain tuning or effect of adding pole /zeros., to meet system requirememtns --> Simple gain adjustment may be able to move the closed-loop poles to desired locations. * What can we derive from the plot? Ans: Predict effects of location of cclosed-loop poles of varying the gain, or effects of adding open-loop poles /zeros. * How do you plot this? Given system open-loop tf? Ans: Start from open-loop poles (K=0) --> zeros (k->infinity) * Roots location effect? Hope to keep roots as far left as possible (faster response) & close to real-axis to minimize overshoot ### Control sytem requiremetns * Common requirements? Damping ratio, settling time, natural frequency * Common trade off The response speed vs. Robustness & Good stability ### Frequency response * Graphs for frequency response? * Cross over frequency? Meaning? How to find? * Bandwidth? Higher--> faster response time, better tracking accuracy, (but also, more sensitive to noise) ### Nyquist * Meaning? Plots freq response of system on s-complex plane. You can see the phase & magnitude at different frequencies. It can be sued to find the number of unstable poles of closed-loop system, by counting the number of encirclements of the points (-1,0) by the contour. * Nyquist criterion Nyquist plot may only intersect the negative real axis to the right of point "-1" for stability * Mathematicl? n: # closed-loop poles in RHP (target) (hopes n=0) m: # encirclements (clockwise) around -1 of p: # open-loop poles in RHP m = n - p (n=m+p) * effect of integrating element Add a pole at origin in s-plane (samll semicricle around, counter-clockwise) --> semimcricle, clockwise * Gain margin? Phase margin. Measure for the distance from stability border . (A = reciprocal of distance from the nyquist plot where phase equals to -pi, to the img axis) Stability for A > 1 (i.e., Distance < 1) Stability for $\alpha$ > 0 ### Bode plot? Draw magniatue & phase separately. The frequency axis is at logarithimic scale. --> see bw, gain margin, phase margin ### Control methods * What is the usage of compensator? Improves the performance, ex: slow speed of response, poor stability Phase lead: provides a leading phase shift of output signal --> improves transient response (faster, less overshoot) (but does not provide enough phase margin) Phase lag: reduce the gain --> lower the crossover frequency --> larger phase margin!! --> stabilitizes system (but does not provide enough bandwidth) * What is feedforward control? Challenging aspects? Requirements? * P / PI/ PID control characteristics P: increase the gain I: reduce ess -> ero (integrates the past errors) (but may worsen the transient response) D: useful for solving overshoot (increase stability, reduce overshoot, and improve transient response) * PT1 1ST order lay Output proportiaonl to input, but reacts with a lag of response * PT2 2nd order lag --> damping ratio, corner angular freq --> D < 1 would then oscillate * What element introduce time delay? PTt * Minimal phase system? If system has no RHP poles and zeros. --> Have minimal possible phase shift --> can derive phase response from amplitude response * If I want to obtain all states feedback, but only having limited capacity of sensors, what could I do? * How to deal with sensor noise? 1. If the sensor noise have frequency much higher than the disturbances & set point changes, --> set controller bw. low enouh so that it would not react to teh noise. 2. Else, feedforward control and deal with the sensor noise and handle the noise before sending to the controller. ## Robot control * Motion control with velocity inputs * Constant desired velocity (c) --> P control: error = reference constant velocity - K * error position (would have steady state error: c/K if the setpoint is nonzero velocity) --> Pi controller (elminates ess for any trajectory with constant velocity) * With torque / force inputs * Given desired TCP, how to claculate the command of each joint FK, IK, (pseudo inverse of Jacobian), increment joint position command * Important aspects of robot control? * Trajectory planning (smooth & feasible paths) that consider robot dynamics, constrains, and optimization criteria. * Saftety (collision detection & avoidance, emergency stop functionalities, adhere to saftey standards) * HUMAN robot interaction (ensure safe &intuitive interaction)--> force sensing & control, impedance control, compliant behavior * Robustness & Fault tolerance * Explain Kalman Filter? ### Conventional methods? 1. PID 2. Adaptive (adjust control params online based on the system's changing dynamics or uncertainties) --> can compesate for model uncertainties 3. Impedance control (control the interaction force between robot & env, control the compliant or stiff behavior) ### Novel methods? 1. MPC (uses the model of the systems dynamics to predict future behavor) (formulates a optimiation problem to find the optimal control inputs that minimize a cost function) 2. Optimal control (aims to find control inputs that optimize a given performance criterion, such as energy efficiency or trajectory tracking accruacy) ### Kalman filter * Explain The Kalman filter is a recursive mathematical algorithm that estimates the state of a dynamic system based on incomplete and noisy measurements. It is widely used in various fields, including control systems, robotics, navigation, and signal processing. The Kalman filter consists of two main steps: prediction and update. Prediction Step: The filter predicts the system's state at the current time step based on the previous estimate and the system's dynamics model. It also predicts the covariance matrix, which quantifies the uncertainty of the state estimate. Update Step: The filter incorporates the measurement obtained at the current time step to update the state estimate. It calculates the Kalman gain, which determines the relative influence of the predicted state and the measurement. The updated state estimate and covariance matrix are obtained by combining the predicted state and the measurement using the Kalman gain. The Kalman filter optimally combines the predicted state and the measurement in a way that minimizes the estimation error variance. It provides an efficient and effective means of estimating the true state of a system, even in the presence of noise and uncertainties. The Kalman filter assumes that the system and measurement models are linear and that the noise follows a Gaussian distribution. However, extensions such as the Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF) can handle nonlinear system models and non-Gaussian noise. The Kalman filter has numerous applications, including tracking objects, sensor fusion, localization and mapping in robotics, and navigation systems. It is known for its ability to provide accurate and robust state estimation, making it a valuable tool in many fields. ## Particle filter The particle filter, also known as the Monte Carlo filter, is a nonlinear Bayesian filtering algorithm used for state estimation in dynamic systems. It is particularly useful when the system's dynamics and measurement models are nonlinear or when the probability distributions involved are non-Gaussian. Unlike the Kalman filter, which assumes linear models and Gaussian noise, the particle filter can handle a broader range of system models and non-Gaussian noise distributions. The particle filter represents the system's state estimate using a set of discrete particles, each with an associated weight that represents its likelihood of being the true state. The algorithm proceeds through the following steps: 1. Initialization: Initially, a set of particles is randomly sampled from the prior distribution representing the initial belief about the system's state. 2. Prediction: Each particle is propagated forward in time based on the system's dynamics model. This involves applying the state transition function and adding process noise to capture the system's evolution. 3. Weighting: After the prediction step, the particles are assigned weights based on their likelihood given the observed measurements. The weights are calculated by comparing the predicted measurements associated with each particle to the actual measurements obtained from sensors. 4. Resampling: To focus computational effort on the more probable particles, a resampling step is performed. This step selects particles from the current set with replacement based on their weights, favoring particles with higher weights and discarding those with lower weights. This step effectively concentrates the particles around the true state, emphasizing regions with higher likelihood. 5. Filtering: The state estimate is obtained by computing a weighted average or the most probable particle from the resampled set. The particle filter can approximate complex posterior probability distributions by representing them with a large number of particles. It is particularly useful in scenarios where the system exhibits nonlinear or non-Gaussian behavior, such as object tracking, simultaneous localization and mapping (SLAM), and navigation in uncertain environments.