User Tools

Site Tools


damped_compound_pendulum

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
damped_compound_pendulum [2018/10/17 14:40] – [LEGO DCP] sangsinparkdamped_compound_pendulum [2018/10/17 17:14] (current) – [Damped Compound Pendulum (DCP)] sangsinpark
Line 3: Line 3:
 **Author:** Sangsin Park Email: <[email protected]> **Author:** Sangsin Park Email: <[email protected]>
 \\ \\
-**Date:** Last modified on <10/16/18>+**Date:** Last modified on <10/17/18>
 \\ \\
 **Keywords:** compound pendulum, pendulum control with a propeller, damped compound pendulum **Keywords:** compound pendulum, pendulum control with a propeller, damped compound pendulum
Line 162: Line 162:
  
 ===== PID Control ===== ===== PID Control =====
-A LabVIEW program is employed to control the DCP and PID controller is implemented on it. The P, I, and D gain are 0.1, 0.28, and 0.9, respectively at control frequency of 200Hz.+A LabVIEW program is employed to control the DCP and PID controller is implemented on it at control frequency of 200Hz. The P, I, and D gain are 0.1, 0.28, and 0.9, respectively.
 {{ dcp:pid_r3_200hz_block_diagram.jpg |}} {{ dcp:pid_r3_200hz_block_diagram.jpg |}}
 In addition, there is the front panel of that LabVIEW block diagram. In addition, there is the front panel of that LabVIEW block diagram.
Line 190: Line 190:
  
 ===== LEGO DCP ===== ===== LEGO DCP =====
-You can make a LEGO version DCP with LEGO bricks, a motorized propeller, and a HiTechnic angle sensor. Even if the angle sensor's resolution is not good (360 per revolution), a LEGO DCP control does not matter.+You can make a LEGO version DCP with LEGO bricks, a motorized propeller, and a HiTechnic angle sensor. Even if the angle sensor's resolution is not good (1-degree accuracy), a LEGO DCP control does not matter.
 {{ dcp:lego_dcp.jpg?500 |}} {{ dcp:lego_dcp.jpg?500 |}}
  
 === LabVIEW block diagram for PID control === === LabVIEW block diagram for PID control ===
-A LabVIEW program, which is similar to the before LabVIEW code, is employed to control the LEGO DCP. The P, I, and D gain are 0.05, 0.8, and 0.05, respectively at a control frequency of 40Hz.+A LabVIEW program, which is similar to the before LabVIEW code, is employed to control the LEGO DCP at a control frequency of 40Hz. The P, I, and D gain are 0.05, 0.8, and 0.05, respectively. 
 + 
 +Here is the LabVIEW file. {{dcp:lego_dcp_labview_02.zip?linkonly}} 
 {{ dcp:lego_dcp_labview_block_diagram.jpg |}} {{ dcp:lego_dcp_labview_block_diagram.jpg |}}
 +In addition, here is the front panel of the LabVIEW program.
 +{{ dcp:lego_dcp_labview_front_panel.jpg?400 |}}
  
 A breakdown of the LabVIEW block diagram is shown as follows. A breakdown of the LabVIEW block diagram is shown as follows.
  
-== Initialize an angle sensor ==+1. Initialize an angle sensor 
 +{{ dcp:lego_dcp_init_angle.jpg |}} 
 +Before while loop, reset angle sensor and wait until its angle is within 1 degree.
  
-== Read an angle sensor ==+2. Read angle 
 +{{ dcp:lego_dcp_read_angle.jpg |}} 
 +An angle from the angle sensor is measured in the range 0 to 359 degrees with 1-degree accuracy. To display angle in the range -180 to 180, when the angle is greater than 180, subtract 360 from that. Moreover, to avoid getting mixed up with wires, I assign a local variable for the Angle.
  
-== PID controller ==+3. PID controller 
 +{{ dcp:lego_dcp_pid.jpg?500 |}} 
 +If a control frequency is changed, a value of dt also needs to be changed to a value of 1/frequency.
  
-== Convert angle to power ==+4. Convert angle to motor power 
 +{{ dcp:lego_dcp_conversion.jpg |}} 
 +A constant of 68.98519 is a proportional gain to convert from angle to motor power and another constant of 10 is bias for dead-zone. Those constants can be determined by curve-fitting (see the **Modeling** section).
  
-== Input motor power ==+5. Input motor power 
 +{{ dcp:lego_dcp_motor.jpg?300 |}} 
 +For safety and to limit motor rotation to a single direction, a motor power is constrained by in the range of 0 to 100.
  
-== Save time and angle ==+** NB: If motor terminals are hooked up to an oscilloscope, a motor power range becomes strange. The motor power is in the range -100 to 100. Zero power is not zero anymore. For example, at -100, a motor doesn't rotate and at 0, it can rotate. **
  
-=== Exp. #1 ===+6. Save time and angle 
 +{{ dcp:lego_dcp_save_data.jpg?700 |}} 
 +To calculate experiment time, read a current time before while loop, and then subtract the time from a time updated in while loop. Lastly, two local variables, Time and Angle, are written into a file after press a STOP button. 
 + 
 +=== Exp. #1 - 40 degrees step command and disturbances ===
 {{ dcp:lego_dcp_exp_01.mp4 |}} {{ dcp:lego_dcp_exp_01.mp4 |}}
 +{{ dcp:lego_dcp_40_degrees_pid.jpg?500 |}}
 // //
 // //
Line 218: Line 238:
 ===== Final Words ===== ===== Final Words =====
  
-This tutorial's objective was to understand a second order system. +This tutorial's objective is to understand a second order system through a compound pendulum with a motorized propeller referred to as Damped Compound Pendulum (DCP) and I share my efforts in detail regarding two different DCP realization. PID control of a DCP is successful and then a LEGO version DCP is made for control class and hands-on lab. Eventually, the LEGO DCP is also controlled well
 \\ \\
 \\ \\
 For questions, clarifications, etc, Email: <[email protected] For questions, clarifications, etc, Email: <[email protected]
  
damped_compound_pendulum.1539812422.txt.gz · Last modified: 2018/10/17 14:40 by sangsinpark