From 277ca8269529ae7f8a4281c11f9ea4054a6a2450 Mon Sep 17 00:00:00 2001 From: Tanawat P <83177015+Fzil0n@users.noreply.github.com> Date: Sat, 9 Dec 2023 19:15:12 +0700 Subject: [PATCH 01/44] Create README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ff5ae3 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +> Written with [StackEdit](https://stackedit.io/). +> # Quadcopter Simulation +> This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. +> # Table of Contents +> Installation +> From 91de0642170467e3e4c0eb54510f108f843e8646 Mon Sep 17 00:00:00 2001 From: puttersp Date: Mon, 11 Dec 2023 10:27:10 +0700 Subject: [PATCH 02/44] visualization cleaning unused parts --- Visualization_v1.py | 7 ++----- __pycache__/Input_GUI.cpython-39.pyc | Bin 0 -> 5933 bytes __pycache__/QuadcopterDynamics.cpython-39.pyc | Bin 0 -> 6048 bytes __pycache__/Visualization_v1.cpython-39.pyc | Bin 0 -> 3876 bytes pyplot3d/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 162 bytes pyplot3d/__pycache__/basic.cpython-39.pyc | Bin 0 -> 12347 bytes pyplot3d/__pycache__/uav.cpython-39.pyc | Bin 0 -> 3367 bytes pyplot3d/__pycache__/utils.cpython-39.pyc | Bin 0 -> 2486 bytes 8 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 __pycache__/Input_GUI.cpython-39.pyc create mode 100644 __pycache__/QuadcopterDynamics.cpython-39.pyc create mode 100644 __pycache__/Visualization_v1.cpython-39.pyc create mode 100644 pyplot3d/__pycache__/__init__.cpython-39.pyc create mode 100644 pyplot3d/__pycache__/basic.cpython-39.pyc create mode 100644 pyplot3d/__pycache__/uav.cpython-39.pyc create mode 100644 pyplot3d/__pycache__/utils.cpython-39.pyc diff --git a/Visualization_v1.py b/Visualization_v1.py index 02d5721..0c59092 100644 --- a/Visualization_v1.py +++ b/Visualization_v1.py @@ -4,8 +4,6 @@ from OpenGL.GLUT import * from OpenGL.GLU import * from math import cos, sin, pi -import tkinter as tk -import time class Quadcopter3DVisualization: @@ -22,9 +20,6 @@ def __init__(self): glRotatef(-60, 1, 0, 0) glRotatef(45, 0, 0, 1) - # Store quadcopter positions over time - self.quadcopter_positions = [] - def draw_circle(self, radius, segments): glBegin(GL_POLYGON) for i in range(segments): @@ -127,8 +122,10 @@ def draw_quadcopter(self, roll, pitch, yaw, x, y, z): glPopMatrix() pygame.display.flip() + def close_wiondow(self): pygame.quit() + def __del__(self): print('Destructor called, Quadcopter3DVisualization deleted.') diff --git a/__pycache__/Input_GUI.cpython-39.pyc b/__pycache__/Input_GUI.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d0c453013cf03a59451a37fa7a0dec83103dddc GIT binary patch literal 5933 zcmaJ_O>7&-6`t8$l1qxzzx8LwW^DO~{*nLk>nM(GNp>99lp@J-%qm^boRz#ZMN+fN z*diz(fYLUX7VagNqyUv$E+aSg>i3L==`C6)`mJjZV_p$YwSCiHbJ zrwKmCGR7w4ShhfP=TAf98j3p!VzV3*BO)eDe4`>R68OeM zhe+aUij?TYH!iv`Q@7u9x8hagT-CP4T*(o(bPF8XTfYb@9VinhZWfLR-e4A6g3;el zjeA;C-(Vc(FKB2RC=o$4>ctwYh*~k)&(whyi4D#f>V3_A!92Ltnqhx3|G>0Q-PpqS8?_95AkVe}Y6^B8O?^x%y zlv?K#WW%->73AcNMi4T_GFsGSr?5WMNHb+k{xj!;(F zmDyw0Y4Iwg&b-u~v-|AHz#iDN$DYuO(4Gu>Pb+)Qp>|Fj6Qf^K6piiHCXNp(J%ihR z?a?DnD2YJVdFVPXPKLTJz~+n1OB)nXmnjOY*96sH7Yqm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mX@8v`&8j+rKGZ%1ik;t_}_(P`3Z~uk5B`$xBR4K zt<>_RphtcHZNc%UlP}9eszfL}r6jWbMriMuB%f)Q+)faao3rMCX_yaCbk&EgPooF< XVAWNO7isa$@xZF9v~OzHp-TH73hkK} literal 0 HcmV?d00001 diff --git a/__pycache__/QuadcopterDynamics.cpython-39.pyc b/__pycache__/QuadcopterDynamics.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a73123305c4b79c02abbdc01a69ffe6d5e5b081 GIT binary patch literal 6048 zcma)AOOG4J5$>KBAHya0CGD;x+iNMd!#p^Ip znc-qd%mM+VgJThG z9x9*VixPkUeU+dd%6cMp?Z62fWh>{Ytz6|jadzFn3!E)+5`wGr)Kz6w0ar;?m5=^q z?p=FosU=khy`maw8T6`JQL89@wWiil)|8DIo=I1KH*TxWXg?0Z>yu%7(Cb8<8m5&! zggf{?#~1xf3X#Y}v_xV7%ESh=5(m&uTtFxB0Ntbn=p|*qQc?jdCsn{o;saI{N$}&^ zv!$+hPI$e5H#DxS7xKA$wj8f8$Ld1r+Cu93Lh6}?)Uykz8w;tM3#nV6o>O*VuIEos zE+|3Xa4UrRMAPOX2QSH;ns23Uw{_6&r|v)(eO>&Ti_+EBVTMdHWU4tH>iW$?!*O$B zIBrfgho$1w8t$iVI}F>Cv@~ePVejy2hFnX%b`($cgVcT0AGPDOyg!P1ac?wC{ZZHp zhH;xK^^Dva^oHXoT`4pgQnlY32JP_oL4TC`?O}J^H$x^ngO+a}JGG)Ei(iqz9(X2h7g? zBrUgEy#}y4Vz;mF8(1)W4j7hf9`|ajX+R$ti83cP1Tmr#R}H_BUhm zSb9F$h`L5&%~P^@==Keojl(p|GNX09uE*Pwr6{m%9oR1|=)748mr;bI|8SK6yDB+j zYDc|c?vbh88AaF(-X*5@2)s{#yi|irz|z%DyWb(t3tCrOI&g^|k!T@n(vi#jzAe9$ z|M+J5-U1goDWU16?r0En+u;U{(I|vsrx#DsdLFG*4?h4`ht`ojG&+SAd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MQU;dS3A_y8xmafBZhdRd!+WvOjk|K?NK%fGuMqe) z$&|4`x0lV=6W%-c+2)>H055fdUN7tjStjW@8nKSzs8@5dRAQqeCKMFF3fq6LP$tR;QARf>VqF{hKZ8> zrs~S2W)R1rcx&m(jg~|hhbk1ys4?xHj5@Q=Q1E>S`u>wC?O(fcQPcrix{gN}B}E5? zlkcY`pDLw(OnAljVedHO$VIHGy;r_T*joga2~e#w1?YX14gfiDLPfjF-Fdg@e&`x{ zyosR;9~pWLEukp6x+ca=I_bjXJR4ou0l^T;roJjnrjKxH+7~FIka3ugBqI2q2}8w= zm5h4L$ubQ2(JZWHq&IQ=ywLU^PS@G#{1hjlk`Nw7m55v+FtLa>23hWRXbDv@3}H2R zW!5Psh1uofj7y4R%tsoYOUInknf|O=be}k=!Qu{}RS3NG_Qr zeYxKgupIf=$jCuQ_`SHRC@&@R0L+?4BFTSWImN--Gc9-ZO7)s8-^M!fdjxJ1(2o2g z!Y22mF@0Iz2jjPB`m*4;mZXtdRVNT{F8hbE9Cs14iC1hORd4SsZ|`{JF?z7?l_o@L zwF7l;QpM_`HZ7=+5yhcQ4fSzqsi+<5(9nC$QY&?Tl7;0@$z65P58d+L0`+Ef_+Q~j BO{)L^ literal 0 HcmV?d00001 diff --git a/pyplot3d/__pycache__/__init__.cpython-39.pyc b/pyplot3d/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..638f3c3d1f8d1f03ad81e855ea5948b89f48d8e6 GIT binary patch literal 162 zcmYe~<>g`k0-gn@6G8N25P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!G}id9TNVsS}o zX;EfXYD$cor<1>eYf5QMaB8lCv7TX!cV=E{ZemGha&b&RQGQlxa!E`|Xk|jG;;xMZ0-e{%h3cDo1fB-VP z5J?>HrE>e`p1$|=98wQG)l=V^_7CVoPyd5GCoj!Ij^6T|q*cFfW_NZ0f|Oz@y)3yu z%x!09XTINc#+{xn8@MX_|L*?n6~p)`Guf+%%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u*fJF^CQ5+mn*bqMX7m`EeI2vT7X!K&ERTh;GWuT^_h;p8foV^&I4 Lt7b8zU$y=lgA&Q) literal 0 HcmV?d00001 diff --git a/pyplot3d/__pycache__/uav.cpython-39.pyc b/pyplot3d/__pycache__/uav.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59438015090c65117a94dbd1e87c55a6701192e4 GIT binary patch literal 3367 zcmahLO>f-Bb%sN7xgU~N(#o>sSf=DA@fL<^X;UCD+&WI(7(olgwbKi$fTeb3S5)}1 z8FDS{c73vaG>~h1l6uRfrykPZkhVX7x1xta=%weNt^3|^m)eyJWQck5-n=*Oy?Hb5 z4ZXR!3V~KT`NsRtJRyHaV!D|?d;mS+ln_oh4M<2G8fuOfGKW#ZHO>OvF&+}GbK?c! z#&gXvMTwiAYhP0NYv7jxD=a%@C2IwhuwdHDvXo2_@Y?rXs6V< z2Glyvp#u98zGuA#S_z0^9|U2>7jml^~l$czMNQ~DU_yDn_8_MAQ-pS|yF!0Ju0 z!I#BGgYZTd`8Pya+~6zx(ko3|&$Z-GY;@RN@+JMk64k@+i4_4JifiI}N8_unbmwi@ z-#e!S_RgM==H)YpG-QxBD)tSe(J~3E&Iq%4~l6oP5rdb#g@|0X5h@EA&y@D1bUJI7|{`N z$w&i8Q|*L-cT{<&!;CSW(TW*!Jj05aQfiIJp}KX?8LTOfY1omXD+O&Sx?0d>Mb|FS zbLl+#bZCs%FN|rE=j-cZy2SJKi|NvcKF3`w7g&Q=Adc1Hw<-V_#*ZTilo$9zVW$UT z5>09Mf*67ob?u%fy-=h=CR>$a)gzot?i4g?@{aG=H$yMQm4Uwxw4XGUQpD^dyeo=K z)U~mbgSa1XdtcZbjxw6nB||q5Q8zsRot+@|(x#o$cHEhE6pvko=Z-xVX>ef;4k_D^|#?}-TQ*4Fmk&mf`UB>i@>_ejQvqMh#b26(P5zSsAjZuJJ4<+?sx z9oMab#$+7;shQN&mMDCz&gxWs`N%4CScBBvnk<^cT7?$D8SdbXgv6sz33&%f4kptH z#WDmKB;*K6g~D~jN7{)2^X4h0NU1?q$(U%oDS$kq2rUeSg@2)W2 zzx)~7zwhlfmsRp*MmrD?iWRudSqZD1>!tD%QjEu`Tmnobs9Z&C8Np=)R}icLaB6B* zN5-KGwc;wyzlETI;2Hutp_tz zqYSHys?h@?g_<#f-wjS)!c*SSuE3L?Q^g#+qOz6KJ?$BLrmN9-W~#CD%)*C##724- ze%UAiN*|dcqo9nDH7ey4Cy;B}Zc{t^@9WpE&#=Td&CG&|>02GH zeZ!*gY4dcR${(U&DG}a&ETc?oaR_OpmzR48aQEx=m;e05*MGftb{7QY4Fo#?#t+}0 z?x{EO(!f%JyQ8&W~lm*-xWM>*#wXo z{nQTDMGsh$A1!=xfBS{B= z$XGuSnc4BXefV)@FlMaV_RgP3*+OF=EPAku)D;nTjG>Tmq7KA?x7CZfLLE$IFu1bt5Ff-xQ-@^Z5_MA6-8`*+OkpZPRSnHz^N%XDrq!@B gYoVrDfa$cN>r{usTc?{^oz`fBZt4|kzBbwa0G%Q})&Kwi literal 0 HcmV?d00001 diff --git a/pyplot3d/__pycache__/utils.cpython-39.pyc b/pyplot3d/__pycache__/utils.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c44ebe36123d9920989250e686e1f26f3dbb45b8 GIT binary patch literal 2486 zcmdT`Pfy!06nC5iLZPs~hiNBy zgb+k{DcSMFr0_-X!`q=^N`ztz$QM;HE+U{nOp6Io0Sbk;P2!mgJV`!nw5aX-SBT!4 zUPsdnh@PjW4LS9C(4)OT&}Gu|Ckc>m5&8hVT?x?#a6HD> zJVGiA*Lt3PmC9(=Nlfd2@vNOnHp`jH4L3=iF|P6=6U-b)R?~*<<)X{@aiU{payF#r ztQ~Trl4F)+Y=VFP?X2oHrJD&-z6z|5v{s*c;ww06`%6oa9 z#%w?3ZR@tsk|q0YPtKagE-{m_{sVIZ3)Z2K`@BdETVWeK)zYmsq$yN3w5!JL9o3KP z*T-<<&76@78>e%6fwLqkfQYHm)0q zM99n}rVEwOy_eInC$JMjYnShY&_g$l=6QVk*6eHOXAqxqCjjY%12Tc3VxvDHD!9&MYE5J{O zEhn$I>L$i8p~kJKT44!xDINnkk}NQw5hQUmp~|x7K1lM9l(vH1yJ!qjT9+T)&5^pg zM~)1WBC0T63yPF&J<eCy?iNa$^arhV)QNU!d%Lrzg~)> Date: Tue, 12 Dec 2023 02:05:58 +0700 Subject: [PATCH 03/44] UpdateDraftcontent.md --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ff5ae3..24446b2 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,31 @@ > # Quadcopter Simulation > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. > # Table of Contents -> Installation -> +> **Installation** +> **Componemts** +> **User Guide** +> **Demos & Result** +> **Conclusion** +> **Reference** +> # Installation +> **Pygame** +> Description +> **OpenGL** +> Description +> **Numpy** +> Description +> # Componemt +> **Motor Slider** +> Description +> **Dynamic Calculation** +> Description +> **3D Visualization** +> Description +> # User Guide +> Description +> # Demos & Result +> Description +> # Convclusion +> Description +> # Reference +> Description From e7cf7a7f52873ca9d8a9cb31a8092930c851933f Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 02:09:30 +0700 Subject: [PATCH 04/44] Draft Edit.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 24446b2..bd11b1a 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. > # Table of Contents > **Installation** -> **Componemts** -> **User Guide** -> **Demos & Result** -> **Conclusion** -> **Reference** +> - Componemts +> - User Guide +> - Demos & Result +> - Conclusion +> - Reference > # Installation > **Pygame** > Description From c5fc9fcd5a41d274ed85231e3f6e4d5451dc761e Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:07:58 +0700 Subject: [PATCH 05/44] DraftContent_Testlink.md link test --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bd11b1a..38d033d 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,32 @@ > Written with [StackEdit](https://stackedit.io/). -> # Quadcopter Simulation +# Quadcopter Simulation > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. -> # Table of Contents +# Table of Contents > **Installation** -> - Componemts -> - User Guide -> - Demos & Result -> - Conclusion -> - Reference -> # Installation +> **Componemts**(Componemt) +> **User Guide** +> **Demos & Result** +> **Conclusion** +> **Reference** +# Installation > **Pygame** > Description > **OpenGL** > Description > **Numpy** > Description -> # Componemt +# Componemt > **Motor Slider** > Description > **Dynamic Calculation** > Description > **3D Visualization** > Description -> # User Guide +# User Guide > Description -> # Demos & Result +# Demos & Result > Description -> # Convclusion +# Convclusion > Description -> # Reference +# Reference > Description From 88ac03b865d4c5b661b54234eedd1606c360a8c5 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:09:43 +0700 Subject: [PATCH 06/44] Draftcontent.md Edit test link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38d033d..3ee8233 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. # Table of Contents > **Installation** -> **Componemts**(Componemt) +> [Componemts](Componemt) > **User Guide** > **Demos & Result** > **Conclusion** From ce6a74de954b56d606d51bd38f84faa7f16114de Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:50:39 +0700 Subject: [PATCH 07/44] DocUpdate.md --- README.md | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 3ee8233..6dcbb3e 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,42 @@ -> Written with [StackEdit](https://stackedit.io/). # Quadcopter Simulation > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. # Table of Contents -> **Installation** -> [Componemts](Componemt) -> **User Guide** -> **Demos & Result** -> **Conclusion** -> **Reference** +> - **Installation** +> - **Componemt** +> - **User Guide** +> - **Demos & Result** +> - **Conclusion** +> - **Reference** # Installation -> **Pygame** -> Description -> **OpenGL** -> Description -> **Numpy** -> Description +> - **Pygame** +> > How to installation Pygame +> > - 1. +> - **OpenGL** +> > How to installation OpenGL +> > +> - **Numpy** +> > How to installation Numpy +> > 1. Open Visual Studio Code +> > 2. Go to teminal or open terminal +> > 3. Write the command **pip install numpy** in terminal and enter +> > 4. Wait until download is done # Componemt -> **Motor Slider** -> Description -> **Dynamic Calculation** -> Description -> **3D Visualization** -> Description +> - **Motor Slider** +> Description +> - **Dynamic Calculation** +> > +> - **3D Visualization** +> >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw +> //Add picture +> > +> >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL # User Guide > Description # Demos & Result > Description -# Convclusion +# Conclusion > Description # Reference -> Description +> - [1] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: https://droneomega.com/what-is-a-quadcopter/ [02/11/23] +> - [2] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: https://www.youtube.com/watch?V=4hlq2pf842u [02/11/23] +> - [3] MATLAB, 2020, Drone Simulation and Control, Part 1: Setting Up the Control Problem [Online], Available: https://www.youtube.com/watch?V=hgcgpuqb67q [02/11/23] From 928b6a3c87f40cf0653075023e2416c5f0acffd4 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:01:36 +0700 Subject: [PATCH 08/44] TestLink.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6dcbb3e..6d033b8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ # Table of Contents > - **Installation** > - **Componemt** +> - [Componemt](#Componemt) > - **User Guide** > - **Demos & Result** > - **Conclusion** @@ -10,7 +11,7 @@ # Installation > - **Pygame** > > How to installation Pygame -> > - 1. +> > 1. > - **OpenGL** > > How to installation OpenGL > > @@ -20,7 +21,7 @@ > > 2. Go to teminal or open terminal > > 3. Write the command **pip install numpy** in terminal and enter > > 4. Wait until download is done -# Componemt +# Componemt > - **Motor Slider** > Description > - **Dynamic Calculation** From 03586bf539f8841ef5242302551d471e5b68ae57 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:02:36 +0700 Subject: [PATCH 09/44] TestLink.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d033b8..d65ed4b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ > > 2. Go to teminal or open terminal > > 3. Write the command **pip install numpy** in terminal and enter > > 4. Wait until download is done -# Componemt +# Componemt > - **Motor Slider** > Description > - **Dynamic Calculation** From 5f1685d18eefcfee306ef765ae9c653c40bbd82e Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:04:30 +0700 Subject: [PATCH 10/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d65ed4b..e0871cb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Table of Contents > - **Installation** > - **Componemt** -> - [Componemt](#Componemt) +> - [Component](#Component) > - **User Guide** > - **Demos & Result** > - **Conclusion** @@ -21,7 +21,7 @@ > > 2. Go to teminal or open terminal > > 3. Write the command **pip install numpy** in terminal and enter > > 4. Wait until download is done -# Componemt +# Component > - **Motor Slider** > Description > - **Dynamic Calculation** From 9307c8e03cf43c8d17d654d26af1b299ccc025db Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:05:56 +0700 Subject: [PATCH 11/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e0871cb..eba8389 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Table of Contents > - **Installation** > - **Componemt** -> - [Component](#Component) +> - [Component](#component) > - **User Guide** > - **Demos & Result** > - **Conclusion** @@ -21,7 +21,7 @@ > > 2. Go to teminal or open terminal > > 3. Write the command **pip install numpy** in terminal and enter > > 4. Wait until download is done -# Component +# Component > - **Motor Slider** > Description > - **Dynamic Calculation** From 1d2c1b28d8ff5686098d6e407e3f8a348310ee3d Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:06:47 +0700 Subject: [PATCH 12/44] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index eba8389..59bcdc7 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. # Table of Contents > - **Installation** -> - **Componemt** -> - [Component](#component) +> - [**Component**](#component) > - **User Guide** > - **Demos & Result** > - **Conclusion** From 9e93d54ab253e36fa2fe33cce14fce246a30af15 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:15:04 +0700 Subject: [PATCH 13/44] Alllink.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 59bcdc7..054e105 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Quadcopter Simulation > This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. # Table of Contents -> - **Installation** +> - [**Installation**](#installation) > - [**Component**](#component) -> - **User Guide** -> - **Demos & Result** -> - **Conclusion** -> - **Reference** -# Installation +> - [**User Guide**](#userguide) +> - [**Demos & Result**](#demosnresult) +> - [**Conclusion**](#conclusion) +> - [**Reference**](#reference) +# Installation > - **Pygame** > > How to installation Pygame > > 1. @@ -30,13 +30,13 @@ > //Add picture > > > >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL -# User Guide +# User Guide > Description -# Demos & Result +# Demos & Result > Description -# Conclusion +# Conclusion > Description -# Reference +# Reference > - [1] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: https://droneomega.com/what-is-a-quadcopter/ [02/11/23] > - [2] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: https://www.youtube.com/watch?V=4hlq2pf842u [02/11/23] > - [3] MATLAB, 2020, Drone Simulation and Control, Part 1: Setting Up the Control Problem [Online], Available: https://www.youtube.com/watch?V=hgcgpuqb67q [02/11/23] From 7f2964292a94be9c9cab933287b9e99d31bc78ea Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:27:52 +0700 Subject: [PATCH 14/44] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 054e105..4ddb54d 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,14 @@ # Installation > - **Pygame** > > How to installation Pygame -> > 1. +> > 1. Open Visual Studio Code +> > 2. Go to teminal or open terminal +> > 3. Write the command **pip install pygame** in terminal and enter +> > 4. Wait until download is done > - **OpenGL** > > How to installation OpenGL > > +> > > - **Numpy** > > How to installation Numpy > > 1. Open Visual Studio Code @@ -23,6 +27,7 @@ # Component > - **Motor Slider** > Description +> > - **Dynamic Calculation** > > > - **3D Visualization** From 83b6c0de48ae27a06e155bc58057dc80e5fcc6eb Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:06:42 +0700 Subject: [PATCH 15/44] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ddb54d..8a57f17 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ > - **3D Visualization** > >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw > //Add picture -> > +> > +> > > >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL # User Guide > Description From c0bbbae6e1602c3b649bebb6ab8ca215a45ce3e9 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:07:44 +0700 Subject: [PATCH 16/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a57f17..51639f3 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ > - **3D Visualization** > >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw > //Add picture -> > +> > 1 > > > >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL # User Guide From 39dd420aa9739d773e1387b6dce83f312e4a1ef3 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:09:59 +0700 Subject: [PATCH 17/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51639f3..a6cf61f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ > - **3D Visualization** > >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw > //Add picture -> > 1 +> > ![a](https://ibb.co/Cwzmzcb) > > > >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL # User Guide From 664061d56b1d413b7ae602ad8bd86719788c9b48 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:13:34 +0700 Subject: [PATCH 18/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6cf61f..7f882d9 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ > - **3D Visualization** > >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw > //Add picture -> > ![a](https://ibb.co/Cwzmzcb) +> > ![a](https://ibb.co/GdqvMGP) > > > >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL # User Guide From 89c87a211f6f7674b1f9f2d1de6e86a038f19e78 Mon Sep 17 00:00:00 2001 From: puttersp <76032826+puttersp@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:52:04 +0700 Subject: [PATCH 19/44] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7f882d9..550204b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Quadcopter Simulation -> This project aim to visualize a Quadcopter's motion(roll pitch yaw and hover) in 3D space by adjust speed of 4 motors using python. In this project including 3 parts motor's speed adjust window, dynamic calculation and 3D visualization. Thank to https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX for MATLAB script to find Quadcopter's equation of motion. +> This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors using Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. Special thanks to [this MATLAB script](https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX) for finding the Quadcopter's equation of motion. # Table of Contents > - [**Installation**](#installation) > - [**Component**](#component) @@ -7,23 +7,39 @@ > - [**Demos & Result**](#demosnresult) > - [**Conclusion**](#conclusion) > - [**Reference**](#reference) -# Installation -> - **Pygame** -> > How to installation Pygame -> > 1. Open Visual Studio Code -> > 2. Go to teminal or open terminal -> > 3. Write the command **pip install pygame** in terminal and enter -> > 4. Wait until download is done -> - **OpenGL** -> > How to installation OpenGL -> > -> > -> - **Numpy** -> > How to installation Numpy -> > 1. Open Visual Studio Code -> > 2. Go to teminal or open terminal -> > 3. Write the command **pip install numpy** in terminal and enter -> > 4. Wait until download is done +## Installation + +### Pygame + +1. Open Visual Studio Code. +2. Go to the terminal or open a new terminal. +3. Copy and paste the following command: + ```bash + pip install pygame + ``` +4. Press Enter and wait for the download to complete. + +### OpenGL + +1. Open Visual Studio Code. +2. Go to the terminal or open a new terminal. +3. Copy and paste the following command: + ```bash + pip install PyOpenGL + pip install PyOpenGL_accelerate + ``` +4. Press Enter and wait for the download to complete. + +### Numpy + +1. Open Visual Studio Code. +2. Go to the terminal or open a new terminal. +3. Copy and paste the following command: + ```bash + pip install numpy + ``` +4. Press Enter and wait for the download to complete. + # Component > - **Motor Slider** > Description From 9161402f5a672b65b9d07e66202492eab9dfc578 Mon Sep 17 00:00:00 2001 From: puttersp <76032826+puttersp@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:53:18 +0700 Subject: [PATCH 20/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 550204b..6a0bd42 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,11 @@ > - **Dynamic Calculation** > > > - **3D Visualization** -> >Visualization part about drawing Quadcopter on screen and position update by differential of X, Y, Z, roll, pitch, yaw +> >The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. > //Add picture > > ![a](https://ibb.co/GdqvMGP) > > -> >The main library tool is **Pygame** to build display for show Quadcopter and OpenGL +> >The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. # User Guide > Description # Demos & Result From ed6fafaeee60b72cef7903698896f992f0a650fe Mon Sep 17 00:00:00 2001 From: puttersp <76032826+puttersp@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:53:52 +0700 Subject: [PATCH 21/44] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6a0bd42..9e93557 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,4 @@ > - [1] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: https://droneomega.com/what-is-a-quadcopter/ [02/11/23] > - [2] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: https://www.youtube.com/watch?V=4hlq2pf842u [02/11/23] > - [3] MATLAB, 2020, Drone Simulation and Control, Part 1: Setting Up the Control Problem [Online], Available: https://www.youtube.com/watch?V=hgcgpuqb67q [02/11/23] +> - [4] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. From 41f801a77cb9a75ea2c0a9c3a7b78867062ce53c Mon Sep 17 00:00:00 2001 From: puttersp <76032826+puttersp@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:08:08 +0700 Subject: [PATCH 22/44] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e93557..43f2bd9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,10 @@ # Conclusion > Description # Reference -> - [1] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: https://droneomega.com/what-is-a-quadcopter/ [02/11/23] -> - [2] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: https://www.youtube.com/watch?V=4hlq2pf842u [02/11/23] -> - [3] MATLAB, 2020, Drone Simulation and Control, Part 1: Setting Up the Control Problem [Online], Available: https://www.youtube.com/watch?V=hgcgpuqb67q [02/11/23] -> - [4] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. +> - [1] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. +> - [2] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: [droneomega.com](https://droneomega.com/what-is-a-quadcopter/) [02/11/23] +> - [3] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: [YouTube](https://www.youtube.com/watch?v=4hlq2pf842u) [02/11/23] +> - [4] MATLAB, 2020, Drone Simulation and Control, Part 1: Setting Up the Control Problem [Online], Available: [YouTube](https://www.youtube.com/watch?v=hgcgpuqb67q) [02/11/23] +> - [5] Kanishke Gamagedara (2021). Plotting 3D Objects with Matplotlib. Github. https://github.com/kanishkegb/pyplot-3d +> - [6] P. Wang, Z. Man, Z. Cao, J. Zheng and Y. Zhao, "Dynamics modelling and linear control of quadcopter," 2016 International Conference on Advanced Mechatronic Systems (ICAMechS), Melbourne, VIC, Australia, 2016, pp. 498-503, doi: 10.1109/ICAMechS.2016.7813499. +> - [7] Ahmad, F., Kumar, P., & Patil, P. P. (2018). Modeling and simulation of a quadcopter with altitude and attitude control. Nonlinear Studies, 25(2), 287–299. From 56b9c9884eac227938b1c2c5b48a3bcfacb1f55b Mon Sep 17 00:00:00 2001 From: puttersp <76032826+puttersp@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:11:24 +0700 Subject: [PATCH 23/44] Update README.md --- README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 43f2bd9..3af1d27 100644 --- a/README.md +++ b/README.md @@ -11,34 +11,34 @@ ### Pygame -1. Open Visual Studio Code. -2. Go to the terminal or open a new terminal. -3. Copy and paste the following command: - ```bash - pip install pygame - ``` -4. Press Enter and wait for the download to complete. +> 1. Open Visual Studio Code. +> 2. Go to the terminal or open a new terminal. +> 3. Copy and paste the following command: +> ```bash +> pip install pygame +> ``` +> 4. Press Enter and wait for the download to complete. ### OpenGL -1. Open Visual Studio Code. -2. Go to the terminal or open a new terminal. -3. Copy and paste the following command: - ```bash - pip install PyOpenGL - pip install PyOpenGL_accelerate - ``` -4. Press Enter and wait for the download to complete. +> 1. Open Visual Studio Code. +> 2. Go to the terminal or open a new terminal. +> 3. Copy and paste the following command: +> ```bash +> pip install PyOpenGL +> pip install PyOpenGL_accelerate +> ``` +> 4. Press Enter and wait for the download to complete. ### Numpy -1. Open Visual Studio Code. -2. Go to the terminal or open a new terminal. -3. Copy and paste the following command: - ```bash - pip install numpy - ``` -4. Press Enter and wait for the download to complete. +> 1. Open Visual Studio Code. +> 2. Go to the terminal or open a new terminal. +> 3. Copy and paste the following command: +> ```bash +> pip install numpy +> ``` +> 4. Press Enter and wait for the download to complete. # Component > - **Motor Slider** From 75f4a32c97b1311c594cda4c03d639a426949b49 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:45:14 +0700 Subject: [PATCH 24/44] Update README.md --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3af1d27..ab0ff2c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # Quadcopter Simulation > This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors using Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. Special thanks to [this MATLAB script](https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX) for finding the Quadcopter's equation of motion. # Table of Contents -> - [**Installation**](#installation) -> - [**Component**](#component) -> - [**User Guide**](#userguide) -> - [**Demos & Result**](#demosnresult) -> - [**Conclusion**](#conclusion) -> - [**Reference**](#reference) + - [**Installation**](#installation) + - [**Component**](#component) + - [**User Guide**](#userguide) + - [**Demos & Result**](#demosnresult) + - [**Conclusion**](#conclusion) + - [**Future plan**](#futureplans) + - [**Reference**](#reference) + ## Installation ### Pygame @@ -41,23 +43,58 @@ > 4. Press Enter and wait for the download to complete. # Component -> - **Motor Slider** +### Motor Slider > Description > -> - **Dynamic Calculation** +### Dynamic Calculation > > -> - **3D Visualization** -> >The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. -> //Add picture -> > ![a](https://ibb.co/GdqvMGP) -> > -> >The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. +### 3D Visualization +> The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. +> +> ![messageImage_1702377397219](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/99a2c0b9-bafe-4758-93dd-eee1ea889626) + +> ![messageImage_1702377463885](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/197dc99a-d1ea-4d05-9998-150636515228) + +> The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. +> # User Guide > Description +> # Demos & Result -> Description +## Examples +> - Example 1: falling and spin about z-axis +> +https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/f8c78fa3-a352-4a3c-b3cf-c508be4a07e9 + +> - Example 2: hover and spin about z-axis +> +https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/dcd746c1-80fc-45e8-a3b5-ec25d120da76 + +### Validation +> - Animation compare with MATLAB +> > spin about z-axis +> > +https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/c9a7a609-692d-4733-9779-8c53a8ceec56 + +> > spin about x-axis +> > +https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4189-b823-29aa6c514485 + +> - Dynamic compare with MATLAB +> > Spin about z-axis and hover +> > //add pic + # Conclusion -> Description +> Simulating the motion of a quadcopter using Python can be done using various libraries available in Python, such as NumPy, Matplotlib, and others, to model the dynamics of the quadcopter and visualize the results graphically. Comparing the results to MATLAB may show some differences depending on the simulation methods and parameters used in each system. However, by choosing appropriate parameters and using accurate simulation methods, you can achieve results that closely match those in MATLAB. +> +> To enhance the reliability of your testing, you can experiment with refining and adjusting the parameters of the Python simulation to obtain results that closely align with the MATLAB outcomes. Testing that involves comparing results with MATLAB is a good step to verify the accuracy and reliability of your simulation. +> +> Keep in mind that since there is no real-world quadcopter for direct comparison, testing can only be done by comparing results within the simulation environments, such as Python and MATLAB. + +# Future plan +> - **Improve GUI and visualization.** +> - **Testing with real quadcopter.** +> - **Real-time speed adjustment and display of results.** # Reference > - [1] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. > - [2] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: [droneomega.com](https://droneomega.com/what-is-a-quadcopter/) [02/11/23] From 199c89b714805a2e5c0091c90fc96b28a8d16790 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:01:05 +0700 Subject: [PATCH 25/44] UserGuide.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab0ff2c..162e254 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,21 @@ > The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. > # User Guide -> Description -> +> 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: +> > - Section 1: Importing relevant packages into the project. +> > // Add pic +> > - Section 2 : The part where various parameters of the quadcopter are adjusted, using SI units. The adjustments should be made before clicking the "Run" button. +> > // Add pic +> > - Section 3 : Main loop witch operating at a frequency of 100 Hz. +> > // Add pic + +> 2. After clicking 'Run All,' the window as shown in the picture will appear. +> > // Add pic +> > After adjusting the speed of each motor successfully, press 'Start Sim' to enter the Visualization page. +> > // Add pic + +> 3. When visualization is complete, Program will shut down automatically. + # Demos & Result ## Examples > - Example 1: falling and spin about z-axis From a28ee9c332a33e6562d302d1f66d4e8f468bc94f Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:58:12 +0700 Subject: [PATCH 26/44] AddPic.md --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 162e254..1e9d97e 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,26 @@ # Component ### Motor Slider -> Description -> +> In motor slider UI have 4 component +> > 1. The text shows the speed of all 4 motors in RPM units. +The lowest value is 0 and the highest is 20,000 rads/s +> > 2. Slide bar is used only for adjusting the speed of individual motors in order of Left is the least value. The right is the most valuable. +> > 3. Text box is used to override the speed of all motors to have the same speed. +> > 4. Enter button is used to confirm the override of the motor speed after entering the speed into the text box. +The value will not be changed immediately. You must press the Enter key under the text box or press Enter on your keyboard. +> +> ![image](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/5093bfe2-c106-442c-87ed-3b0b97bffe91) +> +> The speed is adjusted by interacting with the UI in one way or another. The motor speed value is stored through +An array variable with 4 fields, going from index 0 as the 1st motor to index 3 as the 4th motor. +> +> There are 2 main libraries used: +> > 1. os, which is a library that increases the convenience of cross-program development. +platform by allowing the program to have access to certain functions so that it can be used with the operating system +of the computer +> > 2. Pygame, which is a library for developing games using the Python language as the main language +> The creator has applied it for user interaction through UI and simulation. + ### Dynamic Calculation > > ### 3D Visualization @@ -60,11 +78,13 @@ # User Guide > 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: > > - Section 1: Importing relevant packages into the project. -> > // Add pic +> > ![image2](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/7d426e6b-f197-482a-9667-7975c474550e) + > > - Section 2 : The part where various parameters of the quadcopter are adjusted, using SI units. The adjustments should be made before clicking the "Run" button. -> > // Add pic +> > ![image3](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/02722073-d31d-413b-80ae-3a79f5680797) + > > - Section 3 : Main loop witch operating at a frequency of 100 Hz. -> > // Add pic +> > ![image4](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/cf3f2d33-8aad-4fad-ae70-2e3f5895b01e) > 2. After clicking 'Run All,' the window as shown in the picture will appear. > > // Add pic From 45823ac063b4ea49360b401735db4a010fa84f8b Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 02:28:53 +0700 Subject: [PATCH 27/44] NotDoneyet.md i just need some sleep so .... --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e9d97e..2458f93 100644 --- a/README.md +++ b/README.md @@ -78,18 +78,28 @@ of the computer # User Guide > 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: > > - Section 1: Importing relevant packages into the project. +```ruby +from Input_GUI import MotorSpeedSliders +from QuadcopterDynamics import QuadcopterDynamics +from Visualization_v1 import Quadcopter3DVisualization, QuadcopterController +import time +import numpy as np +import math +``` > > ![image2](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/7d426e6b-f197-482a-9667-7975c474550e) > > - Section 2 : The part where various parameters of the quadcopter are adjusted, using SI units. The adjustments should be made before clicking the "Run" button. + > > ![image3](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/02722073-d31d-413b-80ae-3a79f5680797) > > - Section 3 : Main loop witch operating at a frequency of 100 Hz. > > ![image4](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/cf3f2d33-8aad-4fad-ae70-2e3f5895b01e) > 2. After clicking 'Run All,' the window as shown in the picture will appear. -> > // Add pic +> > ![image6](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/cbb31498-3bb7-4ba6-9dae-6bdebc348cf7) + > > After adjusting the speed of each motor successfully, press 'Start Sim' to enter the Visualization page. -> > // Add pic +> > ![image7](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/739a7a89-5762-4d03-bc7b-674a23047a7a) > 3. When visualization is complete, Program will shut down automatically. @@ -115,7 +125,7 @@ https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4 > - Dynamic compare with MATLAB > > Spin about z-axis and hover -> > //add pic +> > ![image5](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/289444ca-9cde-4c84-b460-13a33d8b735d) # Conclusion > Simulating the motion of a quadcopter using Python can be done using various libraries available in Python, such as NumPy, Matplotlib, and others, to model the dynamics of the quadcopter and visualize the results graphically. Comparing the results to MATLAB may show some differences depending on the simulation methods and parameters used in each system. However, by choosing appropriate parameters and using accurate simulation methods, you can achieve results that closely match those in MATLAB. From e23dc7b98e82a928e27d64a5b0f3c7f90a584875 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:19:59 +0700 Subject: [PATCH 28/44] Done_1Equation.md --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2458f93..d04628b 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,29 @@ of the computer > The creator has applied it for user interaction through UI and simulation. ### Dynamic Calculation -> > +> 1. Quadcopter Degree of Freedom +> 2. Quadcopter Degree of Freedom +> 3. Quadcopter Dynamics +> > - External force and torque +> > - Equation of Motion (EOM) +> > >How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). +```math +\vec{F}_{ext} = R_{rpy} +\begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1} ^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} +``` + +```math +\vec{t}_{ext} = \begin{bmatrix} t_{x} \\ t_{y} \\ t_{z} \end{bmatrix} += \begin{bmatrix} t_{\phi} \\ t_{\theta} \\ t_{\phi} \end{bmatrix} += \begin{bmatrix} lk\left(w_4^2 - w_2^2\right) \\ lk\left(w_3^2 - w_1^2\right) \\ b\left(w_1^2 + w_2^2 + w_3^2 + w_4^2\right)\end{bmatrix} +``` +> > > When $A_{n}$ is damper +> > > +```math +R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)\thetaR_{x}\left(\phi\right) +``` +> > > +> ### 3D Visualization > The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. > From eff5e878cb4409efebbbc2c2c3be446b728286f3 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:40:42 +0700 Subject: [PATCH 29/44] AddEq.md --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d04628b..4acb2f5 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,7 @@ of the computer > 2. Quadcopter Degree of Freedom > 3. Quadcopter Dynamics > > - External force and torque -> > - Equation of Motion (EOM) -> > >How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). +> > > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} \begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1} ^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} @@ -82,12 +81,27 @@ of the computer = \begin{bmatrix} lk\left(w_4^2 - w_2^2\right) \\ lk\left(w_3^2 - w_1^2\right) \\ b\left(w_1^2 + w_2^2 + w_3^2 + w_4^2\right)\end{bmatrix} ``` > > > When $A_{n}$ is damper -> > > + ```math -R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)\thetaR_{x}\left(\phi\right) +R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)R_{x}\left(\phi\right) ``` -> > > -> +> > - Equation of Motion (EOM) +> > >How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). + +```math +K.E. = \frac{1}{2}m\left(x^2+y^2+z^2\right)+\frac{1}{2}\left(I_{x} w_{bx}^2+I_{y} w_{by}^2+I_{z} w_{bz}^2\right) +``` +```math +P.E. = mgz +``` +```math +L = K.E. - P.E. +``` +> > >Then we can find the equation of motion by +```math +\frac{\mathrm d}{\mathrm d t}\left(\frac{\mathrm \partial}{\mathrm \partial \dot{q}_{k}}\right) - \frac{\mathrm \partial L}{\mathrm \partial q_{k}} = \Gamma_{k} = \begin{bmatrix} F_{ext} \\ \tau_{ext} \end{bmatrix} +``` + ### 3D Visualization > The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. > From 4908c13e9acc35e9d762fc3f7b50839796a0ec06 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:37:58 +0700 Subject: [PATCH 30/44] Rotation.md --- README.md | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4acb2f5..1680e1f 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,43 @@ of the computer ### Dynamic Calculation > 1. Quadcopter Degree of Freedom -> 2. Quadcopter Degree of Freedom -> 3. Quadcopter Dynamics +> > - Reference Frame +> > > Set the system axis as shown in the picture. +> ![Untitled_Artwork](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/6a906f51-e03d-4d19-91c0-10a56d1cf977) +> > > +> > > Set Frame 0 to be the Inertial Frame for reference and Frame Base to be the Frame of the Quadcopter's center of mass (CM). +> > > The Quadcopter's Pose can be specified with position (x, y, z) and Orientation via Euler angle (Roll (ϕ), Pitch (θ), Yaw (ψ)) or q=(x,y,z). ,ϕ,θ,ψ) The quadcopter speed can be specified as follows: $\dot{q} = \left(\dot{x}, \dot{y}, \dot{z}, \dot{\phi}, \dot{\theta}, \dot{\psi} \right)$ +> > > +> > - Translation +> > > For a quadcopter, the force that occurs is only one force in the $Z\left(F_{z}\right)$ axis. which serves to increase-decrease the Altitude of the Quadcopter. The said force is the sum of the force from all 4 propellers (Thrust) which is directly proportional to the Angular velocity squared. +```math +thrust \propto w^2 +``` +```math +thrust = kw^2 +``` +```math +F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) +``` +> > > When k is Lift constant +> > > +> > > Because there is only one force in the Z axis, we want to control the direction in the X and Y axes as well. Therefore, Rolling and Pitching are used to help create the force in the Y axis, respectively. + +> > - Rotation +> > > The thing that will allow the quadcopter to be able to roll, pitch, and yaw is from the torque that occurs in each axis. +```math +\tau_{x} = lk\left(w_{4}^2 - w_{2}^2\right) +``` +```math +\tau_{y} = lk\left(w_{3}^2 - w_{1}^2\right) +``` +```math +\tau_{z} = b\left(w_{1}^2 - w_{2}^2 + w_{3}^2 - w_{4}^2\right) +``` +> > > When b is Drag Constant + +> 3. Quadcopter Degree of Freedom +> 4. Quadcopter Dynamics > > - External force and torque > > > From the above, we can write external force and torque in matrix form as follows. ```math @@ -114,14 +149,7 @@ L = K.E. - P.E. # User Guide > 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: > > - Section 1: Importing relevant packages into the project. -```ruby -from Input_GUI import MotorSpeedSliders -from QuadcopterDynamics import QuadcopterDynamics -from Visualization_v1 import Quadcopter3DVisualization, QuadcopterController -import time -import numpy as np -import math -``` + > > ![image2](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/7d426e6b-f197-482a-9667-7975c474550e) > > - Section 2 : The part where various parameters of the quadcopter are adjusted, using SI units. The adjustments should be made before clicking the "Run" button. From 0485bfa83ea4e04d37175e5e32f099caf0727794 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:08:37 +0700 Subject: [PATCH 31/44] huhhhh.md --- README.md | 68 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1680e1f..9c7da5c 100644 --- a/README.md +++ b/README.md @@ -65,16 +65,16 @@ of the computer > The creator has applied it for user interaction through UI and simulation. ### Dynamic Calculation -> 1. Quadcopter Degree of Freedom -> > - Reference Frame -> > > Set the system axis as shown in the picture. +> **1. Quadcopter Degree of Freedom** +> > **- Reference Frame** +> > Set the system axis as shown in the picture. > ![Untitled_Artwork](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/6a906f51-e03d-4d19-91c0-10a56d1cf977) -> > > -> > > Set Frame 0 to be the Inertial Frame for reference and Frame Base to be the Frame of the Quadcopter's center of mass (CM). -> > > The Quadcopter's Pose can be specified with position (x, y, z) and Orientation via Euler angle (Roll (ϕ), Pitch (θ), Yaw (ψ)) or q=(x,y,z). ,ϕ,θ,ψ) The quadcopter speed can be specified as follows: $\dot{q} = \left(\dot{x}, \dot{y}, \dot{z}, \dot{\phi}, \dot{\theta}, \dot{\psi} \right)$ -> > > -> > - Translation -> > > For a quadcopter, the force that occurs is only one force in the $Z\left(F_{z}\right)$ axis. which serves to increase-decrease the Altitude of the Quadcopter. The said force is the sum of the force from all 4 propellers (Thrust) which is directly proportional to the Angular velocity squared. +> > +> > Set Frame 0 to be the Inertial Frame for reference and Frame Base to be the Frame of the Quadcopter's center of mass (CM). +> > The Quadcopter's Pose can be specified with position (x, y, z) and Orientation via Euler angle (Roll (ϕ), Pitch (θ), Yaw (ψ)) or q=(x,y,z). ,ϕ,θ,ψ) The quadcopter speed can be specified as follows: $\dot{q} = \left(\dot{x}, \dot{y}, \dot{z}, \dot{\phi}, \dot{\theta}, \dot{\psi} \right)$ +> > +> > **- Translation** +> > For a quadcopter, the force that occurs is only one force in the $Z\left(F_{z}\right)$ axis. which serves to increase-decrease the Altitude of the Quadcopter. The said force is the sum of the force from all 4 propellers (Thrust) which is directly proportional to the Angular velocity squared. ```math thrust \propto w^2 ``` @@ -84,12 +84,12 @@ thrust = kw^2 ```math F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) ``` -> > > When k is Lift constant -> > > -> > > Because there is only one force in the Z axis, we want to control the direction in the X and Y axes as well. Therefore, Rolling and Pitching are used to help create the force in the Y axis, respectively. +> > When k is Lift constant +> > +> > Because there is only one force in the Z axis, we want to control the direction in the X and Y axes as well. Therefore, Rolling and Pitching are used to help create the force in the Y axis, respectively. -> > - Rotation -> > > The thing that will allow the quadcopter to be able to roll, pitch, and yaw is from the torque that occurs in each axis. +> > **- Rotation** +> > The thing that will allow the quadcopter to be able to roll, pitch, and yaw is from the torque that occurs in each axis. ```math \tau_{x} = lk\left(w_{4}^2 - w_{2}^2\right) ``` @@ -99,12 +99,38 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) ```math \tau_{z} = b\left(w_{1}^2 - w_{2}^2 + w_{3}^2 - w_{4}^2\right) ``` -> > > When b is Drag Constant +> > When b is Drag Constant -> 3. Quadcopter Degree of Freedom -> 4. Quadcopter Dynamics -> > - External force and torque -> > > From the above, we can write external force and torque in matrix form as follows. +> **2. Quadcopter Degree of Freedom** +> > **- Motor mixing algorithm** +> > To control the Quadcopter's rolling pitching and Yawing, it can only be controlled through the speed of the individual motors. +which can be written out as a relationship as follows +```math +motor 1 = thrust_{cmd} - pitch_{cmd} + yaw_{cmd} +``` +```math +motor 2 = thrust_{cmd} - roll_{cmd} - yaw_{cmd} +``` +```math +motor 3 = thrust_{cmd} + pitch_{cmd} + yaw_{cmd} +``` +```math +motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} +``` +> > +> > **- Angular velocity of base frame** +> > We can find the Angular velocity $\left(\vec{w_{b}}\right)$ of the point CM with respect to Frame 0 from +```math +\vec{w_{b}} = \begin{bmatrix}\dot{\phi} \\ 0 \\ 0 \end{bmatrix} + R_{x}^T \left(\phi\right)\begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \end{bmatrix} - R_{x}^T \left(\phi\right)R_{y}^T \left(\theta\right)\begin{bmatrix} 0 \\ 0 \\ \dot{\psi}\end{bmatrix} +``` +```math +\vec{w_{b}} = \begin{bmatrix}\w_{bx} \\ w_{by} \\ w_{bz} \end{bmatrix} = \begin{bmatrix} 1 & 0 & -S_{\phi} \\ 0 & C_{\phi} & C_{\theta}S_{\phi} \\ 0 & -S_{\phi} & C_{\theta}C_{\phi} \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} +``` +> > When $R_{n}$ is Rotation matrix +> > +> **3. Quadcopter Dynamics** +> > **- External force and torque** +> > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} \begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1} ^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} @@ -120,8 +146,8 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) ```math R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)R_{x}\left(\phi\right) ``` -> > - Equation of Motion (EOM) -> > >How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). +> > **- Equation of Motion (EOM)** +> > How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). ```math K.E. = \frac{1}{2}m\left(x^2+y^2+z^2\right)+\frac{1}{2}\left(I_{x} w_{bx}^2+I_{y} w_{by}^2+I_{z} w_{bz}^2\right) From 7bf81acf4a34abc3a0373302c42fc2d9023e3ef3 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:18:21 +0700 Subject: [PATCH 32/44] Sumedit.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c7da5c..a8898d6 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} > > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} -\begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1} ^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} +\begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1}^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} ``` ```math From 7b1b9d62ce1d0d4683c545897b53c78484987c64 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:38:01 +0700 Subject: [PATCH 33/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a8898d6..91506d0 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} \vec{w_{b}} = \begin{bmatrix}\dot{\phi} \\ 0 \\ 0 \end{bmatrix} + R_{x}^T \left(\phi\right)\begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \end{bmatrix} - R_{x}^T \left(\phi\right)R_{y}^T \left(\theta\right)\begin{bmatrix} 0 \\ 0 \\ \dot{\psi}\end{bmatrix} ``` ```math -\vec{w_{b}} = \begin{bmatrix}\w_{bx} \\ w_{by} \\ w_{bz} \end{bmatrix} = \begin{bmatrix} 1 & 0 & -S_{\phi} \\ 0 & C_{\phi} & C_{\theta}S_{\phi} \\ 0 & -S_{\phi} & C_{\theta}C_{\phi} \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} +\vec{w_{b}} = \begin{bmatrix} w_{bx} \\ w_{by} \\ w_{bz} \end{bmatrix} = \begin{bmatrix} 1 & 0 & -S_{\phi} \\ 0 & C_{\phi} & C_{\theta}S_{\phi} \\ 0 & -S_{\phi} & C_{\theta}C_{\phi} \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} ``` > > When $R_{n}$ is Rotation matrix > > @@ -133,7 +133,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} > > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} -\begin{bmatrix} 0 \\ 0 \\ k\left(\sum_{i=1}^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} +\begin{bmatrix} 0 \\ 0 \\ k\left( \sum_{i=1}^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} ``` ```math From e44c9bf75cc90b04e2c0699f47479d38333ebbf3 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:44:11 +0700 Subject: [PATCH 34/44] Update README.md --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 91506d0..0ce590b 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ # Component ### Motor Slider + > In motor slider UI have 4 component > > 1. The text shows the speed of all 4 motors in RPM units. The lowest value is 0 and the highest is 20,000 rads/s @@ -65,6 +66,7 @@ of the computer > The creator has applied it for user interaction through UI and simulation. ### Dynamic Calculation + > **1. Quadcopter Degree of Freedom** > > **- Reference Frame** > > Set the system axis as shown in the picture. @@ -74,6 +76,7 @@ of the computer > > The Quadcopter's Pose can be specified with position (x, y, z) and Orientation via Euler angle (Roll (ϕ), Pitch (θ), Yaw (ψ)) or q=(x,y,z). ,ϕ,θ,ψ) The quadcopter speed can be specified as follows: $\dot{q} = \left(\dot{x}, \dot{y}, \dot{z}, \dot{\phi}, \dot{\theta}, \dot{\psi} \right)$ > > > > **- Translation** +> > > > For a quadcopter, the force that occurs is only one force in the $Z\left(F_{z}\right)$ axis. which serves to increase-decrease the Altitude of the Quadcopter. The said force is the sum of the force from all 4 propellers (Thrust) which is directly proportional to the Angular velocity squared. ```math thrust \propto w^2 @@ -89,6 +92,7 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) > > Because there is only one force in the Z axis, we want to control the direction in the X and Y axes as well. Therefore, Rolling and Pitching are used to help create the force in the Y axis, respectively. > > **- Rotation** +> > > > The thing that will allow the quadcopter to be able to roll, pitch, and yaw is from the torque that occurs in each axis. ```math \tau_{x} = lk\left(w_{4}^2 - w_{2}^2\right) @@ -102,6 +106,7 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) > > When b is Drag Constant > **2. Quadcopter Degree of Freedom** +> > > **- Motor mixing algorithm** > > To control the Quadcopter's rolling pitching and Yawing, it can only be controlled through the speed of the individual motors. which can be written out as a relationship as follows @@ -129,6 +134,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} > > When $R_{n}$ is Rotation matrix > > > **3. Quadcopter Dynamics** +> > > **- External force and torque** > > From the above, we can write external force and torque in matrix form as follows. ```math @@ -164,6 +170,7 @@ L = K.E. - P.E. ``` ### 3D Visualization + > The visualization part involves drawing the Quadcopter on the screen and updating its position based on differential values of X, Y, Z, roll, pitch, yaw. > > ![messageImage_1702377397219](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/99a2c0b9-bafe-4758-93dd-eee1ea889626) @@ -173,6 +180,7 @@ L = K.E. - P.E. > The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. > # User Guide + > 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: > > - Section 1: Importing relevant packages into the project. @@ -194,17 +202,21 @@ L = K.E. - P.E. > 3. When visualization is complete, Program will shut down automatically. # Demos & Result + ## Examples -> - Example 1: falling and spin about z-axis + +> **- Example 1:** falling and spin about z-axis > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/f8c78fa3-a352-4a3c-b3cf-c508be4a07e9 -> - Example 2: hover and spin about z-axis +> **- Example 2:** hover and spin about z-axis > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/dcd746c1-80fc-45e8-a3b5-ec25d120da76 ### Validation -> - Animation compare with MATLAB + +> **- Animation compare with MATLAB** +> > > spin about z-axis > > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/c9a7a609-692d-4733-9779-8c53a8ceec56 @@ -213,11 +225,13 @@ https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/c9a7a609-692d-4 > > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4189-b823-29aa6c514485 -> - Dynamic compare with MATLAB +> **- Dynamic compare with MATLAB** +> > > Spin about z-axis and hover > > ![image5](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/289444ca-9cde-4c84-b460-13a33d8b735d) # Conclusion + > Simulating the motion of a quadcopter using Python can be done using various libraries available in Python, such as NumPy, Matplotlib, and others, to model the dynamics of the quadcopter and visualize the results graphically. Comparing the results to MATLAB may show some differences depending on the simulation methods and parameters used in each system. However, by choosing appropriate parameters and using accurate simulation methods, you can achieve results that closely match those in MATLAB. > > To enhance the reliability of your testing, you can experiment with refining and adjusting the parameters of the Python simulation to obtain results that closely align with the MATLAB outcomes. Testing that involves comparing results with MATLAB is a good step to verify the accuracy and reliability of your simulation. @@ -225,10 +239,13 @@ https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4 > Keep in mind that since there is no real-world quadcopter for direct comparison, testing can only be done by comparing results within the simulation environments, such as Python and MATLAB. # Future plan + > - **Improve GUI and visualization.** > - **Testing with real quadcopter.** > - **Real-time speed adjustment and display of results.** +> # Reference + > - [1] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. > - [2] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: [droneomega.com](https://droneomega.com/what-is-a-quadcopter/) [02/11/23] > - [3] Pranav Bhounsule, 2020, Robotics Lec25,26: 3D quadcopter, derivation, simulation, animation (Fall 2020) [Online], Available: [YouTube](https://www.youtube.com/watch?v=4hlq2pf842u) [02/11/23] From 77eb917e75784c992d612d48db8d19cd631d063c Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:46:06 +0700 Subject: [PATCH 35/44] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 0ce590b..608515c 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ of the computer > **1. Quadcopter Degree of Freedom** > > **- Reference Frame** +> > > > Set the system axis as shown in the picture. > ![Untitled_Artwork](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/6a906f51-e03d-4d19-91c0-10a56d1cf977) > > @@ -108,6 +109,7 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) > **2. Quadcopter Degree of Freedom** > > > **- Motor mixing algorithm** +> > > > To control the Quadcopter's rolling pitching and Yawing, it can only be controlled through the speed of the individual motors. which can be written out as a relationship as follows ```math @@ -124,6 +126,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} ``` > > > > **- Angular velocity of base frame** +> > > > We can find the Angular velocity $\left(\vec{w_{b}}\right)$ of the point CM with respect to Frame 0 from ```math \vec{w_{b}} = \begin{bmatrix}\dot{\phi} \\ 0 \\ 0 \end{bmatrix} + R_{x}^T \left(\phi\right)\begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \end{bmatrix} - R_{x}^T \left(\phi\right)R_{y}^T \left(\theta\right)\begin{bmatrix} 0 \\ 0 \\ \dot{\psi}\end{bmatrix} @@ -136,6 +139,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} > **3. Quadcopter Dynamics** > > > **- External force and torque** +> > > > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} @@ -153,6 +157,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)R_{x}\left(\phi\right) ``` > > **- Equation of Motion (EOM)** +> > > > How to solve equations to find The equations of motion of the quadcopter are therefore applied by the Euler-Lagrange Method, where the Lagrangian (L) is the difference between the kinetic energy (K.E.) and the gravitational potential energy (P.E.). ```math From d0413e242ffb9067bd9c459d801d4062f7dc46fb Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:47:28 +0700 Subject: [PATCH 36/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 608515c..9be99e7 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} = \begin{bmatrix} t_{\phi} \\ t_{\theta} \\ t_{\phi} \end{bmatrix} = \begin{bmatrix} lk\left(w_4^2 - w_2^2\right) \\ lk\left(w_3^2 - w_1^2\right) \\ b\left(w_1^2 + w_2^2 + w_3^2 + w_4^2\right)\end{bmatrix} ``` -> > > When $A_{n}$ is damper +> > When $A_{n}$ is damper ```math R_{rpy} = R_{z}\left(\psi\right)R_{y}\left(\theta\right)R_{x}\left(\phi\right) @@ -169,7 +169,7 @@ P.E. = mgz ```math L = K.E. - P.E. ``` -> > >Then we can find the equation of motion by +> > Then we can find the equation of motion by ```math \frac{\mathrm d}{\mathrm d t}\left(\frac{\mathrm \partial}{\mathrm \partial \dot{q}_{k}}\right) - \frac{\mathrm \partial L}{\mathrm \partial q_{k}} = \Gamma_{k} = \begin{bmatrix} F_{ext} \\ \tau_{ext} \end{bmatrix} ``` From 4f3e99769e88e74b472b659862ccadbdafcbbc0f Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Wed, 13 Dec 2023 23:42:38 +0700 Subject: [PATCH 37/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9be99e7..2404c75 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ ### Motor Slider > In motor slider UI have 4 component -> > 1. The text shows the speed of all 4 motors in RPM units. -The lowest value is 0 and the highest is 20,000 rads/s +> > 1. The text shows the speed of all 4 motors in rads/s units. +The lowest value is 0 and the highest is 1,000 rads/s > > 2. Slide bar is used only for adjusting the speed of individual motors in order of Left is the least value. The right is the most valuable. > > 3. Text box is used to override the speed of all motors to have the same speed. > > 4. Enter button is used to confirm the override of the motor speed after entering the speed into the text box. From 97c35d0055742c695c3ad155d0db6ac523fc08f2 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Thu, 14 Dec 2023 02:23:26 +0700 Subject: [PATCH 38/44] Finally Readme.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2404c75..84b8416 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,10 @@ motor 4 = thrust_{cmd} + roll_{cmd} - yaw_{cmd} > > From the above, we can write external force and torque in matrix form as follows. ```math \vec{F}_{ext} = R_{rpy} -\begin{bmatrix} 0 \\ 0 \\ k\left( \sum_{i=1}^4 w_i^2 \right) \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} +\begin{bmatrix} 0 \\ 0 \\ k \displaystyle\sum_{i=1}^4 w_i^2 \end{bmatrix} - \begin{bmatrix} A_{x}\dot{x} \\ A_{y}\dot{y} \\ A_{z}\dot{z} \end{bmatrix} +``` +```math + ``` ```math From 752b2a581c509ee5ded813dd1769f35804eb56ba Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Thu, 14 Dec 2023 17:21:33 +0700 Subject: [PATCH 39/44] Update README.md --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 84b8416..9951808 100644 --- a/README.md +++ b/README.md @@ -216,27 +216,44 @@ L = K.E. - P.E. > **- Example 1:** falling and spin about z-axis > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/f8c78fa3-a352-4a3c-b3cf-c508be4a07e9 +> To simulate rotation around the z-axis and falling along the z-axis, start by adjusting the speed of all four motors to achieve a balanced condition calculated from + +```math +ω = \sqrt{\frac{mg}{4k}} +``` + +> From the set parameters, you have obtained ω = 620.61 rad/s. Next, adjust the speed of motors 1 and 3 to decrease to 600 rad/s. > **- Example 2:** hover and spin about z-axis > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/dcd746c1-80fc-45e8-a3b5-ec25d120da76 +> To simulate rotation around the z-axis and ascending along the z-axis, start by adjusting the speed of all four motors to achieve a balanced condition. Then, decrease the speed of motors 1 and 3 to 645 rad/s. + ### Validation +> For the validation of dynamics, as we do not have a real quadcopter, we can only compare the computed values between Python and MATLAB. This comparison will be divided into two parts: visualization and the values obtained from the calculations. +> > **- Animation compare with MATLAB** > -> > spin about z-axis +> > **spin about z-axis** > > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/c9a7a609-692d-4733-9779-8c53a8ceec56 -> > spin about x-axis +> > In this test, we will compare the rotation around the z-axis using the same set of parameters for both simulations, running for a total of 1 second (100 time steps). From the clips, it can be observed that the rotational motion around the z-axis in both simulations has similar characteristics. + +> > **spin about x-axis** > > https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4189-b823-29aa6c514485 +> > In this test, we will compare the rotation around the x-axis using the same set of parameters for both simulations, running for a total of 1 second (100 time steps). From the clips, it can be observed that the rotational motion around the x-axis in both simulations has similar characteristics. + > **- Dynamic compare with MATLAB** > -> > Spin about z-axis and hover +> > **Spin about z-axis and hover** > > ![image5](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/289444ca-9cde-4c84-b460-13a33d8b735d) +> > +> > The obtained values are close, and by examining the results at step 100, it can be seen that the position value from Python is 0.0373, while the value from MATLAB is 0.0367. The discrepancy may arise from rounding differences in the calculations between Python and MATLAB. # Conclusion From 11c964f2f51187120011ef849561ba49cd796206 Mon Sep 17 00:00:00 2001 From: mojitoliz <122668877+mojitoliz@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:22:51 +0700 Subject: [PATCH 40/44] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9951808..1bfc361 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,15 @@ L = K.E. - P.E. > ![messageImage_1702377463885](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/197dc99a-d1ea-4d05-9998-150636515228) > The libraries used for this visualization are Pygame for display creation and OpenGL for graphics rendering. -> + +### System Architecture Diagram + +Over all diagram +![systemarch](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/cac4b180-5955-4f53-ade0-f6102da04c37) + +Diagram in focus part +![sysdi](https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/2598af9e-12c7-42e4-91a2-3f700a75f4ff) + # User Guide > 1. Within the Jupyter Notebook file, there are a total of 3 sections, consisting of: From 5eea2608af0ff4bd4edf95b9592778bd94e9de8f Mon Sep 17 00:00:00 2001 From: "P. Tanawat" <83177015+TanawatPawanta@users.noreply.github.com> Date: Wed, 3 Jan 2024 21:03:04 +0700 Subject: [PATCH 41/44] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1bfc361..c95b474 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - [**Demos & Result**](#demosnresult) - [**Conclusion**](#conclusion) - [**Future plan**](#futureplans) - - [**Reference**](#reference) + - [**References**](#references) ## Installation @@ -277,7 +277,7 @@ https://github.com/Fzil0n/QuadCopter_simulation/assets/122668877/8194b8d3-2021-4 > - **Testing with real quadcopter.** > - **Real-time speed adjustment and display of results.** > -# Reference +# References > - [1] Lebedev, A. (2013). Design and Implementation of a 6DOF Control System for an Autonomous Quadrocopter (Master's thesis). Julius Maximilian University of Würzburg, Faculty of Mathematics and Computer Science, Aerospace Information Technology, Chair of Computer Science VIII, Prof. Dr. Sergio Montenegro. > - [2] DRONE OMEGA, 2020, What is a Quadcopter Explained Thoroughly [Online], Available: [droneomega.com](https://droneomega.com/what-is-a-quadcopter/) [02/11/23] From c718c0b83269b967d68f73b8876d818e00fae9e9 Mon Sep 17 00:00:00 2001 From: "P. Tanawat" <83177015+TanawatPawanta@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:37:08 +0700 Subject: [PATCH 42/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c95b474..1ccd5d5 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ F_{z} = k\left(w_{1}^2 + w_{2}^2 + w_{3}^2 + w_{4}^2\right) ``` > > When b is Drag Constant -> **2. Quadcopter Degree of Freedom** +> **2. Motors control algorithm** > > > **- Motor mixing algorithm** > > From bcfa8831f06ed313644fbb6a6f6b365fbe80e101 Mon Sep 17 00:00:00 2001 From: "P. Tanawat" <83177015+TanawatPawanta@users.noreply.github.com> Date: Fri, 5 Jan 2024 20:23:02 +0700 Subject: [PATCH 43/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ccd5d5..de34b83 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Quadcopter Simulation -> This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors using Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. Special thanks to [this MATLAB script](https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX) for finding the Quadcopter's equation of motion. +> This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors in Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. Special thanks to [this MATLAB script](https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX) for finding the Quadcopter's equation of motion. # Table of Contents - [**Installation**](#installation) - [**Component**](#component) From 81ee800a237ae5ca1842761aa00e2dcbbfac54fc Mon Sep 17 00:00:00 2001 From: "P. Tanawat" <83177015+TanawatPawanta@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:02:35 +0700 Subject: [PATCH 44/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de34b83..bc3d66c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Quadcopter Simulation -> This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors in Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. Special thanks to [this MATLAB script](https://youtu.be/4hlQ2pf842U?si=a1AfHnj8r89j6BRX) for finding the Quadcopter's equation of motion. +> This project aims to visualize a Quadcopter's motion (roll, pitch, yaw, and hover) in 3D space by adjusting the speed of four motors in Python. The project consists of three main parts: motor speed adjustment window, dynamic calculation, and 3D visualization. # Table of Contents - [**Installation**](#installation) - [**Component**](#component)