极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2129|回复: 0

4自由度串联机械臂的制作分享

[复制链接]
发表于 2023-3-7 09:33:47 | 显示全部楼层 |阅读模式
本帖最后由 机器谱 于 2023-3-7 09:33 编辑

1. 运动功能说明
     R204样机是一款拥有4个自由度的串联机械臂。本文示例实现4自由度串联机械臂抓取物品、放下的功能。



2. 结构说明
    R204号样机由4个串联的 舵机关节模组 和1个 舵机夹爪模组 组成。


    为了增加减轻腰关节的负担,在腰关节位置加装了4根拉簧。


3. 运动功能实现
3.1 电子硬件
    在这个示例中,我们采用了以下硬件,请大家参考:

主控板Basra(兼容Arduino Uno)
扩展板Bigfish2.1
电池7.4V锂电池

3.2 编写程序
编程环境:Arduino 1.8.19
编写并烧录以下程序(grab_thing_anwser.ino),该程序将实现演示视频中的动作。
  1. /*------------------------------------------------------------------------------------

  2.   版权说明:Copyright 2023 Robottime(Beijing) Technology Co., Ltd. All Rights Reserved.

  3.            Distributed under MIT license.See file LICENSE for detail or copy at

  4.            https://opensource.org/licenses/MIT

  5.            by 机器谱 2023-02-02 https://www.robotway.com/

  6.   ------------------------------

  7.   实验功能: 实现4自由度串联机械臂抓取物品、放下的功能

  8.   -----------------------------------------------------

  9.   实验接线:舵机接口依次D8、D3、D11、D7、D4                                    

  10. ------------------------------------------------------------------------------------*/

  11. int a=0,b=0,c=0,d=0,e=0,f=0;

  12. #include <Servo.h>

  13. Servo servo_pin_4;

  14. Servo servo_pin_7;

  15. Servo servo_pin_11;

  16. Servo servo_pin_3;

  17. Servo servo_pin_8;

  18. void setup()

  19. {

  20.   servo_pin_4.attach(4);

  21.   servo_pin_4.write( 76);

  22.   servo_pin_7.attach(7);

  23.   servo_pin_7.write( 110);

  24.   servo_pin_11.attach(11);

  25.   servo_pin_11.write(68);

  26.   servo_pin_3.attach(3);

  27.   servo_pin_3.write(157);

  28.   servo_pin_8.attach(8);

  29.   servo_pin_8.write(81);

  30.   delay(3000);//set up the initial posotion.Each servo is different,

  31.               // so u must use Software of Processing to monitor your initial positions of servo.

  32. }

  33. void loop()

  34. {

  35.   int a=76;b=110;c=68;d=157;e=81;

  36.   servo_pin_4.write(a);

  37.   servo_pin_7.write(b);

  38.   servo_pin_11.write(c);

  39.   servo_pin_3.write(d);

  40.   servo_pin_8.write(e);

  41.   //Now begin to move,you can use Processing to record a serials of movements.

  42.   //Here's my records.Aiming to grab a thing and put it back.

  43.   for(e=80;e>=50;e-=1)           

  44.   {servo_pin_8.write(e);delay(30);}  



  45.   for(d=158;d>=62;d-=3)

  46.   {servo_pin_3.write(d);delay(30);}



  47.   for(b=110;b>=19;b-=3)

  48.   {servo_pin_7.write(b); delay(30);}





  49.   for(e=50;e<=80;e+=1)

  50.   {servo_pin_8.write(e);delay(30);}



  51.      for(b=19;b<=110;b+=3)

  52.   {servo_pin_7.write(b);delay(30);}

  53.   delay(3000);



  54.       for(b=110;b>=19;b-=3)

  55.   {servo_pin_7.write(b);delay(30);}



  56.    

  57.   for(e=80;e>=50;e-=1)

  58.   {servo_pin_8.write(e);delay(30);}



  59.    for(b=19;b<=110;b+=3)

  60.   {servo_pin_7.write(b);delay(30);}



  61.     for(d=62;d<=158;d+=3)

  62.   {servo_pin_3.write(d);delay(30);}



  63.     for(e=50;e<=81;e+=1)

  64.   {servo_pin_8.write(e);delay(30);}



  65. }

复制代码

4. 资料下载
​资料内容:
​①【R204】-例程源代码
​②【R204】-样机3D文件
​资料下载地址:https://www.robotway.com/h-col-189.html

想了解更多机器人开源项目资料请关注 机器谱网站 https://www.robotway.com

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-20 16:45 , Processed in 0.051270 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表