pid_vs_lqr_ballandbeam
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pid_vs_lqr_ballandbeam [2016/02/05 23:47] – joaomatos | pid_vs_lqr_ballandbeam [2016/07/13 14:59] (current) – joaomatos | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ** __PID CONTROL__ | + | ===== Lego Ball and Beam ===== |
+ | **Keywords:**Lego, | ||
- | We can analyze the whole system into two distinct transfer functions , one for the ball and beam , and one for the motor. After , we can analyze the whole system putting these two transfer functions together in a block diagram. | ||
- | ** __Ball and Beam Transfer Function Derivation__** | + | ---- |
- | {{ :: | + | |
- | | + | ===== Motivation and Audience ===== |
- | {{:: | + | Motivation and Audience: This tutorial' |
- | | ||
- | | + | .Automatic Controls Theory |
- | + | ||
- | + | ||
- | ** __Motor Transfer Function Derivation__ ** | + | |
- | + | ||
- | One easy way to get the motor' | + | |
- | + | ||
- | {{:: | + | |
- | + | ||
- | | + | |
- | + | ||
- | | + | |
- | + | ||
- | By the graphic response , we can assume the motor system as a second order system (because of the oscillatory | + | |
- | | + | .Controls Programming using lego NXT Brick (NXC language). |
- | | + | .Controls Programming using Matlab. |
- | + | ||
- | | + | |
- | + | ||
- | We know that a second order transfer function is: | + | |
- | | ||
- | So the motor' | + | ---- |
- | + | ||
- | | + | |
- | ** __Motor system modeling on Simulink__ ** | + | ===== Parts List and Source ===== |
- | We can simulate the motor system on Simulink and compare the result to the experimental result , to verify if the derivation is correct. | + | [[ballandbeam_parts|Parts List]] |
- | | ||
- | | ||
- | | + | ---- |
- | ** __SIMULATING THE WHOLE SYSTEM WITH PID CONTROL__ ** | + | ===== Construction Instructions ===== |
- | We can simulate the whole system using the ball and beam together with the motor' | + | {{:: |
- | | ||
- | | + | ---- |
- | | + | ===== System Modeling ===== |
- | | + | . [[ballandbeam_modelling|System Modeling.]] |
- | | ||
- | | + | ---- |
- | ** Working Video / Simulating Disturbance ** | + | ===== Programming ===== |
- | | + | . [[ballandbeam_code|Programming]] |
- | On the video ,was simulated first a heavy disturbance , and then two small disturbances. | ||
- | ** Comparison Simulink vs Real System ** | + | ---- |
- | | ||
- | | ||
- | ** NXT CODE ** | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | ** TUNING THE CODE ** | ||
- | |||
- | After introducing the file saving function and the necessary commands to get the data , the system response was slowed down. ( oscillating more than before ). So i made some tuning: | ||
- | * KP=1 and KD=0.60 | ||
- | * No waiting time inside the if statements | ||
- | * 50ms waiting before starting the control loop again. | ||
- | |||
- | The new result is: | ||
- | |||
- | | ||
- |
pid_vs_lqr_ballandbeam.1454744856.txt.gz · Last modified: by joaomatos