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

第1和2周在另一篇帖子下… 分开好写一点
附上链接: 1 Robotics: Aerial Robotics 第1+2周 课程学习记录及课后习题解答

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

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

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

  • 2.7:明天开始学习并更新吧,这么一看,我进度有点迅猛…
  • 2.8:急性之下… 都看完了,感想都在文字里了… 3D的调着真累

WEEK - 3

Quiz

1.In the nested feedback control loop
The inner loop corresponds to orientation and the outer loop corresponds to position.

2. a r g m i n x ( t ) 0 T x ( 5 ) ( t ) 2 d t argmin_{x(t)}{\int\limits_0^T {\left\| {{x^{(5)}}(t)} \right\|} ^2}dt is an k k th degree polynomial trajectory where k = k=
9
解释:这里的 x ( 5 ) ( t ) {{x^{(5)}}(t)} 也就是等于 c 4 x 4 + c 3 x 3 + c 2 x 2 + c 1 x 1 + c 0 x 0 c_4x^4+c_3x^3+c_2x^2+c_1x^1+c_0x^0 所以平方后最高阶是8,再一次积分成为9所以 k = 9 k=9

3.Which of the following are simplifying assumptions we made when designing the controller in this module?
Quadrotor is near equilibrium
Angular velocities are close to zero
Roll and pitch angles are close to zero

Programming Assignment: 2-D Quadrotor Control

太认真看pdf也会… /被坑,PS题目中,pdf最后一页是,阈值小于最小值能得满分,一开始… 我以为要在那个范围内,还说,我设计的好了还不行,现在想来是有点搞笑,\笑哭。正题:两个没反应过来的点:

  • 还记得我第2周作业里说到无法得到连续时间内,所以角度求导… 是0,一开始一直没反应过来,想着怎么求这个 ϕ ¨ c \ddot \phi_c ϕ ˙ c \dot \phi_c 这两个是理想情况下,他们应该都是0,也就是四旋翼没有横滚…
  • 还有就是三个!PD控制器,PD值的测试。

直接贴一下没有三个参数的代码:

%这里参数有错噢,且看下文
Kpz=50;Kvz=2;
Kpf=50;Kvf=2;
Kpy=50;Kvy=2;
%这里参数有错噢,且看下文

%% 这里是公式求推理,看下文公式对应
u1=params.mass*(params.gravity+des_state.acc(2)+Kvz*(des_state.vel(2)-state.vel(2))+Kpz*(des_state.pos(2)-state.pos(2)));
fc=-(des_state.acc(1)+Kvy*(des_state.vel(1)-state.vel(1))+Kpy*(des_state.pos(1)-state.pos(1)))/params.gravity;
u2=params.Ixx*(0+Kvf*(0-state.omega)+Kpf*(fc-state.rot));
%最大的u1,u2限制
if u1>params.maxF
    u1=params.maxF;
end

接下来看图,仔细看图,需要的平面是y-z哦!2D的。
图片1
剩下三个公式我也直接截图pdf的贴进来了,
公式1
现在应该就能对应上代码中 u 1 , ϕ c , u 2 u_1,\phi_c,u_2 了,这个pdf的公式顺序如果按求的来说其实有点问题,不过大家都能看懂了。
==然后!==最磨人的来了,找3个PD控制的值!(z平面,y平面, ϕ \phi 角度)
首先对于跟随直线来说,z平面只要保持在z=1即可,所以测试过程中,我截几张图给大家一起分析一下:
这是我随便设的值(一般调PID都是先P后D再I,详情转PID控制器即可)

Kpz=50;Kvz=0;
Kpf=50;Kvf=0;
Kpy=50;Kvy=0;

图片2
这个状态我们可以得知:1.角度的PD控制器不行,连基本的保持0°都没有,2.z无法维持在z=1,有一点维持迹象但是又下去了,y就是… 往右状态。那么!我们应该先解决问题1,加大对角度的控制!加!

Kpz=50;Kvz=0;
Kpf=500;Kvf=0;%直接来个500
Kpy=50;Kvy=0;

在这里插入图片描述
是不是至少到终点了。但是!由于我们没有加微分,所以很明显右边第3幅图抖的厉害,那么,接下来就很明显了,加大Kvf使角度先稳定。
一般来说PD的倍数有时候相差几倍的,按你自己感觉来吧(这里再次:如果以前做过电设可能调这个会得心应手,一下就知道了)

Kpz=50;Kvz=0;
Kpf=500;Kvf=10;%直接来个500
Kpy=50;Kvy=0;

T3
再一看是不是好多了,但是,咦咦咦,为啥我的小四旋翼掉下去了… 没错我们对z,y的D都没有调呢,人家只有冲上去的劲,当然无法稳定来,那就随意点,都加上D也就是Kv(z,y我都加了5)

Kpz=50;Kvz=5;
Kpf=500;Kvf=10;%直接来个500
Kpy=50;Kvy=5;

在这里插入图片描述
哦呦!他终于能稳稳当当的停下来,而不掉下去了,接下来又有发现问题了吧,对!角度又有抖动了->Kfv(角度的D),后面过程我就不贴图了,找到值都在最低阈值下的,直接贴了,但是大家一点要自己理解哦:(那么正确参数的完整代码,hoho)当然这个参数答案不唯一,位置误差越小越好啦~

% FILL IN YOUR CODE HERE
Kpz=80;Kvz=12;
Kpf=1000;Kvf=30;
Kpy=20;Kvy=5;
u1=params.mass*(params.gravity+des_state.acc(2)+Kvz*(des_state.vel(2)-state.vel(2))+Kpz*(des_state.pos(2)-state.pos(2)));
fc=-(des_state.acc(1)+Kvy*(des_state.vel(1)-state.vel(1))+Kpy*(des_state.pos(1)-state.pos(1)))/params.gravity;
u2=params.Ixx*(0+Kvf*(0-state.omega)+Kpf*(fc-state.rot));
%最大的u1,u2限制
if u1>params.maxF
    u1=params.maxF;
end

这个仅为以上参数得出的图:
在这里插入图片描述
误差和如下:

Line trajectory:
Cumulative position error: 0.017743

Sine trajectory:
Cumulative position error: 0.081424

然后submit,把生成的.mat上传就能知道自己的分数合格啦~

WEEK - 4

Quiz

1.What sensors would you rely on for state estimation in an office building with vertical walls without too much clutter due to furniture when the lighting is poor?
IMU
Laser Scanners

解释:这些传感器的使用失效如果自己做过东西用过,就特别好悬念,例如光线暗(摄像头就不要了),垂直的墙(墙内会有钢筋影响GPS的定位,一般室内就GPS不要了…)

2.Given a desired thrust vector t = s i n ( 3 0 ) c o s ( 4 5 ) a 1 + s i n ( 3 0 ) s i n ( 4 5 ) a 2 + c o s ( 3 0 ) a 3 t=sin(30^∘)cos(45^∘)a_1+sin(30^∘)sin(45^∘)a_2+cos(30^∘)a_3 and a desired yaw angle, ψ d e s = 4 5 ψ_{des}=45^∘ . Compute the desired rotation matrix, R d e s R_{des} .
[0.6124 -0.7071 0.3536;0.6124,0.7071,0.3536;-0.5,0,0.8866]

3.What is the rotation matrix that describes the attitude error if the current rotation matrix is given by RR and the desired rotation matrix is R d e s R_{des}
[0.6424 0.25 0.7244;-0.483 0.866 0.1294;-0.595 -0.433 0.6771]

4.What sensors are most likely to fail when operating indoors in a building with glass walls?
GPS
Laser Scanners
Cameras

解释:此处解释玻璃,反射问题所以导致激光雷达基本gg

5.What sensors are most likely to fail when the robot is flying outdoors, close to the ground near the wall of a tall building?
GPS

Programming Assignment: 3-D Quadrotor Control

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

猜你喜欢

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