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
Last revisionBoth sides next revision
damped_compound_pendulum [2018/10/17 15:15] – [LEGO DCP] sangsinparkdamped_compound_pendulum [2018/10/17 17:14] – [Final Words] sangsinpark
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 (1 degree accuracy), 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 at a control frequency of 40Hz. The P, I, and D gain are 0.05, 0.8, and 0.05, respectively. 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. In addition, here is the front panel of the LabVIEW program.
Line 201: Line 204:
 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. 
 + 
 +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.
  
-== Read an angle sensor ==+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.
  
-== PID controller ==+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).
  
-== Convert angle to 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.
  
-== Input motor power ==+** NB: If motor terminals are hooked up to an oscilloscope,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. **
  
-== Save time and angle ==+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 === === Exp. #1 - 40 degrees step command and disturbances ===
Line 221: 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.txt · Last modified: 2018/10/17 17:14 by sangsinpark