STEM 隨筆︰古典力學︰轉子【五】《電路學》 五【電感】 IV‧馬達‧二‧F

心想何不讓寫故事的人︰

Dynamics with Python balancing the five link pendulum

Dynamics with Python

We’ve been working on a conference paper to demonstrate the ability to do multibody dynamics with Python. We’ve been calling this work flowPyDy, short for Python Dynamics. Several pieces of the puzzle have come together lately to really demonstrate the power of the scientific python software packages to handle complex dynamic and controls problems (i.e. IPython notebooks, matplotlib animations, python-control, and our software package mechanics which is a part of SymPy). After writing the draft of our paper, which uses a general n-link pendulum as it’s main example, I came across this blog post by Wolfram demonstrating their ability to symbolically derive the equations of motion for the n-link pendulum and stabilize it with an LQR controller. It inspired me to replicate the example as I realized that it was relatively easy to do with all free and open source software!

In this example problem we will derive the equations of motion of an n-link pendulum on a laterally sliding cart and then develop a controller to stabilize it. Balancing a single inverted pendulum is a classic problem that is many times a student’s first experience with non-linear dynamics and control. The problem here is extended to a general n-link pendulum and as we will see the equations of motion quickly get messy with greater than 2 links.

 

說故事呢?

 

一則可知『派生動力學』 PyDy 來龍去脈,再者能得創作精神也!

─── 《STEM 隨筆︰古典力學︰動力學【一】

 

百日維新為何功敗垂成?讀書求學尤恐功虧一簣!

此所以加『馬力』︰

NCTU Department of Electrical and Computer Engineering 2015 Spring Course<Dynamic System Simulation and Implementationon> by Prof. Yon-Ping Chen

 

勤『作功』︰

故事緣起或因『顛倒擺』 inverted pendulum 。即使無法回答

人類為何直立行走?空出了手,容易製造工具,方便使用武器耶 ?

之問題,然則足以演示直立如何困難的乎??

Examples of inverted pendulums

Arguably the most prevalent example of a stabilized inverted pendulum is a human being. A person standing upright acts as an inverted pendulum with his feet as the pivot, and without constant small muscular adjustments would fall over. The human nervous system contains an unconscious feedback control system, the sense of balance or righting reflex, that uses proprioceptive input from the eyes, muscles and joints, and orientation input from the vestibular system consisting of the three semicircular canals in the inner ear, and two otolith organs, to make continual small adjustments to the skeletal muscles to keep us standing upright. Walking, running, or balancing on one leg puts additional demands on this system. Certain diseases and alcohol or drug intoxication can interfere with this reflex, causing dizziness and disequilibration, an inability to stand upright. A field sobriety test used by police to test drivers for the influence of alcohol or drugs, tests this reflex for impairment.

Some simple examples include balancing brooms or meter sticks by hand.

The inverted pendulum has been employed in various devices and trying to balance an inverted pendulum presents a unique engineering problem for researchers.[5] The inverted pendulum was a central component in the design of several early seismometers due to its inherent instability resulting in a measurable response to any disturbance.[6]

The inverted pendulum model has been used in some recent personal transportation vehicles, the two-wheeled self-balancing scooters such as the Segway PT and self-balancing hoverboard. These devices are kinematically unstable and use an electronic feedbackservo system to keep them upright.

 

故而話說從頭︰

Inverted pendulum

An inverted pendulum is a pendulum that has its center of mass above its pivot point. It is unstable and without additional help will fall over. It can be suspended stably in this inverted position by using a control system to monitor the angle of the pole and move the pivot point horizontally back under the center of mass when it starts to fall over, keeping it balanced. The inverted pendulum is a classic problem in dynamics and control theoryand is used as a benchmark for testing control strategies. It is often implemented with the pivot point mounted on a cart that can move horizontally under control of an electronic servo system as shown in the photo; this is called a cart and pole apparatus.[1] Most applications limit the pendulum to 1 degree of freedom by affixing the pole to an axis of rotation. Whereas a normal pendulum is stable when hanging downwards, an inverted pendulum is inherently unstable, and must be actively balanced in order to remain upright; this can be done either by applying a torque at the pivot point, by moving the pivot point horizontally as part of a feedback system, changing the rate of rotation of a mass mounted on the pendulum on an axis parallel to the pivot axis and thereby generating a net torque on the pendulum, or by oscillating the pivot point vertically. A simple demonstration of moving the pivot point in a feedback system is achieved by balancing an upturned broomstick on the end of one’s finger.

A second type of inverted pendulum is a tiltmeter for tall structures, which consists of a wire anchored to the bottom of the foundation and attached to a float in a pool of oil at the top of the structure that has devices for measuring movement of the neutral position of the float away from its original position.

Balancing cart, a simple robotics system 1976. The cart contains a servo system which monitors the angle of the rod and moves the cart back and forth to keep it upright.

─── 摘自《STEM 隨筆︰古典力學︰動力學【二】

 

希望

The circle is complete.

矣◎

本來終則有始

\displaystyle f(\infty )=\lim _{s\to 0}{sF(s)}, if all poles of sF(s) are in the left half-plane.
The final value theorem is useful because it gives the long-term behaviour without having to perform partial fraction decompositions or other difficult algebra. If F(s) has a pole in the right-hand plane or poles on the imaginary axis (e.g., if \displaystyle f(t)=e^{t} or \displaystyle f(t)=\sin(t)), the behaviour of this formula is undefined.

何不貫徹始終也☆

終值定理

數學分析中,終值定理(FVT)是將時間趨於無窮時的頻域表達式與時域行為建立聯繫的許多定理之一。終值定理允許直接對頻域表達式取極限來計算時域行為,無需先轉換到時域表達式再取極限 。

在數學上,如果

\displaystyle \lim _{t\to \infty }f(t)

有一個有限極限,那麼

\displaystyle \lim _{t\to \infty }f(t)=\lim _{s\to 0}{sF(s)}

其中 \displaystyle F(s) 為 \displaystyle f(t) 的(單邊)拉普拉斯變換[1][2]

同樣,在離散時間中

\displaystyle \lim _{k\to \infty }f[k]=\lim _{z\to 1}{(z-1)F(z)}

其中 \displaystyle F(z) 為 \displaystyle f[k] 的Z轉換[2]

證明

通過對導數的拉普拉斯變換定義積分得:

\displaystyle \lim _{s\to 0}\int _{0}^{\infty }{\frac {df(t)}{dt}}e^{-st}dt=\lim _{s\to 0}[sF(s)-f(0)]

如果右側的無窮積分存在,則積分的極限可以寫作極限的積分,因此:[3]

\displaystyle \int _{0}^{\infty }\lim _{s\to 0}{\frac {df(t)}{dt}}e^{-st}dt=\int _{0}^{\infty }df(t)=f(\infty )-f(0)

通過令上面兩個等式的右側相等,兩邊同時消去 f(0) 得:

\displaystyle f(\infty )=\lim _{s\to 0}[sF(s)]

終值定理不成立的例子

然而,對於傳遞函數為

\displaystyle H(s)={\frac {9}{s^{2}+9}},

的系統,終值定理似乎預測衝激響應的終值為 0 而階躍響應的終值為 1。但是時域極限不存在,所以預測沒有價值。事實上,無論衝激響應還是階躍響應都會振盪,並且(在這種特殊情況下)終值定理描述的是響應震盪的平均值。

控制理論中有兩種檢驗終值定理結果有效性的方法:

  1. \displaystyle H(s) 的分母為零的所有根的實部必須為負值。
  2. \displaystyle H(s) 在原點處不能有多於一個極點。

這個例子不滿足規則1,因為分母為零的根為 \displaystyle 0+j3 和 \displaystyle 0-j3