1 Robotics: Aerial Robotics 第1+2周 课程学习记录及课后习题解答

此课程在Coursera需要科学上网才能观看,但是b站有人搬运,只是无中英字幕,放一下B站和Coursera的课程链接

  1. B站链接 Robotics Specialization #机器人学(宾夕法尼亚大学)
  2. Coursera的链接介绍

建议将Coursera自身翻译的中文对着b站看,虽然视频播不了,但是能看字幕的txt文件。
此文仅为听课记录以及做题思考,可以的话我会将题目和代码题都搬运一下
VS 为视频字幕,MI为个人想法,有所错误或是好的想法欢迎评论区交流。
附件于资源链接处

更新记录:

  • 2.7:从2.5号看的,此贴算是更新完了,因为3,4周新开了一个贴,这样… 防止我复制的时候bug过多… 1,2周其实算简单的,第2周后面可能会晕,但是我觉得没影响我做题,往入门同学也别在此放弃了。欢迎有问题一起讨论(要是时间长远讨论不起来也是有可能的 \狗头)

WEEK 1 —— 第一周

1. The robot has six degrees of freedom(四旋翼有6个自由度)
How many different ways can you rotate or translate the robot?
四旋翼飞行器沿各自由度的运动
Yaw, Roll, Pitch对应三个rotate(旋转)
前后,左右,垂直对应translate(平移)

2. In any system, ask how the following components work!

  • State Estimation 状态估计
  • Control 控制
  • Mapping 建图(SLAM)
  • Planning 规划(路径规划)

3. Basic Mechanics(Hover)
四旋翼力学解释图:

Problem
State, input(状态输入)       x , u R x,u \in R
Plant model        x ¨ = u \ddot x=u
Find a control input function u ( t ) u(t) -> So that x ( t ) x(t) follows the desired trajectory x d e s ( t ) {x^{des}}(t)
General Approach
Define error, e ( t ) = x d e s ( t ) x ( t ) e(t)=x^{des}(t)-x(t) -> Want e ( t ) e(t) to converge exponentially to zero(使误差接近于0)
Strategy
Find u ( t ) u(t) such that        e ¨ + K v e ˙ + K p e = 0 \ddot e +{K_v}\dot e+{K_p}e = 0        K v , K p > 0 K_v,K_p>0

VS:为什么是这个方程呢? 因为,在这个微分方程, 有两个未知量,Kp 和 Kv。如果选择了适当的 Kp 的值和 Kv,更具体地说, 如果我可以保证,这些值都是正的 我就能保证误差项能以指数的速度趋向于0。
MI:如果能使误差的加速度,速度,误差本身相加为0,那么误差的增长及本身的将来都是能控制于0。
这里就是PID中PD的式子 x ¨ d e s ( t ) \ddot x^{des}(t) 是前馈, K v e ˙ {K_v}\dot e K v K_v 为Derivative, K p e ( t ) K_pe(t) K p K_p 为Proportional

PD control
u ( t ) = x ¨ d e s ( t ) + K v e ˙ + K p e ( t ) u(t)=\ddot x^{des}(t) +{K_v}\dot e+ K_pe(t)
VS:比例项就像一个弹簧或电容。其越高,系统变得更有弹性和更有可能超调。
微分项越高,密度就越大。这就像粘性阻尼或阻力在电气系统。

PID control
u ( t ) = x ¨ d e s ( t ) + K v e ˙ + K p e ( t ) + K i 0 t e ( τ ) d τ u(t)=\ddot x^{des}(t)+ {K_v}\dot e +K_pe(t) +{K_i}\int\limits_0^t {e(\tau )} d\tau
VS:当你不知道系统的具体模型时, 用这个比较好。 例如,你可能不知道质量,或 你需要克服一些风阻力和 你不能预先知道这风的阻力。 这最后一项可以用来补偿 未知数量、风力、干扰, 造成的未知影响。

Quiz

1.1
1 Which of these factors has NOT contributed to the rapidly-increasing commercial interest in multi-rotor vehicles?
Efficiency in forward flight

2 In how many ways can you translate and rotate this robot in free space? Enter your answer as a numeric value (e.g. 1 instead of one).
6
6个自由度,如记录所示

3 How many independent control inputs does the vehicle shown above have?
6, because there are six motors

4 Which of these components are incorporated in commercial products mentioned in lecture such as the DJI Phantom or the Parrot Bebop? (Select all that apply.)
全选

5 An Inertial Measurement Unit (IMU) is an important sensor used in aerial robotics. A typical IMU will contain an accelerometer and a rate gyro. Which of the following information does a robot get from an IMU? (Select all that apply. Choose only quantities that are directly reported by the IMU. Do not include quantities that can be computed from the IMU measurements but cannot be obtained directly. Additional research to find information about IMUs is allowed and encouraged!)
Linear acceleration
Angular velocity

解释:注意这里是问包含加速度计和陀螺仪的IMU是实际数据,其余都是通过计算而得的,例如:6050 DMP库等计算方法。
An accelerometer measures linear acceleration, a rate gyro measures angular velocity.
These are the only quantities the unit will actually measure.
The other properties - whether positions, velocities or accelerations - have to be calculated by the controller. For example integrating an acceleration gives a velocity, and integrating again gives position.

6 What does Simultaneous Localization And Mapping (SLAM) software do? (Select all that applies.)
Estimates the location of features in the environment
Estimates the position and orientation of the robot with respect to the environment

1.2
1.You observe the response of a system shown in the figure below

What should you do to decrease the oscillations in the response?
Decrease the proportional gain
Increase the derivative gain

解释:可以看出已经超调,后续有震荡,所以P不能再增大了,适当减小,小震荡通过D增加而消除

2.Download the simulation GUI attached below and unzip the contents into a folder of your choice. This is NOT the same GUI that was used in the in-video questions.
此处有zip文件,后续添加百度云链接
Open MATLAB in the directory where the unzipped files are and type “runsim” in the MATLAB Command Window to start the GUI.
Given that the derivative gain K v = 5 K_v=5 , find the proportional gain K p K_p (up to two decimal places) such that the rise time is less than 1s and overshoot less than 5%.
12

3.Assuming we are using the F550 E310 4 cell battery with a 200g onboard computer and a laser (270g), what is the thrust to weight ratio of the platform? (We use the term “weight” and “thrust” loosely. Except for Thrust/Weight and Propeller, all units are in grams)

2.264
注意此处为将原来的COMPUTE SENSOR的重量去掉,加上题目给的,也就是Weight=1278+600+200+270,MAX Thrust=5316,Thrust/Weight=2.264

4.Why don’t all the rotors of a quadrotor spin in the same direction?
Spinning all rotors in the same direction will cause the robot to constantly rotate.

5.Given that a quadrotor consumes 200 W to carry a mass of 1kg, which component contributes more to the quadrotor’s total power consumption?
A 100g computer that consumes 40W for operation or a 200g laser which consumes 20W for operation?
Both contribute the same to the power consumption.
解释: 100 40 = 200 20 100*40=200*20 (注意看是不是这两个数,重做可能会有 100 30 < 200 20 100*30<200*20 哦)

WEEK 2 —— 第二周

后面的课程用电脑写笔记太麻烦了… 转战IPAD了,能贴图我就贴个图吧,测试部分还是正常上传。此处笔记没有包含附加内容… 有时候也懒得写笔记(不过这周听的旋转云里雾里的… 倒是题目都解决了,但是有些理解不了,比如 罗德里格斯公式Rodrigues’ rotation formula 那里的推导真的是… 听不太懂看了其他理解,发现和课上讲的还不一样… emmm 共勉吧)
笔记1
笔记2

Quiz

2.1
1.Which of the following matrices are rotation matrices?
A. [ 0.2120 0.7743 0.5963 0.2120 0.6321 0.7454 0.9540 0.0316 0.2981 ] \left[ {\begin{array}{cc} {0.2120}&{0.7743}&{0.5963}\\ {0.2120}&{ - 0.6321}&{0.7454}\\ {0.9540}&{ - 0.0316}&{ - 0.2981} \end{array}} \right]                     B. [ 2 2 0 2 2 0 1 0 2 2 0 2 2 ] \left[ {\begin{array}{cc} {\frac{{\sqrt 2 }}{2}}&0&{\frac{{\sqrt 2 }}{2}}\\ 0&1&0\\ { - \frac{{\sqrt 2 }}{2}}&0&{ - \frac{{\sqrt 2 }}{2}} \end{array}} \right]
C. [ 0.3835 0.5730 0.9287 0.5710 0.5919 0.4119 1.3954 0.0217 1.1105 ] \left[ {\begin{array}{cc} {0.3835}&{0.5730}&{0.9287}\\ {0.5710}&{0.5919}&{ - 0.4119}\\ { - 1.3954}&{0.0217}&{1.1105} \end{array}} \right]                     D. [ cos ( θ ) sin ( θ ) sin ( θ ) cos ( θ ) ] \left[ {\begin{array}{cc} {\cos (\theta )}&{ - \sin (\theta )}\\ {\sin (\theta )}&{\cos (\theta )}\\ \end{array}} \right]

ABD
解释:此处是对于旋转矩阵的判断,如上笔记所示:
matlab语言中det(A)=1 (注意+1),inv(A)*A=单位矩阵
[ S O ( 3 ) = { R R 3 × 3 R T R = R R T , det R = 1 } [S{O^{(3)}} = \left\{ {R \in {\mathbb{R}^{3 \times 3}}\left| {{R^T}R = R{R^T},\det R = 1} \right.} \right\}
MATLAB矩阵:a1=[sqrt(2)/2 0 sqrt(2)/2;0 1 0;-sqrt(2)/2 0 sqrt(2)/2];a2=[0.3835 0.5730 0.9287;0.571 0.5919 -0.4119;-1.3954 0.0217 1.1105];a3=[0.212 0.7743 0.5963;0.212 -0.6321 0.7454;0.954 -0.0316 -0.2981]


2.What is the ZYZ euler angle representation, ( ψ , θ , ϕ ) (ψ, \theta, ϕ) , for the following rotation matrix?

[ 0.6927 0.7146 0.0978 0.7165 0.6973 0.0198 0.0824 0.0564 0.995 ] \left[ {\begin{array}{cc} {0.6927}&{-0.7146}&{0.0978}\\ {0.7165}&{0.6973}&{0.0198}\\ {-0.0824}&{0.0564}&{0.995} \end{array}} \right]

Recall that this rotation matrix can be seen as a combination of three rotations:

[ c o s ( ψ ) s i n ( ψ ) 0 s i n ( ψ ) c o s ( ψ ) 0 0 0 1 ] \left[ {\begin{array}{cc} {cos(ψ)}&{-sin(ψ)}&{0}\\ {sin(ψ)}&{cos(ψ)}&{0}\\ {0}&{0}&{1} \end{array}} \right] [ c o s ( θ ) 0 s i n ( θ ) 0 1 ) 0 s i n ( θ ) 0 c o s ( θ ) ] \left[ {\begin{array}{cc} {cos(\theta)}&{0}&{sin(\theta)}\\ {0}&{1)}&{0}\\ {-sin(\theta)}&{0}&{cos(\theta)} \end{array}} \right] [ c o s ( ϕ ) s i n ( ϕ ) 0 s i n ( ϕ ) c o s ( ϕ ) 0 0 0 1 ] \left[ {\begin{array}{cc} {cos(ϕ)}&{-sin(ϕ)}&{0}\\ {sin(ϕ)}&{cos(ϕ)}&{0}\\ {0}&{0}&{1} \end{array}} \right]

(0.2,0.1,0.6)
解释:直接拿a,b,c带进去相乘,看哪个得出 R R


3.At a given time tt, the rotation matrix R has the value:

R = [ 0.675 0.1724 0.7174 0.2474 0.9689 0 0.6951 0.1775 0.6967 ] R=\left[ {\begin{array}{cc} {0.675}&{-0.1724}&{0.7174}\\ {0.2474}&{0.9689}&{0}\\ {-0.6951}&{0.1775}&{0.6967} \end{array}} \right]

The angular velocity ω ^ b \hat ω^b at that same time t t is:

ω ^ b = [ 0 1 0.9689 1 0 0.2474 0.9689 0.2474 0 ] \hat ω^b=\left[ {\begin{array}{cc} {0}&{-1}&{0.9689}\\ {1}&{0}&{-0.2474}\\ {-0.9689}&{0.2474}&{0} \end{array}} \right]

What is ω ^ s \hatω^s ?

[ 0 0.6967 1 0.6967 0 0.7174 1 0.7174 0 ] \left[ {\begin{array}{cc} {0}&{-0.6967}&{1}\\ {0.6967}&{0}&{-0.7174}\\ {-1}&{0.7174}&{0} \end{array}} \right]

解释: ω ^ b = R T R ˙ \hatω^b=R^T\dot R ω ^ s = R ˙ R T \hatω^s=\dot R R^T MATLAB语言求解:dotR3=inv(R3’)wb,ws=dotRR3’


4.Given the following rotation matrix, what is the corresponding axis-angle representation assuming the angle is restricted to [ 0 ,    π ] \left[0,\;\pi\right] ?

[ 0.2919 0.643 0.7081 0.643 0.4161 0.643 0.7081 0.643 0.2919 ] \left[ {\begin{array}{cc} {0.2919}&{0.643}&{-0.7081}\\ {0.643}&{-0.4161}&{-0.643}\\ {-0.7081}&{0.643}&{0.2919} \end{array}} \right]

u = [ 2 2 0 2 2 ] u = \left[ {\begin{array}{cc} {\frac{{\sqrt 2 }}{2}}&0&{ - \frac{{\sqrt 2 }}{2}} \end{array}} \right] ϕ = 2 ϕ=2

解释:MATLAB求解语句:axang = rotm2axang(R4),详情见MATLAB document


5.Given the following rotation matrix, what is the corresponding axis-angle represenntation assuming the angle is restricted to [ 0 ,    π ] \left[0,\;\pi\right] ?
[ 1 3 2 3 2 3 2 3 1 3 2 3 2 3 2 3 1 3 ] \left[ {\begin{array}{cc} {- \frac{1}{3}}&{ \frac{2}{3}}&{-\frac{2}{3}}\\\\ {\frac{2}{3}}&{-\frac{1}{3}}&{-\frac{2}{3}}\\\\ {-\frac{2}{3}}&{-\frac{2}{3}}&{-\frac{1}{3}} \end{array}} \right]

Not enough information is given to determine the axis-angle representation
解释:如题4所示


6.Recall the transformation from the in-video exercises:

Assuming p p and q q represent the vectors from the origin to the points P P and Q Q respectively, which of the following are correct expressions for the cross-product of the rotated vectors p × q p' \times q' ?

g ( p ) × g ( q ) g_*(p) \times g_*(q)
g ( p × q ) g_*(p \times q)

Programming Assignment: 1-D Quadrotor Control

详细题目见pdf(PS有什么好的上传分享方式嘛… 除了某度云…)
这里需要注意4.3 Submission and Grading处已经提醒:rise time of than 1s and a maximum overshoot of less than 5%,上升时间:90%的高度处的速度,也就是说上升到0.9m的时候时间小于1s,最高高度不超过1.05
只需将controller.m中改为如下即可:

kp=55;kd=10;
u = params.mass*(0+sum([kp;kd].*(s_des-s))+params.gravity);
if u>params.u_max
    u=params.u_max;
end

此处… 其实我有个问题的,也就是题目中
z ¨ = u m g \ddot z = \frac{u}{m} - g
Hence, the control input for a PD controller is
u = m ( z ¨ d e s + K p e + K v e ˙ + g ) u=m(\ddot z_des+K_pe+K_v\dot e+g)
按照这个题目给的代码无法迭代u的值,也就是说文件是离散的执行,一个高度一个高度的上升,但是我又没办法得到上一次的u(motor thrusts)的值,也就无法得到加速度,所以代码中我按0处理了,提交了也没啥问题。

PS 做题中可以变自己的kp,kd只是我习惯性kp,kd,ki所以不像课中所示的kv(即kd)

ise_09_time1=z(100)
overshot=max(z)

在runsim.m最后加这个可以判断是否符合题目要求。

发布了11 篇原创文章 · 获赞 11 · 访问量 3743

猜你喜欢

转载自blog.csdn.net/qq_39537898/article/details/104175348