DIY基于树莓派的斯坦福12自由度四足机器狗Pupper之旅

斯坦福12自由度四足机器狗Pupper

afreez

喜欢

678
浏览
1
喜欢

> 更多图片

项目状态:已完成
开放度:公开
所属分类:电子
发布时间:2020-05-25
最近更新:2020-05-25

标签

描述

斯坦福大学机器人团队研发的12自由度四足机器狗Pupper


详细说明

DIY斯坦福12自由度四足机器狗Pupper之旅

添加图片描述
2020年斯坦福发布了四组机器狗Pupper,3月份刚刚发布,笔者就迫不及待的开始DIY之旅,它的定位是低价开源,12自由度,我预测Pupper会成为一个标志性的产品。官网上有相应的教程,本文只分享我自己DIY的经验。我自己的演示视频及Linkedin文章见如下连接,
https://www.youtube.com/watch?v=ML8riPCMWrU
https://v.youku.com/v_show/id_XNDY4NTE1MTU3Ng==.html
https://www.linkedin.com/pulse/journey-build-quadruped-robotstanford-pupper-afreez-gan/?trackingId=geO16d6xSxaV61%2BUoVWG8Q%3D%3D
Github官网连接如下:
https://github.com/stanfordroboticsclub/stanfordquadruped

概要

  1. DIY的过程中,最让人心急的是快递时间,因为绝大多数官网推荐的器件都需要在美国购买,赶上疫情,快递的时间鬼神莫测。

  2. Github官网上给的BOM cost不包含可能损坏的器件余量,实际成本很可能会超。

  3. 关于相关技术问题,请参考后面我整理的FAQ

关于舵机
官方选择的JX CLS6336 舵机,在整个产品中使用12个,这个部分占了至少三成的成本,Nathan(这个项目的组长) 推荐多购买几个防止组装过程中有损坏,这个建议非常重要,因为如果你不是很有经验,非常容易损坏,我就是因为白痴,一开始没掌握好角度,损坏了4个(见下图),害得我不得不再次购买了几个舵机。官方推荐的组装教程中,需要使用胶水,我强烈建议一开始不要使用,除非你真的很有经验。我DIY了2个,花了不少银子,为了防止媳妇说我败家,我可是主动做了不少家务。所以,祝君好运。
添加图片描述

关于顶部/底部/腿/脚碳钎维板
为了防止有损坏,我按照官网的指导,在great3d.com上下单了两套(如下图),BOM成本大概是$84,但制造费和运费却花了$120。不过,因为确认喜欢,咬咬牙,主动多给媳妇煮几杯浓浓的咖啡,也就忍了。
添加图片描述
现在的好消息是,官网给出来一个推荐连接,可以直接按照$95的价格购买(如下图),如果你在美国,某些区域可能免费邮寄,但如果在中国,邮费还是要掏的,尤其是要忍受快递的速度,如果你已经习惯了国内的效率,如顺丰,做好充分的思想准备吧。我是3月23日下的单子,在北京拿到手已经是4月30日了。
添加图片描述

关于承载舵机和机身的3D打印件,按照官方的推荐,我选择了PLA材料(国内没找到),在www.3dhubs.com上下了订单,每套$180,如你所猜,快递之旅还是比较漫长的。

关于快递
官网上的BOM成本不包括快递费和损耗,仅仅快递费,我就花掉了$150,因为很多物料来自不同的供应商,无法一次购买一次快递。最让人头疼的是快递时间,在美国发完快递,很难追踪实时的进度,真的只能听天由命了。

关于项目的文档
至今,除了官网Github上的README,我还没发现别的说明文档,Nathan推荐了一本专业书,可以参考,书名《Legged Robots That Balance written》,作者Marc H.Raibert,如果有需要,我这里也有电子版本。不过话说回来,罗马不是一天建成的,说不定后面会有不错的文档说明,我也在准备一些说明文档,方便自己,也方便后来者。代码都有了,要啥自行车呀…
如果你有问题,可以随时在google群里发问(当然是英文的),Nathan一般很快就会回复。 https://groups.google.com/forum/#!forum/stanford-quadrupeds

如何以最少的钱最快购买到Pupper?
通常,零售物料价格都是比较贵的,也很难砍价,除非批量,例如舵机零售一个就是三百多。我自己DIY了两个Pupper,算下来总成本超过了一万五人民币。官网说单台的BOM价格在$600~$900之间,如果你不是非常有经验,我估计首台的成本应该不会比我低太多。
我有十多年的软件开发经验(2014年拿到了中国科学院的高级工程师认证),带过研发团队,做过软硬件的产品,目前主要负责公司的机器人产品线,偏向市场了(不务正业了…)。通过DIY这个Pupper产品,我重新体验了一把coding和debug的乐趣,涉及到了软件,硬件,结构,采购,暗自爽了一把。
言归正传,如果你想购买一台玩玩(我个人判断Pupper是目前全球最值得把玩的12自由度的机器狗,最难能可贵的是所有软硬件都开源,代码肯定还有bugs,找到bugs,提给Nathan,显摆下也不错)。你可以给我发邮件(afreez.gan@gmail.com 或 mangdangtec@sina.com ),现在可以¥4999的价格(不含运费)获取一台我组装好的Pupper,国内快递速度,保证你爽歪歪。

FAQ(为了防止歧义,基本保留英文)
所有内容来自https://groups.google.com/forum/#!forum/stanford-quadrupeds
Q1: 如何控制机器狗的行走速度?
A1: You can adjust the frequency of the trot in the config file here: https://github.com/stanfordroboticsclub/StanfordQuadruped/blob/master/pupper/Config.py. Look for the two variables: self.overlap_time and self.swing_time. I unfortunately don't have anything on the dynamics of trotting/walking.

Overlap time refers to the duration which all four feet are on the ground before picking up one pair of legs. Swing_time refers to how long a leg will be in the air per step. One cycle of trot is broken up into four phases: 1) all four feet are on the ground (duration=overlap_time), then 2) one pair of diagonals legs lift up and swing to their next locations (duration=swing_time), then 3) all four feet are on the ground again, and finally 4) the other pair of diagonal legs lift up and move to their next locations. So as you might be able to deduce, one complete cycle of trot takes 2overlap_time + 2swing_time.

If you'd like to slow the trot by 2x, then you can double each of these values to overlap_time=0.2 and swing_time=0.3. However, the robot becomes unstable if the frequency isn't quite right and you'll have to experiment a bit yourself.

We unfortunately don't have a walk implemented since walking is actually tricker to implement than trotting. This is because you're actually more unstable during a walk then a trot since a walk is asymmetric.

Q2: 如果选择舵机?
A2: With regards to choosing a servo, we previously had used the Savox 1260MG which cost quite a bit ($80per) and would overheat very quickly when pupper was just standing. We then switched to the CLS6327HV, which is slightly faster and slightly weaker than the CLS6336 but our first batch of those servos were jittery and were quite noisy. We then bought new CLS6336 and CLS6327 servos, and for some reason (new firmware?), both types were smoother and quieter. In the end we selected the CLS6336 as the official servo in case people wanted to put more payload on the robot. Basically, the main criteria for choosing new motors are 1) they don't over heat 2) can move fast enough to track the swing trajectories correctly and 3) have enough torque to support pupper on 2 feet. For the last requirement, we look for servos with a peak force to weight ratio of at least 4.0 so that when pupper is standing on just 2 feet, it has a T/W ratio of at least 2.0. I haven't tested any servos slower than the CLS6336, but it's possible they'd work too. You might be limited in terms of how fast the robot can walk around.

Q3: 关于IMU
A3: The IMU was previously being used to help stabilize Pupper, but we found that even though our compensation method made the robot walk more smoothly, it also tended to make the robot walk with its body tilted to the side (bug, not a feature) so we ended up scrapping it for the time being. The method that we used was like a chicken-head stabilization type of thing, but instead of stabilizing the head, we stabilized the feet, so that even if the robot was falling over, it would still put its feet correctly on the ground. On top of that, we added a small term to attempt to bring the body back to horizontal, but we couldn't find a satisfactory balance between strong correction and smooth walking.

Q4: 能推荐本专业的书籍吗?
A4: Please refer to <Legged Robots That Balance> by Marc H.Raibert

其它:
目前的构建过程中,需要设定有线网的IP地址,依赖UDPComms,后面为了方便会取消这个限制,但依然会保留PS4控制器,因为控制会比较方便。

链接表