TWI767612B - 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
- TWI767612B TWI767612B TW110109261A TW110109261A TWI767612B TW I767612 B TWI767612 B TW I767612B TW 110109261 A TW110109261 A TW 110109261A TW 110109261 A TW110109261 A TW 110109261A TW I767612 B TWI767612 B TW I767612B
- Authority
- TW
- Taiwan
- Prior art keywords
- control
- layer
- node
- angle
- follows
- Prior art date
Links
Images
Abstract
Description
本發明係有關於一種深度學習控制兩輪機具平衡方法,尤其是指一種以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。The present invention relates to a deep learning method for controlling the balance of two-wheeled implements, in particular to a deep learning method for adjusting controller parameters, which can have a learning-like adjustment mechanism, and can widely adapt to changes in environmental parameters, so that two The mechanical equipment achieves the automatic control function of strong balance and stability, and the practical function characteristics are enhanced in its overall implementation and use.
按,2001年由發明家Dean Kamen發明一種兩輪代步的電動車[賽格威],這是第一輛能夠自主平衡的運輸工具[或稱為兩輪平衡車],該兩輪代步的電動車[賽格威]引起很大的迴響,並在全世界造成一股流行趨勢;而兩輪平衡車的重要技術之一就是平衡穩定控制技術,其主要是引用適合的平衡穩定控制技術使兩輪平衡機具達到強健平衡穩定。According to, in 2001, inventor Dean Kamen invented a two-wheeled electric vehicle [Segway], which is the first self-balancing means of transport [or called a two-wheeled balance vehicle]. The two-wheeled electric vehicle The car [Segway] caused a lot of repercussions and caused a fashion 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 refers to the appropriate balance and stability control technology to make the two Wheel balancer achieves strong balance and stability.
其中,請參閱公告第M506767號「電動平衡車」,係設有一車輛本體,該車輛本體底部兩端之輪軸上各設有一輪胎,該輪胎係由一輪框、一外輪及一內胎所組成,該外輪係設於該輪框上,該內胎係設於該外輪內,該輪框上設有一氣嘴,該氣嘴係連接至該內胎。該結構主要是透過改變電動平衡車之輪胎係由外輪與內胎組設於輪框上,來解決電動平衡車在使用時因輪胎不具避震效果所存在之缺失。Among them, please refer to Announcement No. M506767 "Electric Balance Vehicle", which is equipped with a vehicle body, and a tire is provided on each of 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 is arranged on the wheel frame, the inner tube is arranged in the outer wheel, and an air nozzle is arranged on the wheel frame, and the air valve is connected to the inner tube. This structure mainly solves the problem that the electric balancing scooter does not have a shock-absorbing effect when the electric balancing scooter is in use by changing the tire system of the electric balancing scooter to be assembled from the outer wheel and the inner tube on the wheel frame.
另,請參閱公告第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 sets, which can respectively install a wheel and a self-balancing electromechanical system component, and each frame set can be operated to drive its own The balancing electromechanical system components synchronize front and rear tilting displacements; and a bearing set connects the frame sets so that the frame sets can pivot forward and backward independently. The structure can conveniently control the running and turning of the two-wheeled self-balancing vehicle by controlling the handle with both hands and/or stepping on the control pedal with both feet.
又,請參閱公告第I510394號「自動平衡載具及其轉向控制之方法」其包含:一載具本體,係包含一踩踏板;一第一感測器,係設於該踩踏板上,當一物體觸發該第一感測器時,該第一感測器係產生一第一感測訊號;一第二感測器,係設於該踩踏板上,當該物體觸發該第二感測器時,該第二感測器係產生一第二感測訊號;一控制模組,係接收該第一感測訊號以產生一第一驅動訊號,或接收該第二感測訊號以產生一第二驅動訊號;以及一驅動模組,係包含一第一輪體及一第二輪體,該第一輪體係設於該載具本體之一側,而該第二輪體係相對該第一輪體設於該載具本體之另一側,當該驅動模組對應該第一驅動訊號使該第一輪體與該第二輪體產生一第一速度差時,該載具本體將朝一第一方向轉向,而當該驅動模組對應該第二驅動訊號使該第一輪體與該第二輪體產生一第二速度差時,該載具本體將朝相對該第一方向之一第二方向轉向;其中,該載具本體更包含一升降模組,該升降模組係連結該踩踏板,該控制模組係依據一控制訊號控制該升降模組升降作動,以帶動該踩踏板升降。該結構係有關於一種藉由觸發第一感測器或第二感測器,以使載具本體朝不同方向轉向之技術。Also, please refer to Announcement No. I510394 "Automatically Balanced Vehicle and its Steering Control Method", which includes: a vehicle body including a pedal; a first sensor arranged on the pedal, when When an object triggers the first sensor, the first sensor generates a first sensing signal; a second sensor is set on the pedal, when the object triggers the second sensing When the device is activated, 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 a second driving signal; and a driving module comprising a first wheel body and a second wheel body, the first wheel system is arranged on one side of the vehicle 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 corresponds to the first driving signal to generate a first speed difference between the first wheel body and the second wheel body, the carrier body will move toward a The first direction is turned, and when the driving module corresponding to the second driving signal causes the first wheel body and the second wheel body to generate a second speed difference, the carrier body will face one of the first directions The second direction turns; wherein, the carrier body further includes a lift module, the lift module is connected to the pedal, and the control module controls the lift module to move up and down according to a control signal to drive the pedal lift. The structure relates to a technology for turning the carrier 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 has 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 excess of the system. I stands for the integral control term, which reduces or eliminates steady-state errors. D represents the derivative control term, which can reduce the maximum overrun percentage of the system, but at the same time increase the rise time and delay time of the system.
然而,現有兩輪平衡車雖可達到平衡穩定控制之預期功效,但也在其實際操作施行上發現,該類結構皆係為使用固定參數調整方式,造成若環境條件產生變動,其即無法適應環境條件的變動,相對即導致無法進行穩定平衡控制,致令其在控制方式上仍存在有改進的空間。However, although the existing two-wheeled balance car can achieve the expected effect of balance and stability control, it is also found in its actual operation that this type of structure uses a fixed parameter adjustment method, so that if the environmental conditions change, it cannot adapt to the Changes in environmental conditions relatively make it impossible to carry out stable balance control, so that there is still room for improvement in the control method.
緣是,發明人有鑑於此,秉持多年該相關行業之豐富設計開發及實際製作經驗,針對現有之缺失予以研究改良,提供一種深度學習控制兩輪機具平衡方法,以期達到更佳實用價值性之目的者。The reason is that in view of this, the inventor, adhering to years of rich experience in design, development and actual production in the related industry, researches and improves the existing deficiencies, and provides a deep learning control method for the balance of two-wheeled equipment, in order to achieve better practical value. target person.
本發明之主要目的在於提供一種深度學習控制兩輪機具平衡方法,其主要係以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。The main purpose of the present invention is to provide a deep learning method for controlling the balance of two-wheeled implements, which mainly adjusts the controller parameters by means of deep learning, and has a learning adjustment mechanism that can widely adapt to changes in environmental parameters, so that the The two-wheeled equipment achieves the automatic control function of strong balance and stability, and the overall implementation and use of the utility model are more practical.
為令本發明所運用之技術內容、發明目的及其達成之功效有更完整且清楚的揭露,茲於下詳細說明之,並請一併參閱所揭之圖式及圖號:In order to make the technical content used in the present invention, the purpose of the invention and the effect achieved by the present invention more completely and clearly disclosed, it is explained in detail below, and please refer to the disclosed drawings and drawing numbers together:
首先,要控制兩輪機具之車身的平衡,必須先了解兩輪機具的運動模式與相對應的決策,且配合偵測該兩輪機具之車身傾斜角度、車身傾斜角速度及馬達的位置,接著才能進行車身平衡控制方法之設計。First of all, to control the balance of the body of the two-wheeled machine, it is necessary to 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 the position of the motor of the two-wheeled machine. Carry out the design of the body balance control method.
請參閱第一圖兩輪機具之車身傾斜狀態示意圖所示,G代表重心、O代表軸心、L代表地面,該兩輪機具之車身部分係以馬達軸心為中心作前後擺動,若假設車身垂直地面的角度為0度,由三軸加速器及陀螺儀可以量得車身擺動的角度。兩輪機具一開始必須保持車身與地面垂直,放開後有三種情況,分別是靜止、前傾與後傾;其簡單的控制方法如下:Please refer to the schematic diagram of the body tilting state 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 of the two-wheeled machine swings forward and backward with the motor axis as the center. The angle of the vertical ground is 0 degrees, and the angle of the body swing can be measured by the three-axis accelerator and gyroscope. The two-wheeled machine must keep the body perpendicular to the ground at the beginning, and there are three situations after it is released, namely static, forward and backward; the simple control methods are as follows:
1.直立:若車身重心落在左右兩輪與地面接觸點連線中心位置,且車身保持平衡不動,則車輪靜止且不作任何動作。1. Upright: If the center of gravity of the body falls on the center of the line connecting the left and right wheels and the ground contact points, and the body remains balanced, the wheels are stationary and do not move.
2.前傾:若車身重心偏向前,車身將向前傾斜,則控制車輪前進,依據車輪轉動與車身傾斜的相對角度及相對角速度大小,控制車輪前進的力量,以維持車身的平衡。2. Forward tilt: If the center of gravity of the body is biased forward, the body will tilt forward, control the wheel forward, and control the force of the wheel forward according to the relative angle of the wheel rotation and the tilt of the body and the relative angular velocity to maintain the balance of the body.
3.後傾:若車身重心偏向後,車身將向後傾斜,則控制車輪後退,依據車輪轉動與車身傾斜的相對角度及相對角速度大小,控制車輪後退的力量,以維持車身的平衡。3. Rearward tilt: If the center of gravity of the body is biased to the rear, the body will tilt backward, control the wheel to move backward, and control the force of the wheel backward according to the relative angle of the wheel rotation and the tilt of the body and the relative angular velocity, so as to maintain the balance of the body.
請再一併參閱第二圖兩輪機具之立體簡化結構示意圖、第三圖兩輪機具之側視簡化結構示意圖及第四圖兩輪機具之俯視簡化結構示意圖所示, 是重力加速度, 是輪子的重量, 是輪子的半徑, 是輪子的轉動慣量, 是兩輪機具之機身的質量, 是兩輪機具之機身的寬度, 是兩輪機具之機身的深度, 是兩輪機具之機身的高度, 為馬達軸到重心的長度, 為傾斜角度[pitch]轉動慣量, 為偏轉角度[yaw]的轉動慣量, 為馬達的轉動慣量, 是齒輪箱比值;左輪的轉動角度是 ,右輪的轉動角度是 ,左右輪的平均角度為 ,所以 ;左馬達的轉動角度是 ,右馬達的轉動角度是 ,兩輪機具之機身的傾斜角度[pitch]為 ,兩輪機具偏轉角度[yaw]為 。 Please also refer to the simplified three-dimensional structural schematic diagram of the two-wheeled machine in Figure 2, the simplified schematic side view of the two-wheeled machine in Figure 3, and the simplified top view of the two-wheeled machine in Figure 4. is the gravitational acceleration, 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 fuselage of the two-wheeled implement, is the width of the fuselage of the two-wheeled implement, is the depth of the fuselage of the two-wheeled implement, is the height of the fuselage of the two-wheeled implement, is the length from the motor shaft to the center of gravity, is the pitch angle [pitch] moment of inertia, is the moment of inertia of the deflection angle [yaw], is the moment of inertia of the motor, is the gearbox ratio; the rotation angle of the revolver 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 of the two-wheeled implement [yaw] is .
以下進一步具體說明本發明深度學習控制兩輪機具平衡方法,請再一併參閱第五圖本發明之步驟流程示意圖所示,其包括下列步驟:The following is a further detailed description of the deep learning control method for balancing two-wheeled implements of the present invention. Please refer to the schematic diagram of the steps of the present invention in Fig. 5, which includes the following steps:
步驟一(S01):測量一兩輪機具的輪胎轉動角度、傾斜角度[pitch]及偏轉角度[yaw],以判斷所述兩輪機具處於直立、前傾、後傾、左轉或右轉狀態;Step 1 (S01): Measure the tire rotation angle, inclination angle [pitch] and yaw angle [yaw] of the two-wheeled machine tool to determine whether the two-wheeled machine tool is in the state of upright, forward tilt, backward tilt, left turn or right turn ;
步驟二(S02):對所述兩輪機具的左右輪的平均角度變數 及兩輪機具的傾斜角度[pitch]變數 進行深度學習控制,進而得到第一控制輸出的電壓控制值; Step 2 (S02): the average angle variable of the left and right wheels of the two-wheeled machine tool and the pitch angle of the two-wheeled implement [pitch] variable Perform deep learning control, and then obtain the voltage control value of the first control output;
步驟三(S03):對所述兩輪機具的偏轉角度[yaw]變數 以極點設置法[pole assignment]進行狀態回授控制,以得到第二控制輸出的電壓控制值; Step 3 (S03): the deflection angle [yaw] variable of the two-wheeled implement The state feedback control is performed by the 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 speed and steering of the motor; the voltage control value of the first control output is subtracted from the voltage control value of the second control output, and divided by two, the voltage control value of the left-wheel drive motor is obtained to control the left-wheel drive motor. Speed and steering.
使用拉格朗奇方法[Lagrangian]推導兩輪機具的動態方程式,假設傾斜角很小時( )可以簡化如下: Use the Lagrangian method [Lagrangian] to derive the dynamic equations of the two-wheeled implement, assuming that the angle of inclination 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 friction coefficient between the wheel and the ground, represents the back EMF constant, represents the armature resistance.
將電壓公式代入(1)-(3)式線性方程式中,可以得到以下公式:Substituting the voltage formula into the linear equations of (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 fuselage deflection angle (yaw), The moment [Torque] in the angular direction is as follows:
(5) (5)
其中 。 in .
根據(3)式及(5)式,化簡可得:According to equations (3) and (5), simplification can be obtained:
(6) (6)
其中參數如下,The parameters are as follows,
, , , ,
由(4)式展開可得,求解 及 ,得: It can be obtained from the expansion of (4), the solution and ,have to:
(7) (7)
(8) (8)
由(6)式展開可得:From the expansion of (6), we can get:
(9) (9)
由(9)式能得知可以用 來控制機身偏轉角度[yaw] ,由(7)式及(8)式能得知可以用 來控制左右輪的平均角度 及機身傾斜角度[pitch] 。 From equation (9), it can be known that we can use to control the yaw angle of the fuselage [yaw] , from equations (7) and (8), it can be known that we can use to control the average angle of the left and right wheels and the inclination angle of the fuselage [pitch] .
由 及 的值可算出所需的右輪馬達控制電壓 及左輪馬達控制電壓 。 Depend on and The value of , calculates the required right wheel motor control voltage and left wheel motor control voltage .
令狀態變數 為左右輪的平均角度 ,狀態變數 為機身傾斜角度[pitch] ,狀態變數 為 ,狀態變數 為 ,狀態變數 為機身偏轉角度[yaw] ,狀態變數 為 , 的值為 , 的值為 ,則系統的狀態空間方程式為: make 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 fuselage deflection angle [yaw] , the state variable for , value of , value of , 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 Equation (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 equation (12) into two components of PD control as follows;
(13) (13)
則狀態回授控制等效於雙PD控制。Then the state feedback control is equivalent to the dual PD control.
對於一個可穩定[stabilizable]及可偵測[detectable]線性非時變系統,For a stabilizable and 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 stabilizable and 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), a separate controller is designed separately. For formula (11), the state feedback controller is as follows:
(16) (16)
將(16)式代入(11)式,則可以得到:Substituting equation (16) into equation (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 of the system at , , then the characteristic equation of the design system is:
(19) (19)
比較(18)式及(19)式,可得控制器為:Comparing equations (18) and (19), the controller can be obtained as:
, (20) , (20)
根據(13)式就可以求得 ,根據(20)式就可以求得 ,再根據下式 According to formula (13), we can get , according to the formula (20), it can be obtained , and then according to the following formula
, , , ,
即可以求得 及 ,進而可以控制兩輪機具的穩定平衡。 that can be obtained and , and then can control the stable balance of the two-wheeled implements.
另,就該步驟二(S02)之深度學習控制而言,該數位控制器需要調節的控制參數如下:In addition, as far as the deep learning control of the second step (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層以上;變數符號 、 是該隱藏節點的偏值,變數符號 是輸出節點,該自動控制系統需要調節的控制參數為 ,是狀態回授控制參數,其中該輸出節點代表意思如下: The control parameters are adjusted by means of deep learning. Deep learning uses a multi-layer neural network as the control method. Please refer to the schematic diagram of the multi-layer neural network structure of the present invention in Fig. 6. The variable symbol is the input node of the deep learning neural network, , is the kth sample of the measured output of the controlled system, the variable sign is the bias value of the input node, the variable sign , Each is the hidden node of the first layer and the second layer, and there are more than two hidden layers; variable symbols , is the bias value of the hidden node, the variable sign 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 the deep learning neural network are as follows:
令參數符號 是該輸入節點與該第1層隱藏節點間的權值,參數符號 是該第1層隱藏節點與該第2層隱藏節點間的權值,參數符號 是該第2層隱藏節點與該輸出節點間的權值, let parameter notation is the weight between the input node and the hidden node of the first layer, the parameter symbol is the weight between the hidden node of the first layer and the hidden node of the second layer, the parameter symbol is the weight between the hidden node of the second layer and the output node,
該第1層隱藏節點與該輸入節點的關係如下:The relationship between the
,該
係為函數符號,而該等號左右兩式係單一純量,
是第1層隱藏節點
的計算值,
,啟動函數
使用如下的雙極S型函數,將輸出適當的縮放到值域-1到1之間,
,
。
,Should is a function symbol, and the left and right equations 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 equations 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 second layer hidden node is as follows:
,該 係為函數符號,而該等號左右兩式係單一純量, 是輸出層節點 的計算值, 。 ,Should is a function symbol, and the left and right equations of the equal sign are single scalars, is the output layer node the calculated value of , .
該輸入節點 連接到左右輪的平均角度 ,該輸入節點 連接到機身的傾斜角度[pitch]為 ,使用倒傳遞法求每一層的權值,訓練的目的是要使誤差平方達到最小,誤差的平方為: the input node Connected to the average angle of the left and right wheels , the input node The angle of inclination [pitch] connected to the body is , using the inverse transfer method to find the weight of each layer, the purpose of training is to minimize the square of the error, and the square of the error is:
,該 代表誤差的平方,該 代表誤差平方根, 是左右輪的平均角度參考輸入, 是機身傾斜角度[pitch]參考輸入, 、 是該受控系統的量測輸出第k個取樣。 ,Should represents the square of the error, the represents the square root of the error, is the average angle reference input for the left and right wheels, is the fuselage 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 is calculated as follows.
, ,
, ,
, ,
, ,
, ,
, ,
其中in
, , , , , ,
, , , ,
, , , ,
, , , ,
, , , ,
, , , ,
在實用上,偏微分 可以用 來近似,其中 且 。因此偏微分 , , , , 及 可以改寫如下, 為狀態變數: In practice, partial differential Can use to approximate, where and . Therefore partial differential , , , , and It 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 weights can be changed as follows, for state variables:
, ,
, ,
, ,
, ,
, ,
, ,
學習法則可以修改為以下公式,The learning rule can be modified as the following formula,
, ,
, ,
, ,
, ,
, ,
, ,
其中,動力[momentum]因子的範圍為 。加上動力[momentum]可以使類神經網路的學習計算時不會掉入局部最小值。 where the range of the momentum factor is . With the addition of momentum [momentum], the learning calculation of the neural network will not fall into a local minimum.
藉由以上所述,本發明之使用實施說明可知,本發明與現有技術手段相較之下,本發明主要係以深度學習的方法調整控制器參數,能具有學習性質的調整機制,可以廣泛的適應環境參數之改變,以可使兩輪機具達到強健平衡穩定之自動控制功效,而在其整體施行使用上更增實用功效特性者。From the above, it can be seen from the description of the use and implementation of the present invention that, compared with the prior art means, the present invention mainly adjusts the controller parameters by means of deep learning, and can have a learning adjustment mechanism, which can be widely used. Adapt to changes in environmental parameters, so that the two-wheeled machines can achieve strong, balanced and stable automatic control functions, and more practical performance characteristics in their overall implementation and use.
然而前述之實施例或圖式並非限定本發明之產品結構或使用方式,任何所屬技術領域中具有通常知識者之適當變化或修飾,皆應視為不脫離本發明之專利範疇。However, the foregoing embodiments or drawings do not limit the product structure or usage of the present invention, and any appropriate changes or modifications made by those with ordinary knowledge in the technical field should be regarded as not departing from the 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 is not only not seen in similar products, but also has not been disclosed before the application, which fully complies with the provisions of the patent law In accordance with the requirements, I would like to file an application for an invention patent in accordance with the law, and I urge you to review it and grant 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 the simplified three-dimensional structure of the two-wheeled machine tool
第三圖:兩輪機具之側視簡化結構示意圖Figure 3: Schematic diagram of a simplified side view of a two-wheeled machine tool
第四圖:兩輪機具之俯視簡化結構示意圖Figure 4: Simplified top view of the two-wheeled machine
第五圖:本發明之步驟流程示意圖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 (6)
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 true TWI767612B (en) | 2022-06-11 |
TW202238302A 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) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110130925A1 (en) * | 2008-07-29 | 2011-06-02 | Toyota Jidosha Kabushiki Kaisha | Coaxial two-wheeled vehicle and its control method |
US20110231050A1 (en) * | 2010-03-22 | 2011-09-22 | Goulding John R | In-Line Legged Robot Vehicle and Method for Operating |
TWM500726U (en) * | 2014-06-10 | 2015-05-11 | fu-rong Zhang | Frame mechanism of self balancing vehicle |
TWI510394B (en) * | 2013-06-24 | 2015-12-01 | Univ Nat Taiwan Normal | Automatic balancing vehicle and turning control method thereof |
US20160031515A1 (en) * | 2013-07-16 | 2016-02-04 | Sergey Nikolaevich Andreev | Two-Wheeled Gyroscope-Stabilized Vehicle and Methods for Controlling Thereof |
US20170088212A1 (en) * | 2015-09-24 | 2017-03-30 | P&N Phc, Llc | Portable two-wheeled self-balancing personal transport vehicle |
TW201741792A (en) * | 2016-05-19 | 2017-12-01 | 崑山科技大學 | Method for controlling two-wheel machine in balance by use of artificial intelligence |
US20180111039A1 (en) * | 2016-10-25 | 2018-04-26 | Future Motion, Inc. | Self-balancing skateboard with strain-based controls and suspensions |
US20190127010A1 (en) * | 2015-12-16 | 2019-05-02 | South China University Of Technology | Portable electric vehicle and method for controlling drive thereof |
US20190126157A1 (en) * | 2016-07-11 | 2019-05-02 | Groove X, Inc. | Autonomously acting robot |
US20200331543A1 (en) * | 2018-04-13 | 2020-10-22 | Vikas PODDAR | System and method for balancing a vehicle |
US20200368629A1 (en) * | 2017-11-30 | 2020-11-26 | Nicholas Moss | Remote control vehicle |
US20200379464A1 (en) * | 2016-07-19 | 2020-12-03 | Christopher Andrew Tacklind | Two-wheel In-Line Robots |
-
2021
- 2021-03-16 TW TW110109261A patent/TWI767612B/en active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110130925A1 (en) * | 2008-07-29 | 2011-06-02 | Toyota Jidosha Kabushiki Kaisha | Coaxial two-wheeled vehicle and its control method |
US20110231050A1 (en) * | 2010-03-22 | 2011-09-22 | Goulding John R | 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 |
US20160031515A1 (en) * | 2013-07-16 | 2016-02-04 | Sergey Nikolaevich Andreev | Two-Wheeled Gyroscope-Stabilized Vehicle and Methods for Controlling Thereof |
TWM500726U (en) * | 2014-06-10 | 2015-05-11 | fu-rong Zhang | Frame mechanism of self balancing vehicle |
US20170088212A1 (en) * | 2015-09-24 | 2017-03-30 | P&N Phc, Llc | Portable two-wheeled self-balancing personal transport vehicle |
US20190276040A1 (en) * | 2015-09-24 | 2019-09-12 | P&N Phc, Llc | Portable two-wheeled self-balancing personal transport vehicle |
US20190127010A1 (en) * | 2015-12-16 | 2019-05-02 | South China University Of Technology | Portable electric vehicle and method for controlling drive thereof |
TW201741792A (en) * | 2016-05-19 | 2017-12-01 | 崑山科技大學 | Method for controlling two-wheel machine in balance by use of artificial intelligence |
US20190126157A1 (en) * | 2016-07-11 | 2019-05-02 | Groove X, Inc. | Autonomously acting robot |
US20200379464A1 (en) * | 2016-07-19 | 2020-12-03 | Christopher Andrew Tacklind | Two-wheel In-Line Robots |
US20180111039A1 (en) * | 2016-10-25 | 2018-04-26 | Future Motion, Inc. | Self-balancing skateboard with strain-based controls and suspensions |
US20200368629A1 (en) * | 2017-11-30 | 2020-11-26 | Nicholas Moss | Remote control vehicle |
US20200331543A1 (en) * | 2018-04-13 | 2020-10-22 | Vikas PODDAR | System and method for balancing a vehicle |
Also Published As
Publication number | Publication date |
---|---|
TW202238302A (en) | 2022-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7962256B2 (en) | Speed limiting in electric vehicles | |
CN101312874B (en) | Overturn prevention control device for two-wheel vehicle | |
US9511811B2 (en) | Two-wheeled gyroscope-stabilized vehicle and methods for controlling thereof | |
CN102642584B (en) | Self-balancing electric manned monocycle | |
EP1796953B1 (en) | Vehicle control by pitch modulation | |
DE112009005239B4 (en) | Regulation / control device of an inverse shuttle-type vehicle | |
JP2004500271A (en) | Personal balance vehicle | |
DE112009005257B4 (en) | Control / control device of an entangling type vehicle | |
US20060063137A1 (en) | Wheeled vehicles and control systems and methods therefor | |
CN202806968U (en) | Self-balance electric manned monocycle | |
DE112009005248B4 (en) | Control / control device of an entangling type vehicle | |
EP4011678A1 (en) | Method and system for controlling a vehicle's electric motor output | |
DE112009005273B4 (en) | Control device of a single-entrainment vehicle | |
DE112009005275T5 (en) | Inverspendel - like vehicle | |
DE112009005245T5 (en) | Control device of an inversive-type vehicle | |
DE112009005253B4 (en) | Control device for an in-shuttle type vehicle | |
TWI767612B (en) | Deep learning method for controlling the balance of a two-wheeled machine | |
US20220219775A1 (en) | Torque balancing of passive and active braking on an electronic bicycle | |
US7195487B2 (en) | Two-wheeled vehicles and control systems and methods therefor | |
DE112009005251T5 (en) | Control / control device of an entangling type vehicle | |
US20210269111A1 (en) | Systems and methods to assist balancing of human-supported vehicles | |
Morrell et al. | Design of a closed loop controller for a two wheeled balancing transporter | |
JP2018184038A (en) | Inverted pendulum type vehicle | |
TWI592777B (en) | Method for controlling two-wheel machine in balance by use of artificial intelligence | |
WO2007024239A1 (en) | Wheeled vehicles and control systems and methods therefor |