TW202238302A - Deep learning method for controlling the balance of a two-wheeled machine - Google Patents
Deep learning method for controlling the balance of a two-wheeled machine Download PDFInfo
- Publication number
- TW202238302A TW202238302A TW110109261A TW110109261A TW202238302A TW 202238302 A TW202238302 A TW 202238302A TW 110109261 A TW110109261 A TW 110109261A TW 110109261 A TW110109261 A TW 110109261A TW 202238302 A TW202238302 A TW 202238302A
- Authority
- TW
- Taiwan
- Prior art keywords
- control
- wheel
- layer
- node
- formula
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 238000013135 deep learning Methods 0.000 title claims abstract description 29
- 230000006870 function Effects 0.000 claims description 13
- 238000013528 artificial neural network Methods 0.000 claims description 10
- 230000005484 gravity Effects 0.000 claims description 8
- 238000013461 design Methods 0.000 claims description 6
- 239000011159 matrix material Substances 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 3
- 230000009977 dual effect Effects 0.000 claims description 3
- 230000001133 acceleration Effects 0.000 claims description 2
- 238000004364 calculation method Methods 0.000 claims description 2
- 238000012549 training Methods 0.000 claims description 2
- 238000012546 transfer Methods 0.000 claims description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 claims 1
- 230000007613 environmental effect Effects 0.000 abstract description 6
- 230000007246 mechanism Effects 0.000 abstract description 6
- 230000000694 effects Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000003631 expected effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Motorcycle And Bicycle Frame (AREA)
- Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
Abstract
Description
本發明係有關於一種深度學習控制兩輪機具平衡方法,尤其是指一種以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。The present invention relates to a deep learning method for controlling the balance of two-wheeled equipment, in particular to an adjustment mechanism that uses deep learning to adjust controller parameters and can have learning properties, and can widely adapt to changes in environmental parameters, so that the two wheels can be adjusted. The mechanical equipment achieves strong, balanced and stable automatic control functions, and has more practical features in its overall execution and use.
按,2001年由發明家Dean Kamen發明一種兩輪代步的電動車[賽格威],這是第一輛能夠自主平衡的運輸工具[或稱為兩輪平衡車],該兩輪代步的電動車[賽格威]引起很大的迴響,並在全世界造成一股流行趨勢;而兩輪平衡車的重要技術之一就是平衡穩定控制技術,其主要是引用適合的平衡穩定控制技術使兩輪平衡機具達到強健平衡穩定。Press, in 2001, the inventor Dean Kamen invented a two-wheeled electric vehicle [Segway], which is the first vehicle that can balance itself [or called a two-wheeled balance vehicle]. The car [Segway] caused great repercussions and caused a popular trend in the world; and one of the important technologies of the two-wheeled balance car is the balance and stability control technology, which mainly uses the appropriate balance and stability control technology to make the two wheels Wheel balancing implements achieve robust balance and stability.
其中,請參閱公告第M506767號「電動平衡車」,係設有一車輛本體,該車輛本體底部兩端之輪軸上各設有一輪胎,該輪胎係由一輪框、一外輪及一內胎所組成,該外輪係設於該輪框上,該內胎係設於該外輪內,該輪框上設有一氣嘴,該氣嘴係連接至該內胎。該結構主要是透過改變電動平衡車之輪胎係由外輪與內胎組設於輪框上,來解決電動平衡車在使用時因輪胎不具避震效果所存在之缺失。Among them, please refer to the Announcement No. M506767 "Electric Balance Vehicle", which is equipped with a vehicle body, and a tire is provided on the axles at both ends of the bottom of the vehicle body. The tire is composed of a wheel frame, an outer wheel and an inner tube. The outer wheel system is arranged on the wheel frame, the inner tire is arranged in the outer wheel, and an air nozzle is arranged on the wheel frame, and the air nozzle is connected to the inner tire. This structure is mainly to solve the lack of shock-absorbing effect of the tires when the electric balance car is in use by changing the tire system of the electric balance car to be assembled on the wheel frame by the outer wheel and the inner tube.
另,請參閱公告第M500726號「自平衡車之車架機構」,適用於組裝至少兩個車輪,及兩個自平衡機電系統組件,且該等自平衡機電系統組件可分別自動控制該等車輪轉動,以使其保持平衡狀態,該車架機構包含:兩個車架組,分別可安裝一個車輪與一個自平衡機電系統組件,且每一個車架組可被操作而單獨帶動各別之自平衡機電系統組件同步前後傾擺位移;及一個軸承組,連接該等車架組,使該等車架組可各自獨立地前後樞擺。該結構係能方便選擇以雙手操控把手及/或以雙腳踩踏操控踏板的方式,來控制兩輪自平衡車之行進與轉彎。Also, please refer to Announcement No. M500726 "Frame Mechanism of Self-balancing Vehicle", which is suitable for assembling at least two wheels and two self-balancing electromechanical system components, and these self-balancing electromechanical system components can automatically control the wheels respectively Rotate to keep it in a balanced state. The frame mechanism includes: two frame groups, each of which can be installed with a wheel and a self-balancing electromechanical system component, and each frame group can be operated to drive its own a balance electromechanical system component for synchronous front and rear tilt displacement; and a bearing set connecting the frame sets so that the frame sets can independently pivot forward and backward. The structure can conveniently select the way of controlling the handle with both hands and/or stepping on the pedal with both feet to control the traveling and turning of the two-wheeled self-balancing vehicle.
又,請參閱公告第I510394號「自動平衡載具及其轉向控制之方法」其包含:一載具本體,係包含一踩踏板;一第一感測器,係設於該踩踏板上,當一物體觸發該第一感測器時,該第一感測器係產生一第一感測訊號;一第二感測器,係設於該踩踏板上,當該物體觸發該第二感測器時,該第二感測器係產生一第二感測訊號;一控制模組,係接收該第一感測訊號以產生一第一驅動訊號,或接收該第二感測訊號以產生一第二驅動訊號;以及一驅動模組,係包含一第一輪體及一第二輪體,該第一輪體係設於該載具本體之一側,而該第二輪體係相對該第一輪體設於該載具本體之另一側,當該驅動模組對應該第一驅動訊號使該第一輪體與該第二輪體產生一第一速度差時,該載具本體將朝一第一方向轉向,而當該驅動模組對應該第二驅動訊號使該第一輪體與該第二輪體產生一第二速度差時,該載具本體將朝相對該第一方向之一第二方向轉向;其中,該載具本體更包含一升降模組,該升降模組係連結該踩踏板,該控制模組係依據一控制訊號控制該升降模組升降作動,以帶動該踩踏板升降。該結構係有關於一種藉由觸發第一感測器或第二感測器,以使載具本體朝不同方向轉向之技術。Also, please refer to the Announcement No. I510394 "Automatic Balance Vehicle and Its Steering Control Method", which includes: a vehicle body, which includes a pedal; a first sensor, which is arranged on the pedal, when When an object triggers the first sensor, the first sensor generates a first sensing signal; a second sensor is arranged on the pedal, and when the object triggers the second sensing signal When the controller is used, the second sensor generates a second sensing signal; a control module receives the first sensing signal to generate a first driving signal, or receives the second sensing signal to generate a The second driving signal; and a driving module, which includes a first wheel body and a second wheel body, the first wheel system is arranged on one side of the carrier body, and the second wheel system is opposite to the first wheel body The wheel body is arranged on the other side of the carrier body. When the driving module generates a first speed difference between the first wheel body and the second wheel body in response to the first driving signal, the carrier body will move towards a Turning in the first direction, and when the driving module generates a second speed difference between the first wheel body and the second wheel body in response to the second driving signal, the carrier body will face one of the first directions. Turning in the second direction; wherein, the vehicle body further includes a lifting module, the lifting module is connected to the pedal, and the control module controls the lifting movement of the lifting module according to a control signal to drive the pedal lift. The structure relates to a technique for turning the vehicle body in different directions by triggering the first sensor or the second sensor.
此外,現有的兩輪平衡穩定技術尚有使用比例-積分-微分(PID)的控制方法。其中,P代表比例控制項,可以減少系統的上升時間及延遲時間,但卻會增加系統的超越量。I代表積分控制項,可以減少或消除穩態誤差。D代表微分控制項,可以減少系統的最大超越量百分比,但同時卻會增加系統的上升時間及延遲時間。In addition, the existing two-wheel balance stabilization technology still uses a proportional-integral-derivative (PID) control method. Among them, P represents the proportional control item, which can reduce the rise time and delay time of the system, but it will increase the overshoot of the system. I represents the integral control item, which can reduce or eliminate the steady-state error. D represents the differential control item, which can reduce the maximum overshoot percentage of the system, but at the same time it will increase the rise time and delay time of the system.
然而,現有兩輪平衡車雖可達到平衡穩定控制之預期功效,但也在其實際操作施行上發現,該類結構皆係為使用固定參數調整方式,造成若環境條件產生變動,其即無法適應環境條件的變動,相對即導致無法進行穩定平衡控制,致令其在控制方式上仍存在有改進的空間。However, although the existing two-wheeled self-balancing vehicle can achieve the expected effect of balance and stability control, it is also found in its actual operation that this type of structure uses fixed parameter adjustment methods, resulting in that it cannot adapt to changes in environmental conditions. Changes in environmental conditions will relatively lead to the inability to carry out stable balance control, so there is still room for improvement in the control method.
緣是,發明人有鑑於此,秉持多年該相關行業之豐富設計開發及實際製作經驗,針對現有之缺失予以研究改良,提供一種深度學習控制兩輪機具平衡方法,以期達到更佳實用價值性之目的者。The reason is that, in view of this, the inventor has been adhering to many years of rich experience in design, development and actual production in this related industry, researched and improved the existing deficiencies, and provided a method of deep learning to control the balance of two-wheeled machines, in order to achieve better practical value. purpose.
本發明之主要目的在於提供一種深度學習控制兩輪機具平衡方法,其主要係以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。The main purpose of the present invention is to provide a method for deep learning to control the balance of two-wheeled implements, which mainly adjusts the controller parameters with the method of deep learning, and can have an adjustment mechanism of learning nature, which can widely adapt to changes in environmental parameters, so that The two-wheeled machine achieves a strong, balanced and stable automatic control function, and has more practical features in its overall execution and use.
為令本發明所運用之技術內容、發明目的及其達成之功效有更完整且清楚的揭露,茲於下詳細說明之,並請一併參閱所揭之圖式及圖號:In order to have a more complete and clear disclosure of the technical content used in the present invention, the purpose of the invention and the effects achieved, it will be described in detail below, and please also refer to the disclosed drawings and drawing numbers:
首先,要控制兩輪機具之車身的平衡,必須先了解兩輪機具的運動模式與相對應的決策,且配合偵測該兩輪機具之車身傾斜角度、車身傾斜角速度及馬達的位置,接著才能進行車身平衡控制方法之設計。First of all, in order to control the balance of the body of the two-wheeled machine, one must first understand the motion mode of the two-wheeled machine and the corresponding decision-making, and cooperate with the detection of the body tilt angle, body tilt angular velocity and motor position of the two-wheeled machine, and then Carry out the design of the body balance control method.
請參閱第一圖兩輪機具之車身傾斜狀態示意圖所示,G代表重心、O代表軸心、L代表地面,該兩輪機具之車身部分係以馬達軸心為中心作前後擺動,若假設車身垂直地面的角度為0度,由三軸加速器及陀螺儀可以量得車身擺動的角度。兩輪機具一開始必須保持車身與地面垂直,放開後有三種情況,分別是靜止、前傾與後傾;其簡單的控制方法如下:Please refer to the schematic diagram of the tilted state of the body of the two-wheeled machine in Figure 1. G represents the center of gravity, O represents the axis, and L represents the ground. The body part of the two-wheeled machine swings back and forth around the axis of the motor. The angle vertical to the ground is 0 degrees, and the swing angle of the vehicle body can be measured by the three-axis accelerometer and gyroscope. At the beginning, the two-wheeled equipment must keep the vehicle body vertical to the ground. After releasing it, there are three situations, which are static, forward tilt and backward tilt; the simple control method is as follows:
1.直立:若車身重心落在左右兩輪與地面接觸點連線中心位置,且車身保持平衡不動,則車輪靜止且不作任何動作。1. Upright: If the center of gravity of the vehicle body falls on the center of the line connecting the left and right wheels with the ground, and the vehicle body is kept in balance, the wheels are still and do not make any movement.
2.前傾:若車身重心偏向前,車身將向前傾斜,則控制車輪前進,依據車輪轉動與車身傾斜的相對角度及相對角速度大小,控制車輪前進的力量,以維持車身的平衡。2. Forward tilt: If the center of gravity of the vehicle body is tilted forward, the vehicle body will tilt forward, then control the wheel to move forward, and control the force of the wheel to move forward according to the relative angle and relative angular velocity between the rotation of the wheel and the body tilt, so as to maintain the balance of the vehicle body.
3.後傾:若車身重心偏向後,車身將向後傾斜,則控制車輪後退,依據車輪轉動與車身傾斜的相對角度及相對角速度大小,控制車輪後退的力量,以維持車身的平衡。3. Rear tilt: If the center of gravity of the vehicle body is tilted backward, the vehicle body will tilt backward, then control the wheels to move backward. According to the relative angle and relative angular velocity between the rotation of the wheels and the tilt of the vehicle body, control the force of the wheels moving backward to maintain the balance of the vehicle body.
請再一併參閱第二圖兩輪機具之立體簡化結構示意圖、第三圖兩輪機具之側視簡化結構示意圖及第四圖兩輪機具之俯視簡化結構示意圖所示, 是重力加速度, 是輪子的重量, 是輪子的半徑, 是輪子的轉動慣量, 是兩輪機具之機身的質量, 是兩輪機具之機身的寬度, 是兩輪機具之機身的深度, 是兩輪機具之機身的高度, 為馬達軸到重心的長度, 為傾斜角度[pitch]轉動慣量, 為偏轉角度[yaw]的轉動慣量, 為馬達的轉動慣量, 是齒輪箱比值;左輪的轉動角度是 ,右輪的轉動角度是 ,左右輪的平均角度為 ,所以 ;左馬達的轉動角度是 ,右馬達的轉動角度是 ,兩輪機具之機身的傾斜角度[pitch]為 ,兩輪機具偏轉角度[yaw]為 。 Please also refer to the three-dimensional simplified structural diagram of the two-wheeled machine tool in Figure 2, the simplified structural schematic diagram of the side view of the two-wheeled machine tool in Figure 3, and the simplified structural schematic diagram of the top view of the two-wheeled machine tool in Figure 4, is the acceleration of gravity, is the weight of the wheel, is the radius of the wheel, is the moment of inertia of the wheel, is the mass of the body of the two-wheeled machine, is the width of the fuselage of the two-wheeled machine, is the depth of the fuselage of the two-wheeled machine, is the height of the fuselage of the two-wheeled machine, is the length from the motor shaft to the center of gravity, is the moment of inertia of the tilt angle [pitch], is the moment of inertia of deflection angle [yaw], is the moment of inertia of the motor, is the gearbox ratio; the rotation angle of the left wheel is , the rotation angle of the right wheel is , the average angle of the left and right wheels is ,so ;The rotation angle of the left motor is , the rotation angle of the right motor is , the inclination angle [pitch] of the fuselage of the two-wheeled implement is , the deflection angle [yaw] of the two-wheel implement is .
以下進一步具體說明本發明深度學習控制兩輪機具平衡方法,請再一併參閱第五圖本發明之步驟流程示意圖所示,其包括下列步驟:The following further specifically describes the deep learning method of the present invention to control the balance of two-wheeled implements. Please also refer to the fifth figure as shown in the schematic flow chart of the steps of the present invention, which includes the following steps:
步驟一(S01):測量一兩輪機具的輪胎轉動角度、傾斜角度[pitch]及偏轉角度[yaw],以判斷所述兩輪機具處於直立、前傾、後傾、左轉或右轉狀態;Step 1 (S01): Measure the tire rotation angle, inclination angle [pitch] and deflection angle [yaw] of a two-wheeled implement to determine whether the two-wheeled implement is in an upright, forward, backward, left-turned or right-turned state ;
步驟二(S02):對所述兩輪機具的左右輪的平均角度變數 及兩輪機具的傾斜角度[pitch]變數 進行深度學習控制,進而得到第一控制輸出的電壓控制值; Step 2 (S02): the average angle variable of the left and right wheels of the two-wheel implement And the tilt angle [pitch] variable of the two-wheeled implement performing deep learning control, and then obtaining the voltage control value of the first control output;
步驟三(S03):對所述兩輪機具的偏轉角度[yaw]變數 以極點設置法[pole assignment]進行狀態回授控制,以得到第二控制輸出的電壓控制值; Step 3 (S03): Change the deflection angle [yaw] of the two-wheel implement Perform state feedback control with pole assignment method to obtain the voltage control value of the second control output;
步驟四(S04):將所述第一控制輸出的電壓控制值加上所述第二控制輸出的電壓控制值,除以二,即得到右輪驅動馬達的電壓控制值,以控制右輪驅動馬達的轉速與轉向;將所述第一控制輸出的電壓控制值減去所述第二控制輸出的電壓控制值,除以二,即得到左輪驅動馬達的電壓控制值,以控制左輪驅動馬達的轉速與轉向。Step 4 (S04): Add the voltage control value of the first control output to the voltage control value of the second control output, and divide by two to obtain the voltage control value of the right wheel drive motor to control the right wheel drive The rotation speed and steering of the motor; the voltage control value of the first control output minus the voltage control value of the second control output is divided by two to obtain the voltage control value of the left wheel drive motor to control the left wheel drive motor speed and steering.
使用拉格朗奇方法[Lagrangian]推導兩輪機具的動態方程式,假設傾斜角很小時( )可以簡化如下: Use the Lagrangian method [Lagrangian] to derive the dynamic equation of the two-wheeled implement, assuming that the inclination angle is small ( ) can be simplified as follows:
(1) (1)
(2) (2)
(3) (3)
座標系統的變數如下, 代表 角度方向的力矩[Torque], 代表 角度方向的力矩[Torque], 代表 角度方向的力矩[Torque], 代表左右馬達的端電壓, 是齒輪箱比值, 是力矩常數, 為馬達的摩擦係數, 是輪子與地的摩擦係數, 代表反電動勢常數, 代表電樞電阻。 The variables of the coordinate system are as follows, represent Angular moment [Torque], represent Angular moment [Torque], represent Angular moment [Torque], Represents the terminal voltage of the left and right motors, is the gearbox ratio, is the moment constant, is the friction coefficient of the motor, is the coefficient of friction between the wheel and the ground, represents the back EMF constant, Represents the armature resistance.
將電壓公式代入(1)-(3)式線性方程式中,可以得到以下公式:Substituting the voltage formula into the linear equation (1)-(3), the following formula can be obtained:
(4) (4)
其中 矩陣如下: in The matrix is as follows:
, ,
, ,
, ,
, ,
而且 、 。 and , .
是左馬達產生的力矩, 是右馬達產生的力矩, 是機身偏轉角度(yaw), 角度方向的力矩[Torque]如下: is the torque produced by the left motor, is the torque produced by the right motor, is the airframe deflection angle (yaw), The torque [Torque] in the angular direction is as follows:
(5) (5)
其中 。 in .
根據(3)式及(5)式,化簡可得:According to formula (3) and formula (5), simplification can be obtained:
(6) (6)
其中參數如下,The parameters are as follows,
, , , ,
由(4)式展開可得,求解 及 ,得: From formula (4), it can be obtained that the solution and ,have to:
(7) (7)
(8) (8)
由(6)式展開可得:Expanded from formula (6), we can get:
(9) (9)
由(9)式能得知可以用 來控制機身偏轉角度[yaw] ,由(7)式及(8)式能得知可以用 來控制左右輪的平均角度 及機身傾斜角度[pitch] 。 From formula (9), it can be known that the to control the body deflection angle [yaw] , from formula (7) and formula (8), it can be known that it can be used to control the average angle of the left and right wheels and body tilt angle [pitch] .
由 及 的值可算出所需的右輪馬達控制電壓 及左輪馬達控制電壓 。 Depend on and The value of the required right wheel motor control voltage can be calculated and left wheel motor control voltage .
令狀態變數 為左右輪的平均角度 ,狀態變數 為機身傾斜角度[pitch] ,狀態變數 為 ,狀態變數 為 ,狀態變數 為機身偏轉角度[yaw] ,狀態變數 為 , 的值為 , 的值為 ,則系統的狀態空間方程式為: Let the state variable is the average angle of the left and right wheels , the state variable is the inclination angle of the fuselage [pitch] , the state variable for , the state variable for , the state variable is the body deflection angle [yaw] , the state variable for , The value is , The value is , then the state-space equation of the system is:
(10) (10)
(11) (11)
其中參數如下,The parameters are as follows,
, , , , , ,
, ,
, , , , , ,
, ,
而所需的右輪馬達控制電壓 及左輪馬達控制電壓 為: while the required right wheel motor control voltage and left wheel motor control voltage for:
, 。 , .
就(10)式而言,狀態回授控制器可以改寫如下:As far as (10) is concerned, the state feedback controller can be rewritten as follows:
(12) (12)
其中 , , , 。 in , , , .
由(12)式,可以說狀態回授控制器等效於[equivalent] PD控制。將(12)式分成兩個PD控制的分量如下;From (12), it can be said that the state feedback controller is equivalent to [equivalent] PD control. Divide (12) into two PD control components as follows;
(13) (13)
則狀態回授控制等效於雙PD控制。Then the state feedback control is equivalent to the dual PD control.
對於一個可穩定[stabilizable]及可偵測[detectable]線性非時變系統,For a stable [stabilizable] and detectable [detectable] linear time-invariant system,
(14) (14)
其中 是狀態向量, 是控制輸入, 是系統矩陣, 是控制輸入矩陣,則狀態回授控制為, in is the state vector, is the control input, is the system matrix, is the control input matrix, then the state feedback control is,
(15) (15)
因為系統是可穩定[stabilizable]及可偵測[detectable]線性非時變系統,則系統可以用狀態回授控制器達到穩定控制的目的。以下將使用雙PD控制達到穩定控制的目的。Because the system is a stable [stabilizable] and detectable [detectable] linear time-invariant system, the system can use the state feedback controller to achieve the purpose of stable control. The following will use dual PD control to achieve the purpose of stable control.
至於(11)式則單獨另外設計控制器,就(11)式而言,在狀態回授控制器如下:As for formula (11), the controller is designed separately. As far as formula (11) is concerned, the state feedback controller is as follows:
(16) (16)
將(16)式代入(11)式,則可以得到:Substituting formula (16) into formula (11), we can get:
(17) (17)
則受控系統(17)的特性方程式[characteristic equation]為:Then the characteristic equation of the controlled system (17) is:
(18) (18)
若要設計系統的極點[poles]於 , ,則設計系統的特性方程式為: To design the poles [poles] of the system at , , then the characteristic equation of the design system is:
(19) (19)
比較(18)式及(19)式,可得控制器為:Comparing formula (18) and formula (19), the controller can be obtained as:
, (20) , (20)
根據(13)式就可以求得 ,根據(20)式就可以求得 ,再根據下式 According to (13), it can be obtained , according to (20) can get , and then according to the following formula
, , , ,
即可以求得 及 ,進而可以控制兩輪機具的穩定平衡。 that can be obtained and , which in turn can control the stable balance of the two-wheel implement.
另,就該步驟二(S02)之深度學習控制而言,該數位控制器需要調節的控制參數如下:In addition, as far as the deep learning control of step 2 (S02) is concerned, the control parameters that the digital controller needs to adjust are as follows:
, ,
是狀態回授控制參數, is the state feedback control parameter,
利用深度學習的方法調整該控制參數,深度學習是使用多層類神經網路作為控制方法,請再一併參閱第六圖本發明之多層類神經網路架構示意圖所示,其中,變數符號 是深度學習類神經網路的輸入節點, 、 是該受控系統的量測輸出第k個取樣,變數符號 是該輸入節點的偏值,變數符號 、 各是第1層、第2層的隱藏節點,隱藏層有2層以上;變數符號 、 是該隱藏節點的偏值,變數符號 是輸出節點,該自動控制系統需要調節的控制參數為 ,是狀態回授控制參數,其中該輸出節點代表意思如下: Utilize the method of deep learning to adjust the control parameters. Deep learning uses multi-layer neural network as the control method. Please refer to the schematic diagram of the multi-layer neural network architecture of the present invention in Figure 6. Among them, the variable symbols is the input node of deep learning neural network, , is the kth sample of the measured output of the controlled system, and the symbol of the variable is is the bias value of the input node, variable symbol , Each is the hidden node of the first layer and the second layer, and the hidden layer has more than two layers; the variable symbol , is the bias value of the hidden node, variable symbol is the output node, and the control parameters that the automatic control system needs to adjust are , is the state feedback control parameter, where the output node represents the following meanings:
, , , , , , , ,
該深度學習類神經網路的權值如下:The weights of this deep learning neural network are as follows:
令參數符號 是該輸入節點與該第1層隱藏節點間的權值,參數符號 是該第1層隱藏節點與該第2層隱藏節點間的權值,參數符號 是該第2層隱藏節點與該輸出節點間的權值, Let parameter symbol is the weight between the input node and the hidden node of the first layer, parameter symbol is the weight between the hidden node of the first layer and the hidden node of the second layer, parameter symbol is the weight between the second layer hidden node and the output node,
該第1層隱藏節點與該輸入節點的關係如下:The relationship between the
,該
係為函數符號,而該等號左右兩式係單一純量,
是第1層隱藏節點
的計算值,
,啟動函數
使用如下的雙極S型函數,將輸出適當的縮放到值域-1到1之間,
,
。
,Should is a function symbol, and the left and right sides of the equal sign are single scalars, is the
該第2層隱藏節點與該第1層隱藏節點的關係如下:The relationship between the second layer hidden node and the first layer hidden node is as follows:
,該 係為函數符號,而該等號左右兩式係單一純量, 是第二層隱藏層節點 的計算值, 。 ,Should is a function symbol, and the left and right sides of the equal sign are single scalars, is the second hidden layer node the calculated value of .
該輸出節點與該第2層隱藏節點的關係如下:The relationship between the output node and the layer 2 hidden node is as follows:
,該 係為函數符號,而該等號左右兩式係單一純量, 是輸出層節點 的計算值, 。 ,Should is a function symbol, and the left and right sides of the equal sign are single scalars, is the output layer node the calculated value of .
該輸入節點 連接到左右輪的平均角度 ,該輸入節點 連接到機身的傾斜角度[pitch]為 ,使用倒傳遞法求每一層的權值,訓練的目的是要使誤差平方達到最小,誤差的平方為: The input node Attached to the average angle of the left and right wheels , the input node The angle of inclination [pitch] attached to the fuselage is , using the reverse transfer method to find the weight of each layer, the purpose of training is to minimize the square of the error, the square of the error is:
,該 代表誤差的平方,該 代表誤差平方根, 是左右輪的平均角度參考輸入, 是機身傾斜角度[pitch]參考輸入, 、 是該受控系統的量測輸出第k個取樣。 ,Should represents the square of the error, the stands for the square root of the error, is the average angle reference input of the left and right wheels, is the body tilt angle [pitch] reference input, , is the kth sample of the measured output of the controlled system.
權值用以下的方法來更新,輸入層到該第一層隱藏層為:The weights are updated in the following way, from the input layer to the first hidden layer:
, ,
, ,
為數學上的差量,該第一層隱藏層到該第二層隱藏層為: is the mathematical difference, the first hidden layer to the second hidden layer is:
, ,
, ,
該第二層隱藏層到輸出層為:The second hidden layer to the output layer is:
, ,
, ,
其中 為學習速率常數。 in is the learning rate constant.
偏微分 , , , , 及 的計算如下。 partial differential , , , , and The calculation of is as follows.
, ,
, ,
, ,
, ,
, ,
, ,
其中in
, , , , , ,
, , , ,
, , , ,
, , , ,
, , , ,
, , , ,
在實用上,偏微分 可以用 來近似,其中 且 。因此偏微分 , , , , 及 可以改寫如下, 為狀態變數: In practice, partial differential Can use to approximate, where and . So the partial differential , , , , and can be rewritten as follows, For state variables:
, ,
, ,
, ,
, ,
, ,
, ,
該輸出節點、第二層隱藏層節點與第一層隱藏層節點的微量變動為:The slight changes of the output node, the second hidden layer node and the first hidden layer node are:
其中 , , 。 in , , .
因此權值的更新公式可以更改如下, 為狀態變數: Therefore, the update formula of the weight can be changed as follows, For state variables:
, ,
, ,
, ,
, ,
, ,
, ,
學習法則可以修改為以下公式,The learning rule can be modified as the following formula,
, ,
, ,
, ,
, ,
, ,
, ,
其中,動力[momentum]因子的範圍為 。加上動力[momentum]可以使類神經網路的學習計算時不會掉入局部最小值。 Among them, the range of the dynamic [momentum] factor is . Adding momentum [momentum] can prevent the neural network from falling into the local minimum when learning and calculating.
藉由以上所述,本發明之使用實施說明可知,本發明與現有技術手段相較之下,本發明主要係以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。From the above, the description of the use and implementation of the present invention shows that, compared with the prior art, the present invention mainly adjusts the controller parameters by means of deep learning, which can have a learning adjustment mechanism and can be widely used. Adapting to changes in environmental parameters, so as to achieve a strong, balanced and stable automatic control function for two-wheeled machines, and to increase practical performance characteristics in its overall implementation and use.
然而前述之實施例或圖式並非限定本發明之產品結構或使用方式,任何所屬技術領域中具有通常知識者之適當變化或修飾,皆應視為不脫離本發明之專利範疇。However, the aforementioned embodiments or drawings do not limit the product structure or usage of the present invention, and any appropriate changes or modifications by those with ordinary knowledge in the technical field shall be considered as not departing from the patent scope of the present invention.
綜上所述,本發明實施例確能達到所預期之使用功效,又其所揭露之具體構造,不僅未曾見諸於同類產品中,亦未曾公開於申請前,誠已完全符合專利法之規定與要求,爰依法提出發明專利之申請,懇請惠予審查,並賜准專利,則實感德便。To sum up, the embodiment of the present invention can indeed achieve the expected use effect, and the specific structure disclosed by it has not only never been seen in similar products, nor has it been disclosed before the application, and it has fully complied with the provisions of the Patent Law In accordance with the requirements, it is very convenient to file an application for a patent for invention in accordance with the law, and sincerely ask for the review and approval of the patent.
S01:步驟一S01:
S02:步驟二S02: Step 2
S03:步驟三S03: Step 3
S04:步驟四S04: Step 4
第一圖:兩輪機具之車身傾斜狀態示意圖Figure 1: Schematic diagram of the tilted state of the body of the two-wheeled machine
第二圖:兩輪機具之立體簡化結構示意圖Figure 2: Schematic diagram of a three-dimensional simplified structure of a two-wheeled machine tool
第三圖:兩輪機具之側視簡化結構示意圖Figure 3: Simplified schematic diagram of the side view of the two-wheeled machine tool
第四圖:兩輪機具之俯視簡化結構示意圖Figure 4: Simplified structural schematic diagram of a top view of a two-wheeled machine tool
第五圖:本發明之步驟流程示意圖Figure 5: Schematic diagram of the steps of the present invention
第六圖:本發明之多層類神經網路架構示意圖Figure 6: Schematic diagram of the multi-layer neural network architecture of the present invention
S01:步驟一
S01:
S02:步驟二 S02: Step 2
S03:步驟三 S03: Step 3
S04:步驟四 S04: Step 4
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW110109261A TWI767612B (en) | 2021-03-16 | 2021-03-16 | Deep learning method for controlling the balance of a two-wheeled machine |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW110109261A TWI767612B (en) | 2021-03-16 | 2021-03-16 | Deep learning method for controlling the balance of a two-wheeled machine |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI767612B TWI767612B (en) | 2022-06-11 |
| TW202238302A true TW202238302A (en) | 2022-10-01 |
Family
ID=83103740
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW110109261A TWI767612B (en) | 2021-03-16 | 2021-03-16 | Deep learning method for controlling the balance of a two-wheeled machine |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI767612B (en) |
Family Cites Families (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8532877B2 (en) * | 2008-07-29 | 2013-09-10 | Toyota Jidosha Kabushiki Kaisha | Coaxial two-wheeled vehicle and its control method |
| US8457830B2 (en) * | 2010-03-22 | 2013-06-04 | John R. Goulding | In-line legged robot vehicle and method for operating |
| TWI510394B (en) * | 2013-06-24 | 2015-12-01 | Univ Nat Taiwan Normal | Automatic balancing vehicle and turning control method thereof |
| GB2506726B (en) * | 2013-07-16 | 2014-10-22 | Sergey Nikolaevich Andreev | Two-wheel gyroscope-stabilized vehicle and methods for controlling thereof |
| CN105216933B (en) * | 2014-06-10 | 2019-04-16 | 扬顶(天津)商贸有限公司 | A kind of frame assembly of double-wheel self-balancing electrombile |
| US10252724B2 (en) * | 2015-09-24 | 2019-04-09 | P&N Phc, Llc | Portable two-wheeled self-balancing personal transport vehicle |
| CN105383623B (en) * | 2015-12-16 | 2017-11-07 | 华南理工大学 | A kind of Portable electric bicycle and its control method of driving |
| TWI592777B (en) * | 2016-05-19 | 2017-07-21 | 崑山科技大學 | Method for controlling two-wheel machine in balance by use of artificial intelligence |
| WO2018012219A1 (en) * | 2016-07-11 | 2018-01-18 | Groove X株式会社 | Autonomous-behavior-type robot |
| US10739772B2 (en) * | 2016-07-19 | 2020-08-11 | Christopher Andrew Tacklind | Two wheel in-line robots |
| US9999827B2 (en) * | 2016-10-25 | 2018-06-19 | Future Motion, Inc. | Self-balancing skateboard with strain-based controls and suspensions |
| GB2568912B (en) * | 2017-11-30 | 2022-09-21 | Moss Nicholas | Remote control vehicle |
| US11932319B2 (en) * | 2018-04-13 | 2024-03-19 | Vikas PODDAR | System and method for balancing a vehicle |
-
2021
- 2021-03-16 TW TW110109261A patent/TWI767612B/en active
Also Published As
| Publication number | Publication date |
|---|---|
| TWI767612B (en) | 2022-06-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4600539B2 (en) | TRAVEL DEVICE AND TRAVEL DEVICE CONTROL METHOD | |
| CN106080941B (en) | A kind of unmanned bicycle for realizing speed change balance control | |
| CN100530018C (en) | Control method of mobile trolley and mobile trolley | |
| CN107728635B (en) | Automatic balancing device and method for motorcycle type robot | |
| CA2659308C (en) | Speed limiting in electric vehicles | |
| CN102642584B (en) | Self-balancing electric manned monocycle | |
| US8738259B2 (en) | Movable body, travel device, and movable body control method | |
| CN101568465A (en) | Inverted two-wheel type carrier, and its control method | |
| CN101573250A (en) | Travel device and control method thereof | |
| JPWO2011033591A1 (en) | Control device for inverted pendulum type vehicle | |
| JP7366281B2 (en) | motorcycle | |
| CN108146564A (en) | Balance control method, system, device and sulky vehicle | |
| US9845101B2 (en) | Pushcart | |
| JP5404800B2 (en) | Inverted pendulum type vehicle | |
| JP5306472B2 (en) | Control device for inverted pendulum type vehicle | |
| US20060063137A1 (en) | Wheeled vehicles and control systems and methods therefor | |
| KR101063889B1 (en) | Control system of the unicycle robot and its design method | |
| JP5355348B2 (en) | Control device for omnidirectional vehicle | |
| TW202238302A (en) | Deep learning method for controlling the balance of a two-wheeled machine | |
| JP5306471B2 (en) | Control device for inverted pendulum type vehicle | |
| JP2004338507A (en) | Motorcycle | |
| JP2011068216A (en) | Control device of omnidirectional moving vehicle | |
| Schwab et al. | Some recent developments in bicycle dynamics | |
| TWI592777B (en) | Method for controlling two-wheel machine in balance by use of artificial intelligence | |
| CN110109353A (en) | A kind of reaction wheel balance-bicycle Robot Fuzzy adaptive sliding-mode observer system |



















































































































































































































































































































































































































































































































