STEM 隨筆︰古典力學︰動力學【五‧四】

知道『什麼是什麼』 What’s what ?十分重要!故此對照

PyTrajectory

What is PyTrajectory?

PyTrajectory is a Python library for the determination of the feed forward control to achieve a transition between desired states of a nonlinear control system.

Planning and designing of trajectories represents an important task in the control of technological processes. Here the problem is attributed on a multi-dimensional boundary value problem with free parameters. In general this problem can not be solved analytically. It is therefore resorted to the method of collocation in order to obtain a numerical approximation.

PyTrajectory allows a flexible implementation of various tasks and enables an easy implementation. It suffices to supply a function f(x,u) that represents the vectorfield of a control system and to specify the desired boundary values.

 

Python-control

Introduction

Welcome to the Python Control Systems Toolbox (python-control) User’s Manual. This manual contains information on using the python-control package, including documentation for all functions in the package and examples illustrating their use.

Overview of the Toolbox

The python-control package is a set of python classes and functions that implement common operations for the analysis and design of feedback control systems. The initial goal is to implement all of the functionality required to work through the examples in the textbook Feedback Systemsby Astrom and Murray. A MATLAB compatibility package (control.matlab) is available that provides many of the common functions corresponding to commands available in the MATLAB Control Systems Toolbox.

 

不同的『控制觀』也。

由於『控制概念』之『定義』,曾經帶來『內涵』或『外延』的混亂,故而初學者務須『審慎』呦!!

前饋控制

前饋控制也稱「預先控制」,是控制理論中,在行動開始之前就採取控制。前饋控制是開環的,按擾動進行補償。與其相對的另外 2 種控制模型是過程控制(同期控制)與反饋控制(事後控制 )。

概述

前饋系統不是基於誤差補償,而是基於針對過程的知識,如過程的數學模型、過程的干擾的知識或度量。[1]

純前饋系統,通常要求負荷的行為是可預測的,這才能不需要負荷的輸出的反饋。

對於前饋系統,過程的干擾在影響系統之前就被測量、應對。例如,居家環控系統檢測到房門打開就會開啟加熱系統,以免室溫下降。困難之處在於前饋控制系統必須對過程的干擾造成的效果有精確的預測。[2][3][4]

控制系統可分為 3 類:

  • 開環
  • 前饋
  • 反饋 (閉環)

開環控制系統的一個例子是純手工無動力輔助的汽車轉向系統。作為對比,動力轉向系統是個前饋系統,確保轉向液壓助力達到恆定壓強。如果把駕駛員也包括在控制系統中,這形成了反饋路徑,人在環中,通過轉動方向盤來補償汽車前進方向轉變時的誤差。

前饋控制不同於開環控制或遙控機器人。前饋控制需要有過程的輸入輸出之間的數學模型。 [5][6]

計算機科學感知機網絡是個前饋系統,因為每層神經元的輸出只傳給下一層,而不能傳給上一層神經元,因此沒有反饋

……

Overview

With feed-forward or Feedforward control, the disturbances are measured and accounted for before they have time to affect the system. In the house example, a feed-forward system may measure the fact that the door is opened and automatically turn on the heater before the house can get too cold. The difficulty with feed-forward control is that the effects of the disturbances on the system must be accurately predicted, and there must not be any unmeasured disturbances. For instance, if a window was opened that was not being measured, the feed-forward-controlled thermostat might let the house cool down.

The term has specific meaning within the field of CPU-based automatic control. The discipline of “feedforward control” as it relates to modern, CPU based automatic controls is widely discussed, but is seldom practiced due to the difficulty and expense of developing or providing for the mathematical model required to facilitate this type of control. Open-loop control and feedback control, often based on canned PID control algorithms, are much more widely used.[2][3][4]

 The Three types of Control System (a) Open Loop (b) Feed-forward (c) Feedback (Closed Loop) Based on Hopgood (2002)

There are three types of control systems: open loop, feed-forward, and feedback. An example of a pure open loop control system is manual non-power-assisted steering of a motor car; the steering system does not have access to an auxiliary power source and does not respond to varying resistance to turning of the direction wheels; the driver must make that response without help from the steering system. In comparison,power steering has access to a controlled auxiliary power source, which depends on the engine speed. When the steering wheel is turned, a valve is opened which allows fluid under pressure to turn the driving wheels. A sensor monitors that pressure so that the valve only opens enough to cause the correct pressure to reach the wheel turning mechanism. This is feed-forward control where the output of the system, the change in direction of travel of the vehicle, plays no part in the system. See Model predictive control.

If you include the driver in the system, then he does provide a feedback path by observing the direction of travel and compensating for errors by turning the steering wheel. In that case you have a feedback system, and the block labeled “System” in Figure(c) is a feed-forward system.

In other words, systems of different types can be nested, and the overall system regarded as a black-box.

Feedforward control is distinctly different from open loop control and teleoperator systems. Feedforward control requires a mathematical model of the plant (process and/or machine being controlled) and the plant’s relationship to any inputs or feedback the system might receive. Neither open loop control nor teleoperator systems require the sophistication of a mathematical model of the physical system or plant being controlled. Control based on operator input without integral processing and interpretation through a mathematical model of the system is a teleoperator system and is not considered feedforward control.[5][6]

History

Historically, the use of the term “feedforward” is found in works by D. M. MacKay as early as 1956. While MacKay’s work is in the field of biological control theory, he speaks only of feedforward systems. MacKay does not mention “Feedforward Control” or allude to the discipline of “Feedforward Controls.” MacKay and other early writers who use the term “feedforward” are generally writing about theories of how human or animal brains work.[7]

The discipline of “feedforward controls” was largely developed by professors and graduate students at Georgia Tech, MIT, Stanford and Carnegie Mellon. Feedforward is not typically hyphenated in scholarly publications. Meckl and Seering of MIT and Book and Dickerson of Georgia Tech began the development of the concepts of Feedforward Control in the mid 1970s. The discipline of Feedforward Controls was well defined in many scholarly papers, articles and books by the late 1980s.[5][8][9][10]

───

回饋

回饋英語:Feedback,又稱回授),在中國大陸稱為「反饋」 ,是模控學的基本概念,指將系統的輸出返回到輸入端並以某種方式改變輸入,它們之間存在因果關係的迴路,進而影響系統功能的過程。[1] 在這種情況下,我們可以說系統「回饋到它自身」 。在討論回饋系統時,因果關係的概念應當特別仔細對待:「對於回饋系統,很難作出簡單的推理歸因,因為當系統A 影響到系統B ,系統B 又影響到系統A ,形成了循環。這使得基於因果關係的分析特別艱難,需要將系統作為一個整體來看待。」[2]

回饋可分為負回饋正回饋。前者使輸出起到與輸入相反的作用 ,使系統輸出與系統目標的誤差減小,系統趨於穩定;後者使輸出起到與輸入相似的作用,使系統偏差不斷增大,使系統振盪,可以放大控制作用。對負回饋的研究是模控學的核心問題。

回饋的基本框圖

歷史

能夠自我調節的機器在古代就有,而回饋的概念是在十八世紀的英國進入經濟理論領域,但是當時並沒有人把它看作一個普適的抽象概念,所以並未為其命名。[3]

英語中回饋的動詞形式「to feed back」,意即機械過程中「返回到早先的狀態」,在1860年代開始在美國使用,[4][5] ,在1909年,諾貝爾獎獲得者卡爾·布勞恩開始將「feed-back」這個短語作為名詞來使用,表示電路中元件的之間的耦合。[6]

1912 年底,研究者們在早期的電子放大器(奧迪恩真空三極體)上發現,如果經過精心調節地將其輸出的信號返回到其輸入端(形成再生迴路),可以增加其放大能力,但也可能導致真空管發生嘯叫。[7] 這樣從輸出到輸入的回饋機制,使得「回饋」(feedback)作為一個單獨的詞在 1920 年代出現了更高的使用頻率。[7]

在這之後的年代裡,關於怎樣定義回饋概念產生了一些爭論。阿什比 (1956),數學家和理論家們對回饋機制中的「法則」感興趣,傾向於用「反應迴路」來定義回饋,因為這樣會使得理論簡潔而穩定;而另一些人的目的比較偏向實用,會把回饋看作是具體過程的一種衍生效應。

「[具體工作的操作者們]反對數學家的定義,他們指出,按照這個定義來說,那麼普通的鐘擺也是一種回饋…可以看做它的位置和動量之間的回饋——而這從實際操作的觀點看來屬於神秘主義。而數學家們反駁道,如果只是把回饋看作必須要真實的電路或者神經迴路才能承載的一種現象,那麼理論就成了毫無意義的混亂和密語。」[8](p54)

針對管理理論中的應用,拉馬普拉薩德( Ramaprasad,1983 )將回饋大致定義為「…關於系統參數中實際操作層面和參考層面之間跨度的信息」,它可以用來「以某種方式改變這個跨度」。他強調,這個信息本身並不是回饋,除非它能夠轉化為行動。[9]

類型

正回饋與負回饋

 Maintaining a desired system performance despite disturbance using negative feedback to reduce system error.

回饋分為兩種:正回饋負回饋

汽車的巡航定速系統可以作為負回饋的一個例子,它會使得車速符合一個預先設定的速度上限。汽車的控制系統的輸入包括引擎的扭力和路面的坡度(擾動),而速度計可以測量車速。速度計得到的車速和目標速度(預先設定)之間的差距就是誤差信號。控制器接收到這個信號之後會改變加速度,控制流入引擎(效應器)的燃料增多。於是,引擎扭力發生改變,和路面坡度相關的扭力輸出的回饋減少了速度的誤差,縮小了路面造成的擾動。

回饋的「正」、「負」之分最早出現在二戰之前,正回饋的概念在 1920 年代的再生迴路中已經出現。[10] Friis和Jensen (1924) 將一些放大電路中的再生迴路作為「『回饋』是正向的」的例子,以此和他們順便提及的負回饋相區別。[11] 哈羅德·史蒂芬·布萊克1934 年的經典論文首次詳述了在放大電路中的負回饋。布萊克認為: 「正回饋會增加放大的增益,而負回饋會減少它。」[12] Mindell (2002) 中描述了在此之後產生的混亂: 「…Friis和Jensen與布萊克以同樣的方式使用「正回饋」和「負回饋」這樣的區分 ,不是基於回饋自身的符號,而是基於它對於放大增益的作用效果。與之相反,Nyquist與Bode,當他們在布萊克的基礎之上工作時,以相反的方式來使用負回饋這個詞。布萊克難以向別人證明他的工作中的一致性,因為在基本的概念上存在著混亂。」[10](p121)

早在這個概念得到使用之前,詹姆斯·克拉克·麥克斯韋就描述過很多種與蒸汽機中的中的「運動形式」,區分了其中一些可以導致擾動或者擺動的持續增加,而另一些會使之減少。[13]

 

現在請讀者設想一位技藝高超之耍盤子者,表演時需要依賴『眼』、『耳』 … 五官乎?◎

中國的轉雜耍。

 

反思訓練時

Translation of the inverted pendulum

An example often used in literature is the inverted pendulum. Here a force F acts on a cart with mass M_w. In addition the cart is connected by a massless rod with a pendulum mass m_p. The mass of the pendulum is concentrated in P_2 and that of the cart in P_1. The state vector of the system can be specified using the carts position x_w(t) and the pendulum deflection \varphi(t) and their derivatives.

../../_images/inv_pendulum.png

With the Lagrangian Formalism the model has the following state representation where u_1 = Fand x = [x_1, x_2, x_3, x_4] = [x_w, \dot{x}_w, \varphi, \dot{\varphi}]

A possibly wanted trajectory is the translation of the cart along the x-axis (i.e. by 0.5m). In the beginning and end of the process the cart and pendulum should remain at rest and the pendulum should be aligned vertically upwards (\varphi = 0). As a further condition u_1 should start and end steadily in the rest position (u_1(0) = u_1(T) = 0). The operating time here is T = 1 [s].

../../_images/inv_pend_trans.gif

 

狀態經驗真無用耶!◎