资源描述:
《机器人实训报告7》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、机器人模块拆装实训报告班级:学号:姓名:同组人:一、课程目的(1)锻炼动手能力和团队精神;(2)系统训练创新能力和实践能力;(3)自主建构工科基础知识。二、课程内容1.用AS-U11型机器人红外躲避障碍2.用AS-UII型机器人驱光行走3.用AS-EI型机器人模拟工业抓放机器人三、方案设计1.用AS-UII型机器人红外躲避障碍红外传感器左边检测有信号则向右转,右边检测有信号则向左转碰撞传感器左边有信号则向右后退,右边有信号则向左后退,再前进2.用AS-UII型机器人驱光行走亮度传感器亮度左边高于右边则
2、向左转右边高于左边则向右转3.用AS-EI型机器人模拟工业抓放机器人电动机1正转,轨道上机器人向一边移动反转,轨道上机器人向另一边移动电动机2正转,抓放机械手向下移动反转,抓放机械手向上移动按钮1闭合,磁铁吸取工件按钮1松开,磁铁松放工件四、实验结果1用AS-UII型机器人红外躲避障碍右转y右转■■TI前进intirJ=O;iritbmp_l=O;voidmain(){while(1){ir」=ir_detector():if7irj==4){drive(0,80);wait(0.300000);st
3、op();}else{i£(ir」==2){drive(0,-80);wait(0.300000);stop();}else{if(irj==1){drive(0丿80);wait(0.300000);stop0;}else{drive(80?0);wait(0.000000);stop();}}}bmp_l=bumper();iffbmp」=12){drive(80丿0);wait(0.500000);stop();drive(0丿80):wait(0.300000);stop0;}elseif(b
4、mp.l==1)drive(-80』);wait(0.500000);stop():drive(0,80);wait(0.300000);stop();drive(80?0);wait(0.500000);stop():}elseif(bmp.l==2)drive(-80』);wait(0.500000);stop0;drive(0,-80):);wait(0.300000stop();drive(80?0);wait]0.500000stop():}elsedrive(80?0);wait(0.10
5、0000stop();););2用AS-UII型机器人驱光行走intphoto_l=0;voidmainO{while(1){photo_l二photo(1)-photo(2);i£(photo」==0){_motor(1>60);motor(2»40);}elsephoto_l二photo(1)-photo(2);i£(photo」<0){_motor(1?30):motor(270);}elsephoto」二photo(1)-photo(2);if(photo^l>0)motor(1‘motor(
6、2,9030););else6040););motor(1,motor(2‘}3用AS-EI型机器人模拟工业抓放机器人intmd_l=0;intmcm_l二0;intmcd_l=0;voidmain()while(1)md」=read(0x4000);if7GndJ&Ob10000000)==ObO)mcmj=GncmJ&Obi1111100)
7、Obll;write(0x4000,mcm_l):}■elsemd_l=read(0x4000);if7GndJ&Ob1000000)==ObO)mcmj=O
8、ncmJ&ObllllllOO)
9、Obi;write(0x4000丿elsemd_l=read(0x4000);if!Gnd.l&Ob100000)==ObO)mcmj=GncmJ&ObllllOOll)
10、ObUOO;write(0x4000}■elsemd_l=read(0x4000);if7(nd」&OblOOOO)==ObO){mcmj=GncmJ&ObllllOOll)
11、OblOO;write(0x4000,mcmj);}■elsemd_l=read(0x4000);if7GndJ&Ob100
12、0)==ObO)mcmj=(mcmj&ObllOOllll)
13、Obi10000;write(0x4000』cm」);}■elsemd_l=read(0x4000);if7GndJ&OblOO)二二ObO)mcmj=GncmJ&ObllOOllll)
14、Ob10000;write(0x4000丿mcm」);Q丄{md_l=read(0x4000);if7GndJ&Obi1111100)==ObO){}else{mcm_l=(mem」&Ob11000000);