技术领域technical field
本发明涉及机械臂控制技术领域,尤其涉及一种机械臂及基于Leap Motion的机械臂控制方法。The invention relates to the technical field of manipulator control, in particular to a manipulator and a Leap Motion-based manipulator control method.
背景技术Background technique
机械臂能模仿人手和臂的某些动作功能,是一种用以按固定程序抓取、搬运物件或操作工具的自动操作装置。机械臂是最早出现的工业机器人,也是最早出现的现代机器人,它可代替人的繁重劳动以实现生产的机械化和自动化,能在有害环境下操作以保护人身安全,因而广泛应用于机械制造、冶金、电子、轻工和原子能等部门。The robotic arm can imitate certain movements and functions of the human hand and arm, and is an automatic operating device used to grab, carry objects or operate tools according to a fixed program. The mechanical arm is the earliest industrial robot and the earliest modern robot. It can replace the heavy labor of people to realize the mechanization and automation of production, and can operate in harmful environments to protect personal safety. Therefore, it is widely used in machinery manufacturing, metallurgy , electronics, light industry and atomic energy and other departments.
机械臂是由执行机构、驱动机构和控制系统组成的,执行机构包括抓取部分(手部)、腕部、臂部和腰部,手部直接与工件接触,一般是回转型或平移型;腕部是连接手部和手臂的部件,用来调整被抓物体的方位;臂部是支撑被抓物体、手部、腕部的重要部件,其作用是带动手部去抓取物体,并按预定要求将其搬运到给定的位置;腰部是支撑臂部,其作用是带动臂部旋转。驱动机构有气动、液动、电动和机械式四种形式,气动式速度快,结构简单,液动式可实现连续控制,使工业机械手的用途和通用性更广,且定位精度较高,因此目前常用的是气动和液动驱动方式。控制系统大多采用的是可编程序控制器,输入程序,机械臂按照编程程序实现搬运或焊接工作。The mechanical arm is composed of an actuator, a drive mechanism and a control system. The actuator includes a grasping part (hand), wrist, arm and waist. The hand is in direct contact with the workpiece, which is generally a rotary or translational type; the wrist The part is the part connecting the hand and the arm, which is used to adjust the orientation of the object to be grasped; the arm part is an important part to support the object to be grasped, the hand and the wrist, and its function is to drive the hand to grasp the object, and to grasp the object according to the predetermined It is required to carry it to a given position; the waist is to support the arm, and its function is to drive the arm to rotate. There are four types of driving mechanism: pneumatic, hydraulic, electric and mechanical. The pneumatic type has fast speed and simple structure, and the hydraulic type can realize continuous control, which makes the industrial manipulator more versatile and versatile, and has higher positioning accuracy. Therefore, Currently commonly used are pneumatic and hydraulic drive. Most of the control system uses a programmable controller, input the program, and the mechanical arm performs the handling or welding work according to the programmed program.
但是,目前机械手臂大多数都是少自由度,而且都是采用电机、液压等输出动力结构与各手指放在一块,通过按钮操作而且移动角度受限,这样无形中加重了手臂的负担,限制了自由度的个数、抓取物品的质量和抓取物品的区域,而且操作起来比较复杂。还有目前大多数工业机器人只适应于特定的产品和工作环境,并且依赖于所提供的专用设备和工具,对于许多任务而言机械手臂的操作是不够的。However, at present, most of the mechanical arms have few degrees of freedom, and they use motors, hydraulic pressure and other output power structures to put together with each finger, and the movement angle is limited by button operation, which invisibly increases the burden on the arm and limits The number of degrees of freedom, the quality of the grasped items and the area of the grasped items are determined, and the operation is more complicated. Also, most of the current industrial robots are only adapted to specific products and working environments, and rely on the special equipment and tools provided. For many tasks, the operation of the mechanical arm is not enough.
发明内容Contents of the invention
本发明提供了一种机械臂及基于Leap Motion的机械臂控制方法,以解决目前机械臂操作复杂、自由度较少的问题。The invention provides a manipulator and a control method of the manipulator based on Leap Motion, so as to solve the problems of complicated operation and few degrees of freedom of the manipulator at present.
第一方面,本发明提供了一种机械臂,该机械臂包括基座、执行机构和主控板,其中:In a first aspect, the present invention provides a mechanical arm, which includes a base, an actuator and a main control board, wherein:
所述执行机构包括底座部件、大臂部件、小臂部件和手腕,所述底座部件固定安装于所述基座上;所述底座部件上对称设置有第一固定支架和第二固定支架,所述大臂部件通过第一关节分别连接所述第一固定支架和第二固定支架;所述小臂部件通过第二关节连接所述大臂部件,所述手腕通过第三关节连接所述小臂部件;The actuator includes a base part, a big arm part, a small arm part and a wrist, and the base part is fixedly mounted on the base; a first fixed bracket and a second fixed bracket are symmetrically arranged on the base part, so that The upper arm part is respectively connected to the first fixed bracket and the second fixed bracket through a first joint; the small arm part is connected to the big arm part through a second joint, and the wrist is connected to the small arm through a third joint part;
所述底座部件上安装有第一舵机,所述第一舵机驱动所述底座部件旋转;所述第一固定支架上安装有第二舵机,所述第二固定支架上安装有第三舵机,所述第二舵机与所述第三舵机驱动所述大臂部件绕所述第一关节转动、所述小臂部件绕所述第二关节转动;A first steering gear is installed on the base part, and the first steering gear drives the base part to rotate; a second steering gear is installed on the first fixing bracket, and a third steering gear is installed on the second fixing bracket. a steering gear, the second steering gear and the third steering gear drive the boom component to rotate around the first joint, and the small arm component to rotate around the second joint;
所述第一舵机、第二舵机与第三舵机分别与所述主控板通信连接。The first steering gear, the second steering gear and the third steering gear are communicated with the main control board respectively.
可选的,所述底座部件包括底座、支撑平台以及位于所述底座与支撑平台之间的旋转机构,所述底座固定安装于所述基座上,所述第一固定支架与第二固定支架分别与所述支撑平台固定连接;所述第一舵机驱动所述旋转机构转动。Optionally, the base component includes a base, a support platform, and a rotation mechanism between the base and the support platform, the base is fixedly mounted on the base, and the first fixed bracket and the second fixed bracket They are respectively fixedly connected with the support platform; the first steering gear drives the rotation mechanism to rotate.
可选的,所述大臂部件包括两个平行设置的大臂,所述大臂靠近所述基座的一端连接所述第一关节;所述第二舵机的主轴穿过所述第一固定支架、所述第三舵机的主轴穿过所述第二固定支架分别与所述第一关节连接;所述大臂远离所述基座的一端连接所述第二关节。Optionally, the boom part includes two parallel booms, one end of the boom close to the base is connected to the first joint; the main shaft of the second steering gear passes through the first The fixed bracket and the main shaft of the third steering gear are respectively connected to the first joint through the second fixed bracket; the end of the boom away from the base is connected to the second joint.
可选的,所述小臂部件包括两个平行设置的小臂,所述小臂连接所述第二关节;Optionally, the forearm component includes two forearms arranged in parallel, and the forearms are connected to the second joint;
所述第一关节上连接有连接板,所述连接板通过第四关节连接有第一连杆,所述第一连杆通过第五关节连接所述小臂。A connecting plate is connected to the first joint, the connecting plate is connected to the first connecting rod through the fourth joint, and the first connecting rod is connected to the forearm through the fifth joint.
可选的,所述手腕通过第六关节连接有横臂,所述横臂通过第七关节连接有三角板,所述三角板连接所述第二关节,所述三角板通过第八关节连接有第二连杆,所述第二连杆活动连接所述第一固定支架。Optionally, the wrist is connected to a cross arm through the sixth joint, the cross arm is connected to a triangular plate through the seventh joint, the triangular plate is connected to the second joint, and the triangular plate is connected to the second joint through the eighth joint. rod, and the second connecting rod is movably connected to the first fixing bracket.
可选的,所述机械臂还包括气嘴和气泵,所述气嘴活动连接所述手腕;所述手腕上设有与所述主控板通信连接的第四舵机,所述第四舵机驱动所述气嘴旋转;所述主控板与气嘴分别连接所述气泵。Optionally, the mechanical arm also includes an air nozzle and an air pump, and the air nozzle is movably connected to the wrist; the wrist is provided with a fourth steering gear that communicates with the main control board, and the fourth steering gear The motor drives the air nozzle to rotate; the main control board and the air nozzle are respectively connected to the air pump.
第二方面,本发明还提供了一种基于Leap Motion的机械臂控制方法,所述方法包括:In a second aspect, the present invention also provides a method for controlling a mechanical arm based on Leap Motion, the method comprising:
Leap Motion设备实时采集手部运动数据,提取所述手部运动数据的特征参数;The Leap Motion device collects hand motion data in real time, and extracts the characteristic parameters of the hand motion data;
根据所述特征参数识别手部运动是否属于平移操作;Identifying whether the hand movement is a translation operation according to the characteristic parameters;
若是,则发送代表机械臂平移的数据信号至所述机械臂主控板,通过所述主控板发出控制信号实现所述机械臂的平移动作;If so, send a data signal representing the translation of the mechanical arm to the main control board of the mechanical arm, and send a control signal through the main control board to realize the translational movement of the mechanical arm;
若否,再继续识别所述手部运动是否属于抓取操作;If not, continue to identify whether the hand movement is a grasping operation;
若是,则发送代表机械臂抓取的数据信号至所述机械臂主控板,通过所述主控板发出控制信号实现所述机械臂的抓取动作。If so, send a data signal representing the grabbing of the robotic arm to the main control board of the robotic arm, and send a control signal through the main control board to realize the grabbing action of the robotic arm.
可选的,所述Leap Motion设备实时采集手部运动数据,提取所述手部运动数据的特征参数,包括:Optionally, the Leap Motion device collects hand motion data in real time, and extracts characteristic parameters of the hand motion data, including:
通过Leap Motion设备建立不同的手势动作,将所述手势动作存储至控制机械臂动作的手势库中;Create different gestures through the Leap Motion device, and store the gestures in the gesture library that controls the movement of the robotic arm;
所述Leap Motion设备实时采集手部运动数据,根据所述手部运动数据提取手掌中心到Leap Motion设备原点的坐标,计算得到手部的偏移角度;The Leap Motion device collects hand motion data in real time, extracts the coordinates of the palm center to the Leap Motion device origin according to the hand motion data, and calculates the offset angle of the hand;
获取手部每个指骨的开始坐标位置和手移动后的坐标位置,计算得到中指和无名指的第一根指骨和第二根指骨之间的夹角;Obtain the starting coordinate position of each phalanx of the hand and the coordinate position after the hand moves, and calculate the angle between the first phalanx and the second phalanx of the middle finger and ring finger;
根据所述夹角识别所述手部的手势,将所述手势与手势库中的手势进行对比。The gesture of the hand is recognized according to the included angle, and the gesture is compared with gestures in a gesture library.
可选的,所述通过Leap Motion设备建立不同的手势动作,包括:Optionally, the establishment of different gestures through the Leap Motion device includes:
Leap Motion设备检测视野范围内的手、手指或工具,并为其赋予一个唯一ID号码作为标记;The Leap Motion device detects a hand, finger or tool within the field of view and assigns it a unique ID number as a tag;
通过Leap Motion设备建立不同的手势动作,包括上、下、左、右、前、后、抓取和松开动作。Create different gestures with Leap Motion devices, including up, down, left, right, forward, backward, grab and release.
可选的,所述Leap Motion设备实时采集手部运动数据,提取所述手部运动数据的特征参数,还包括:Optionally, the Leap Motion device collects hand motion data in real time, extracts characteristic parameters of the hand motion data, and also includes:
所述Leap Motion设备实时采集手部运动数据,根据所述手部运动数据提取手掌坐标值和手偏移翻转角度;The Leap Motion device collects hand motion data in real time, and extracts palm coordinates and hand offset flip angles according to the hand motion data;
将所述手掌坐标值和手偏移翻转角度转换为机械臂的动作参数。The palm coordinate value and the hand offset flip angle are converted into motion parameters of the mechanical arm.
本发明提供的技术方案可以包括以下有益效果:The technical solution provided by the invention may include the following beneficial effects:
本发明提供的机械臂通过第一舵机、第二舵机与第三舵机分别实现底座部件旋转、大臂部件俯仰、小臂部件俯仰等动作,操作简单,易于拆装,能够替代许多传统的设备,按人工控制的要求来抓取、搬运物件或完成相应操作,也可代替繁重的人工劳动来实现生产的机械化和自动化。还有本申请将机械臂与Leap Motion设备相结合,通过Leap Motion设备采集手部运动数据,提取手部运动数据的特征参数,将特征参数转化为机械臂的对应操作指令,之后根据操作指令控制机械臂做出相应的动作,整个操作过程十分流畅并且精确度高,能够摆脱传统机械臂采用按钮等方式控制的不人性化设计,操作简单而且精准度高,可以将人类思维与机器思维结合在一起,能够更好地执行目的任务。The mechanical arm provided by the present invention realizes the rotation of the base part, the pitching of the big arm part, the pitching of the small arm part, etc. through the first steering gear, the second steering gear and the third steering gear respectively. The operation is simple, easy to disassemble and assemble, and can replace many traditional Advanced equipment can grasp, carry objects or complete corresponding operations according to the requirements of manual control, and can also replace heavy manual labor to realize mechanization and automation of production. In addition, this application combines the mechanical arm with the Leap Motion device, collects hand motion data through the Leap Motion device, extracts the characteristic parameters of the hand motion data, converts the characteristic parameters into the corresponding operating instructions of the mechanical arm, and then controls the robot according to the operating instructions. The robotic arm makes corresponding movements. The whole operation process is very smooth and has high precision. It can get rid of the inhumane design of the traditional robotic arm controlled by buttons and other methods. It is easy to operate and has high precision. It can combine human thinking and machine thinking. Together, we can better perform the target tasks.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.
附图说明Description of drawings
为了更清楚地说明本发明的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solution of the present invention more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, on the premise of not paying creative labor, Additional drawings can also be derived from these drawings.
图1为本发明实施例提供的一种机械臂的结构示意图;FIG. 1 is a schematic structural view of a mechanical arm provided by an embodiment of the present invention;
图2为本发明实施例提供的一种机械臂中底座部件的结构示意图;Fig. 2 is a schematic structural diagram of a base part in a mechanical arm provided by an embodiment of the present invention;
图3为本发明实施例提供的一种机械臂中大臂部件与小臂部件的结构示意图;Fig. 3 is a structural schematic diagram of a large arm part and a small arm part in a mechanical arm provided by an embodiment of the present invention;
图4为本发明实施例提供的一种机械臂中腕部的结构示意图;4 is a schematic structural diagram of a wrist in a mechanical arm provided by an embodiment of the present invention;
图5为本发明实施例提供的一种基于Leap Motion的机械臂控制方法的流程图;Fig. 5 is a flow chart of a method for controlling a mechanical arm based on Leap Motion provided by an embodiment of the present invention;
图6为本发明实施例提供的基于Leap Motion的机械臂控制方法的一个实施例的流程图;FIG. 6 is a flowchart of an embodiment of a method for controlling a robotic arm based on Leap Motion provided by an embodiment of the present invention;
图7为本发明实施例提供的基于Leap Motion的机械臂控制方法的另一个实施例的流程图;FIG. 7 is a flow chart of another embodiment of a method for controlling a robotic arm based on Leap Motion provided by an embodiment of the present invention;
图8为本发明实施例提供的机械臂的坐标系示意图;Fig. 8 is a schematic diagram of the coordinate system of the mechanical arm provided by the embodiment of the present invention;
图9为本发明实施例提供的基于Leap Motion的机械臂控制方法中机械臂空间坐标的示意图;9 is a schematic diagram of the space coordinates of the manipulator in the Leap Motion-based manipulator control method provided by the embodiment of the present invention;
图1-图9符号表示:1-基座,2-底座部件,201-底座,202-支撑平台,203-第一舵机,204-第一固定支架,205-第二固定支架,3-大臂,301-第二舵机,302-第三舵机, 4-小臂,5-手腕,501-第四舵机,6-气嘴,7-第一关节,8-第二关节,9-第三关节,10- 连接板,11-第四关节,12-第一连杆,13-第五关节,14-第六关节,15-横臂,16-第七关节,17-三角板,18-第八关节,19-第二连杆,20-主控板,21-支撑板,22-气泵。Figure 1-Figure 9 symbols represent: 1-base, 2-base parts, 201-base, 202-support platform, 203-first steering gear, 204-first fixed bracket, 205-second fixed bracket, 3- Big arm, 301-second steering gear, 302-third steering gear, 4-small arm, 5-wrist, 501-fourth steering gear, 6-air nozzle, 7-first joint, 8-second joint, 9-third joint, 10-connecting plate, 11-fourth joint, 12-first connecting rod, 13-fifth joint, 14-sixth joint, 15-cross arm, 16-seventh joint, 17-triangular plate , 18-eighth joint, 19-second connecting rod, 20-main control board, 21-support plate, 22-air pump.
具体实施方式detailed description
参见图1,为本发明实施例提供的机械臂的结构示意图。Referring to FIG. 1 , it is a schematic structural diagram of a robotic arm provided by an embodiment of the present invention.
如图1所示,本发明实施例提供的机械臂包括基座1、执行机构和主控板20,其中,As shown in FIG. 1 , the mechanical arm provided by the embodiment of the present invention includes a base 1, an actuator and a main control board 20, wherein,
执行机构包括底座部件2、大臂部件、小臂部件和手腕,底座部件2固定安装与基座1上。大臂部件通过第一关节7连接底座部件2,小臂部件通过第二关节8连接大臂部件,手腕5通过第三关节9连接小臂部件。The actuator includes a base part 2 , a big arm part, a small arm part and a wrist, and the base part 2 is fixedly installed on the base 1 . The big arm part is connected to the base part 2 through the first joint 7 , the small arm part is connected to the big arm part through the second joint 8 , and the wrist 5 is connected to the small arm part through the third joint 9 .
基座1可以提高机械臂的稳定性,基座1可以固定于地面上,也可以固定于工作平台上。The base 1 can improve the stability of the mechanical arm, and the base 1 can be fixed on the ground or on a working platform.
底座部件2可以旋转,进而带动大臂部件、小臂部件与手腕5转动,实现整个机械臂的转动。进一步地,底座部件2上安装有第一舵机203,第一舵机203驱动底座部件2 旋转。The base part 2 can rotate, and then drives the big arm part, the small arm part and the wrist 5 to rotate, and realizes the rotation of the whole mechanical arm. Further, a first steering gear 203 is installed on the base part 2 , and the first steering gear 203 drives the base part 2 to rotate.
舵机简单的说就是集成了直流电机、电机控制器和减速器等,并封装在一个便于安装的外壳里的伺服单元,能够利用简单的输入信号比较精确的传动给定角度的电机系统。舵机安装了一个电位器(或其他角度传感器)检测输出轴转动角度,控制板根据电位器的信息能比较精确的控制和保持输出轴的角度。Simply put, the steering gear is a servo unit that integrates a DC motor, a motor controller, and a reducer, and is packaged in an easy-to-install housing. It can use a simple input signal to drive a motor system with a given angle more accurately. The steering gear is equipped with a potentiometer (or other angle sensor) to detect the rotation angle of the output shaft, and the control board can accurately control and maintain the angle of the output shaft according to the information of the potentiometer.
因舵机接受一个简单的控制指令就可以自动转动到一个比较精确的角度,所以非常适合在关节型机器人产品使用。Because the steering gear can automatically rotate to a more precise angle after receiving a simple control command, it is very suitable for use in articulated robot products.
为实现旋转动作,如图2所示,底座部件2包括底座201、支撑平台202以及位于底座201与支撑平台202之间的旋转机构,底座201固定安装于基座1上。旋转机构一般包括旋转盘与轴承,第一舵机203的主轴连接旋转盘与轴承,主轴旋转带动旋转盘与轴承的转动,从而实现底座部件2的旋转。To realize the rotation, as shown in FIG. 2 , the base component 2 includes a base 201 , a support platform 202 and a rotation mechanism between the base 201 and the support platform 202 , and the base 201 is fixedly mounted on the base 1 . The rotating mechanism generally includes a rotating disk and a bearing. The main shaft of the first steering gear 203 is connected to the rotating disk and the bearing.
在具体实施过程中,底座部件2的旋转机构不仅限于旋转盘与轴承,如齿轮驱动旋转、涡轮蜗杆驱动旋转等结构等,其均属于本发明实施例的保护范围。In the specific implementation process, the rotation mechanism of the base part 2 is not limited to the rotating disk and bearings, such as gear-driven rotation, worm-driven rotation and other structures, which all belong to the protection scope of the embodiment of the present invention.
进一步地,底座部件2的回转角度范围一般为360°,也可以根据需要限定底座部件的回转角度,如-60°~240°等,其均属于本发明实施例的保护范围。Furthermore, the rotation angle range of the base part 2 is generally 360°, and the rotation angle of the base part can also be limited as required, such as -60°-240°, etc., which all belong to the protection scope of the embodiment of the present invention.
底座部件2还包括对称设置的第一固定支架204与第二固定支架205,第一固定支架204与第二固定支架205固定连接支撑平台202,起到支撑大臂部件的作用。安装时,第一固定支架204与第二固定支架205均垂直于支撑平台202。The base part 2 also includes a first fixed bracket 204 and a second fixed bracket 205 which are arranged symmetrically. The first fixed bracket 204 and the second fixed bracket 205 are fixedly connected to the support platform 202 to support the boom part. During installation, both the first fixing bracket 204 and the second fixing bracket 205 are perpendicular to the supporting platform 202 .
如图3所示,大臂部件通过第一关节7分别连接第一固定支架204和第二固定支架205,具体地,大臂部件包括两个平行设置的大臂3,大臂3靠近基座1的一端连接第一关节7,即每个大臂3靠近基座1的一端设置通孔,第一关节7穿过每个大臂3的通孔。As shown in Figure 3, the boom part is respectively connected to the first fixed bracket 204 and the second fixed bracket 205 through the first joint 7, specifically, the boom part includes two booms 3 arranged in parallel, and the boom 3 is close to the base One end of 1 is connected to the first joint 7 , that is, a through hole is provided at one end of each arm 3 close to the base 1 , and the first joint 7 passes through the through hole of each arm 3 .
进一步地,第一固定支架204上安装有第二舵机301,第二固定支架205上安装有第三舵机302,第二舵机301的主轴穿过第一固定支架204,第三舵机302的主轴穿过第二固定支架205,且第二舵机301的主轴与第三舵机302的主轴分别与第一关节7连接。即第二舵机301与第三舵机302驱动第一关节7转动,从而带动第一关节7上的大臂3 上下转动,实现大臂3的俯仰动作。Further, the second steering gear 301 is installed on the first fixed bracket 204, the third steering gear 302 is installed on the second fixed bracket 205, the main shaft of the second steering gear 301 passes through the first fixed bracket 204, the third steering gear The main shaft of 302 passes through the second fixed bracket 205 , and the main shafts of the second steering gear 301 and the third steering gear 302 are respectively connected with the first joint 7 . That is, the second steering gear 301 and the third steering gear 302 drive the first joint 7 to rotate, thereby driving the boom 3 on the first joint 7 to rotate up and down, so as to realize the pitching motion of the boom 3 .
进一步地,小臂部件包括两个平行设置的小臂4,小臂4与大臂3通过第二关节8 连接,即大臂3与小臂4呈一定角度设置。Further, the small arm component includes two small arms 4 arranged in parallel, and the small arms 4 and the large arm 3 are connected through the second joint 8 , that is, the large arms 3 and the small arms 4 are arranged at a certain angle.
为实现小臂4的俯仰动作,第一关节7上连接有连接板10,连接板10位于第二固定支架205与大臂3之间,且第一关节7穿过连接板10的一端,连接板10的另一端连接第四关节11,第四关节11上还连接有第一连杆12,即连接板10与第一连杆12通过第四关节11连接。第一连杆12远离第四关节11的一端连接第五关节13,第五关节13 穿过小臂4靠近第二关节8的一端,即小臂4与第一连杆12通过第五关节13连接。In order to realize the pitching action of the forearm 4, the connecting plate 10 is connected to the first joint 7, the connecting plate 10 is located between the second fixed bracket 205 and the big arm 3, and the first joint 7 passes through one end of the connecting plate 10, and is connected to The other end of the plate 10 is connected to the fourth joint 11 , and the first connecting rod 12 is also connected to the fourth joint 11 , that is, the connecting plate 10 and the first connecting rod 12 are connected through the fourth joint 11 . The end of the first connecting rod 12 away from the fourth joint 11 is connected to the fifth joint 13, and the fifth joint 13 passes through the end of the forearm 4 close to the second joint 8, that is, the forearm 4 and the first connecting rod 12 pass through the fifth joint 13 connect.
动作时,第二舵机301与第三舵机302驱动第一关节7转动,第一关节7带动连接板10转动,连接板10带动第一连杆12转动,第一连杆12带动小臂4转动,从而实现小臂4的俯仰动作。When in action, the second steering gear 301 and the third steering gear 302 drive the first joint 7 to rotate, the first joint 7 drives the connecting plate 10 to rotate, the connecting plate 10 drives the first connecting rod 12 to rotate, and the first connecting rod 12 drives the forearm 4 to rotate, thereby realizing the pitching action of the forearm 4.
第二舵机301与第三舵机302驱动大臂3与小臂4协作动作,大臂3与小臂4的俯仰角度范围可以根据需要进行限定,如大臂3的俯仰角度范围为225°~345°,小臂4 的俯仰角度范围为180°~270°,其均属于本发明实施例的保护范围。The second steering gear 301 and the third steering gear 302 drive the boom 3 and the forearm 4 to cooperate, and the pitch angle range of the boom 3 and the forearm 4 can be limited as required, such as the pitch angle range of the boom 3 is 225° ~345°, and the range of the pitch angle of the arm 4 is 180°~270°, which all belong to the protection scope of the embodiment of the present invention.
如图4所示,手腕5通过第三关节9连接小臂4,小臂4可绕第三关节9转动,而手腕5不可转动。为实现这一目的,手腕5通过第六关节14连接有横臂15,横臂15通过第七关节16连接有三角板17,三角板17的一角连接第二关节8,三角板17的一角通过第八关节18连接有第二连杆19,第二连杆19活动连接第一固定支架204。As shown in FIG. 4 , the wrist 5 is connected to the forearm 4 through the third joint 9 , the forearm 4 can rotate around the third joint 9 , but the wrist 5 cannot rotate. For realizing this purpose, wrist 5 is connected with cross arm 15 by sixth joint 14, and cross arm 15 is connected with triangular plate 17 by seventh joint 16, and a corner of triangular plate 17 connects second joint 8, and a corner of triangular plate 17 passes eighth joint 18 is connected with a second connecting rod 19, and the second connecting rod 19 is movably connected with the first fixing bracket 204.
动作时,第二舵机301与第三舵机302驱动第一关节7转动,第一关节7带动大臂 3上下转动,间接地带动小臂4上下转动,小臂4转动带动三角板17转动,三角板17 分别带动横臂15、第二连杆19转动,而第二连杆19起支撑作用,因此三角板17与横臂15支撑手腕5保持不动,从而使得小臂4绕第三关节9转动。When in action, the second steering gear 301 and the third steering gear 302 drive the first joint 7 to rotate, the first joint 7 drives the upper arm 3 to rotate up and down, and indirectly drives the forearm 4 to rotate up and down, and the rotation of the forearm 4 drives the triangular plate 17 to rotate. The triangular plate 17 respectively drives the cross arm 15 and the second connecting rod 19 to rotate, and the second connecting rod 19 plays a supporting role, so the triangular plate 17 and the cross arm 15 support the wrist 5 to keep still, so that the forearm 4 rotates around the third joint 9 .
进一步地,第一舵机203、第二舵机301与第三舵机302分别与主控板20通信连接,即主控板20向第一舵机203、第二舵机301或第三舵机302发送控制指令,第一舵机203、第二舵机301与第三舵机302即可精确控制底座部件2的转动角度、大臂3的俯仰角度与小臂4的俯仰角度,实现机械臂的搬运或焊接动作。Further, the first steering gear 203, the second steering gear 301 and the third steering gear 302 are respectively connected to the main control board 20 in communication, that is, the main control board 20 communicates with the first steering gear 203, the second steering gear 301 or the third steering gear The machine 302 sends control instructions, and the first steering gear 203, the second steering gear 301 and the third steering gear 302 can precisely control the rotation angle of the base part 2, the pitch angle of the big arm 3 and the pitch angle of the small arm 4, and realize mechanical Arm handling or welding actions.
进一步地,为方便主控板20的安装,机械臂还包括支撑板21,支撑板21固定安装于底座部件2的支撑平台202上,而主控板20安装于支撑板21上。Further, in order to facilitate the installation of the main control board 20 , the mechanical arm further includes a support plate 21 , the support plate 21 is fixedly installed on the support platform 202 of the base part 2 , and the main control board 20 is installed on the support plate 21 .
进一步地,机械臂还包括气嘴6和气泵22,气嘴6活动连接手腕5,其气嘴6可旋转动作。为实现这一目的,手腕5上设有与主控板20通信连接的第四舵机501,第四舵机501驱动气嘴6旋转。Further, the mechanical arm also includes an air nozzle 6 and an air pump 22, the air nozzle 6 is movably connected to the wrist 5, and the air nozzle 6 can rotate. To achieve this purpose, the wrist 5 is provided with a fourth steering gear 501 communicatively connected with the main control board 20 , and the fourth steering gear 501 drives the air nozzle 6 to rotate.
气嘴6与气泵22连接,气泵22通过电力或手力不停压缩空气,产生气压,气压促使气嘴6产生吸力,从而吸住物体表面,用于搬运物体。当气压较高时,气嘴6吸力较大,吸住物体;当气压较低时,气嘴6吸力较低,松开物体。The air nozzle 6 is connected with the air pump 22, and the air pump 22 continuously compresses the air through electric power or manual force to generate air pressure, and the air pressure prompts the air nozzle 6 to generate suction, thereby sucking the surface of the object for transporting the object. When the air pressure is high, the suction force of the air nozzle 6 is relatively large to hold the object; when the air pressure is low, the suction force of the air nozzle 6 is low to release the object.
为实现气泵22的控制,气泵22与主控板20连接,主控板20向气泵22发送控制指令,气泵22根据控制指令控制气嘴6的吸/放。优选的,气泵22安装于支撑板21上。In order to realize the control of the air pump 22, the air pump 22 is connected with the main control board 20, and the main control board 20 sends a control command to the air pump 22, and the air pump 22 controls the suction/release of the air nozzle 6 according to the control command. Preferably, the air pump 22 is installed on the support plate 21 .
进一步地,与手腕5连接的不仅限于气嘴6,如机械爪、吸盘等结构,其均属于本发明的保护范围。Furthermore, the connection with the wrist 5 is not limited to the air nozzle 6, such as mechanical claws, suction cups and other structures, which all belong to the protection scope of the present invention.
进一步地,主控板20发送的控制指令可以是编写的程序,机械臂连接电源,通过microUSB连接PC端,在PC端打开机械臂控制软件,进行在线编程,根据需求对机械臂进行编程,以完成相应的动作;也可以通过WIFI模块实现无限远程操控,利用C标准库 Socket,通过TCP/IP协议调用笔记本的WIFI,与WIFI模块进行通讯,WIFI模块将接收到的数据直接传输给单片机stm32做进一步处理,通过手机端连接机械臂,通过手机端不同动作序号按钮让机械臂执行相应的动作;也可以将Leap Motion连接到电脑上,通过安装Leap MotionController上位机,在执行模式或者实时模式下,控制机械臂模仿完成相应动作。Further, the control command sent by the main control board 20 can be a written program, the robotic arm is connected to the power supply, connected to the PC via microUSB, and the robotic arm control software is opened on the PC to perform online programming. Complete the corresponding actions; you can also realize unlimited remote control through the WIFI module, use the C standard library Socket, call the WIFI of the notebook through the TCP/IP protocol, and communicate with the WIFI module, and the WIFI module will directly transmit the received data to the single-chip stm32 to do For further processing, connect the robotic arm through the mobile phone, and let the robotic arm perform corresponding actions through the buttons of different action numbers on the mobile phone; you can also connect the Leap Motion to the computer, and install the Leap MotionController host computer in the execution mode or real-time mode. Control the mechanical arm to imitate and complete the corresponding actions.
本申请提供的机械臂在工作时,主控板20分别向第一舵机203、第二舵机301、第三舵机302、第四舵机501与气泵22发送控制指令,第一舵机203根据控制指令驱动底座部件2旋转,实现整个机械臂的旋转,第二舵机301与第二舵机302根据控制指令驱动大臂3绕第一关节7转动、小臂4绕第二关节8转动、小臂4绕第三关节9转动,第四舵机501根据控制指令驱动气嘴6转动,气泵22根据控制指令驱动气嘴6吸/放,在各个执行机构的配合下,实现机械臂的前后、左右、上下移动,完成物体的搬运工作。When the mechanical arm provided by this application is working, the main control board 20 sends control commands to the first steering gear 203, the second steering gear 301, the third steering gear 302, the fourth steering gear 501 and the air pump 22 respectively, and the first steering gear 203 drives the base part 2 to rotate according to the control command to realize the rotation of the entire mechanical arm. The second steering gear 301 and the second steering gear 302 drive the big arm 3 to rotate around the first joint 7 and the small arm 4 around the second joint 8 according to the control command. Rotation, the forearm 4 rotates around the third joint 9, the fourth steering gear 501 drives the air nozzle 6 to rotate according to the control command, and the air pump 22 drives the air nozzle 6 to suck/release according to the control command. With the cooperation of various actuators, the mechanical arm Move back and forth, left and right, up and down to complete the handling of objects.
从上述实施例可以看出,本发明实施例提供的机械臂包括基座、执行机构和主控板,其中,执行机构包括底座部件、大臂部件、小臂部件和手腕,底座部件固定安装于基座上,大臂部件通过第一关节连接底座部件,小臂部件通过第二关节连接大臂部件,手腕通过第三关节连接小臂部件;机械臂还包括第一舵机、第二舵机和第三舵机,主控板分别向第一舵机、第二舵机与第三舵机发送控制指令,第一舵机用于驱动底座部件旋转,第二舵机与第三舵机用于驱动大臂部件绕第一关节转动、小臂部件绕第二关节转动、小臂部件绕第三关节转动;机械臂还包括气嘴与气泵,气嘴与手腕连接,手腕上设有第四舵机,主控板分别向第四舵机与气泵发送控制指令,第四舵机用于驱动气嘴旋转,气泵用于控制气嘴的吸/放;机械臂在执行机构、主控板等结构的协同作用下,完成机械臂的前后、左右、上下动作,从而完成物体的搬运。本申请提供的机械臂通过第一舵机、第二舵机与第三舵机分别实现底座部件旋转、大臂部件俯仰、小臂部件俯仰等动作,通过主控板发送控制指令即可实现机械臂的搬运或焊接工作。还有本申请减少了驱动机构(舵机)的数量,使得机械臂的结构更简单,操作更简单。It can be seen from the above embodiments that the mechanical arm provided by the embodiment of the present invention includes a base, an actuator and a main control board, wherein the actuator includes a base part, a large arm part, a small arm part and a wrist, and the base part is fixedly installed on On the base, the upper arm part is connected to the base part through the first joint, the lower arm part is connected to the upper arm part through the second joint, and the wrist is connected to the lower arm part through the third joint; the mechanical arm also includes a first steering gear and a second steering gear and the third steering gear, the main control board sends control commands to the first steering gear, the second steering gear and the third steering gear respectively, the first steering gear is used to drive the base components to rotate, the second steering gear and the third steering gear are used It is used to drive the upper arm part to rotate around the first joint, the small arm part to rotate around the second joint, and the small arm part to rotate around the third joint; the mechanical arm also includes an air nozzle and an air pump, the air nozzle is connected to the wrist, and a fourth The steering gear and the main control board send control commands to the fourth steering gear and the air pump respectively. The fourth steering gear is used to drive the air nozzle to rotate, and the air pump is used to control the suction/release of the air nozzle; the mechanical arm is connected to the actuator, the main control board, etc. Under the synergistic effect of the structure, the front and back, left and right, up and down movements of the robotic arm are completed, thereby completing the handling of objects. The mechanical arm provided by this application realizes the rotation of the base part, the pitch of the big arm part, and the pitch of the small arm part through the first steering gear, the second steering gear and the third steering gear respectively, and the mechanical arm can be realized by sending control commands through the main control board. Arm handling or welding work. In addition, the present application reduces the quantity of the driving mechanism (steering gear), so that the structure of the mechanical arm is simpler and the operation is simpler.
基于本发明实施例提供的机械臂,本发明实施例还提供了一种基于Leap Motion的机械臂控制方法。Based on the robotic arm provided by the embodiment of the present invention, the embodiment of the present invention also provides a method for controlling the robotic arm based on Leap Motion.
实施例一Embodiment one
参见图5,为本发明实施例提供的一种基于Leap Motion的机械臂控制方法的流程图,该方法包括如下步骤:Referring to FIG. 5 , it is a flow chart of a Leap Motion-based robotic arm control method provided by an embodiment of the present invention. The method includes the following steps:
S100:Leap Motion设备实时采集手部运动数据,提取所述手部运动数据的特征参数。S100: The Leap Motion device collects hand motion data in real time, and extracts characteristic parameters of the hand motion data.
Leap Motion是面向PC以及Mac的体感控制器,可以检测并跟踪手、手指和类似手指个工具,它可以在高精确度和高跟踪帧率下工作,采用红外滤镜,抗干扰能力强。LeapMotion识别手、手指和工具,可以实时获取它们的位置、手势和动作。Leap Motion的可视范围是一个倒金字塔,塔尖在设备中心,Leap Motion的可工作范围大约在设备前方的25到600毫米,也就是1英寸到2英寸,弥补了市面上一些传感器近距离识别度差的不足。Leap Motion is a somatosensory controller for PC and Mac. It can detect and track hands, fingers and similar tools. It can work with high precision and high tracking frame rate. It uses infrared filters and has strong anti-interference ability. LeapMotion recognizes hands, fingers, and tools and can capture their positions, gestures, and movements in real time. The visual range of Leap Motion is an inverted pyramid, with the tip of the tower in the center of the device. The working range of Leap Motion is about 25 to 600 mm in front of the device, that is, 1 inch to 2 inches, which makes up for the short-range recognition of some sensors on the market. Insufficient degree.
通过Leap Motion设备实时采集手部运动数据,提取手部运动数据的特征参数的具体步骤如图6所示。The specific steps of collecting hand motion data in real time through the Leap Motion device and extracting the characteristic parameters of the hand motion data are shown in Figure 6.
S1011:通过Leap Motion设备建立不同的手势动作,将所述手势动作存储至控制机械臂运动的手势库中。S1011: Create different gesture actions through the Leap Motion device, and store the gesture actions in a gesture library for controlling the movement of the mechanical arm.
Leap Motion通过绑定视野范围内的手、手指或者工具来提供实时数据,这些数据多数是通过集合或者帧数据提供,每一帧都包含了一系列的基本绑定数据,比如手、手指或者工具的数据,当然,它也能实时的识别场景中的手势和自定义数据。Leap Motion provides real-time data by binding hands, fingers or tools within the field of view. Most of these data are provided through collection or frame data. Each frame contains a series of basic binding data, such as hands, fingers or tools. Of course, it can also recognize gestures and custom data in the scene in real time.
当设备检测到手、手指、工具或者手势的话,设备会赋予它一个唯一的ID号码作为标记,只要这个实体不出设备的可视区域,这个ID号就会一直不变,如果设备丢失这个实体之后又出现了,Leap就会赋予它一个新的ID号码,但是软件不会知道这个和以前的那个实体有什么关系。When the device detects a hand, finger, tool or gesture, the device will give it a unique ID number as a mark. As long as the entity does not leave the visible area of the device, the ID number will remain unchanged. If the device loses the entity Appears again, and Leap will assign it a new ID number, but the software won't know how this relates to the previous entity.
在Leap Motion中单独的绑定了手和手指,在每一帧中,为手和每个手指分别赋予一个ID号与物体关联起来,并在新的帧里面找到它,通过使用Frame.Hand(),Frame.Finger(),Frame.Tool(),Frame.Gesture()方法函数,如果在当前的帧里面存在的话,这些方法函数返回相应的对象的引用。如果这个对象不再存在了,一个特殊的无效对象就会被返回。无效对象被很好的定义供你使用,但是不存在有效的绑定数据。这项技术帮助我们减少了空对象检测的工作。In Leap Motion, the hand and fingers are bound separately. In each frame, an ID number is assigned to the hand and each finger to associate with the object, and to find it in a new frame, by using Frame.Hand( ), Frame.Finger(), Frame.Tool(), Frame.Gesture() method functions, if they exist in the current frame, these method functions return the reference of the corresponding object. If the object no longer exists, a special invalid object is returned. Invalid objects are well defined for your use, but no valid binding data exists. This technique helps us reduce the effort of empty object detection.
一个Frame的对象提供了绑定数据,手势和元素的列表,这些数据用来描述设备视野内观察到整体的动作。设备响应在frame中观察到的手势和相应手指绑定数据应是一样的。对于每一个观察到的手势,设备就会在frame中放置一个Gesture对象。如果这个手势持续到结束时间。Leap就对在随后的Frame里面更新这个Gesture对象。A Frame object provides bound data, a list of gestures and elements that describe the overall movement observed within the device's field of view. The device responds to the gestures observed in the frame and the corresponding finger binding data should be the same. For each observed gesture, the device places a Gesture object in the frame. If this gesture continues until the end time. Leap will update the Gesture object in the subsequent Frame.
数据绑定列表中包含:Hands--所有的手,Fingers--所有的手指,Tools--所有的工具,Gestures--所有的手势(包括开始、结束或者在进行中的)。The data binding list includes: Hands--all hands, Fingers--all fingers, Tools--all tools, Gestures--all gestures (including start, end, or ongoing).
Hand对象提供了几个属性来反映绑定后的手的物理特性。The Hand object provides several properties to reflect the physics of the bound hand.
Direction:一个向量从手掌指向指尖的单位方向向量。Direction: A unit direction vector pointing from the palm to the fingertip.
Palm position:手掌中心到Leap设备原点以毫米测量的距离。Palm position: The distance measured in millimeters from the center of the palm to the origin of the Leap device.
Length:这个可以被看见的物体的长度。(从手里到手指指尖)Length: The length of the object that can be seen. (from hand to fingertips)
Width:可视物体的平均宽度。Width: The average width of visible objects.
Leap Motion能够分析在场景中较早帧中的整体动画,并且综合典型的移动旋转和缩放因素。比如,如果你将手向左移动,并保证在Leap的视野里面,在帧中包含了移动的信息。如果你弯曲你的手就像旋转一个球,在帧里面就包含旋转的信息。如果你移动手相对或者相向移动,那么在帧中就包含了缩放的信息。Leap设备对于动画的分析基于在视野中的所有物体,如果有一个手在其中的话,那么就会基于这一个手的因素来分析。帧动画的产生是通过当前的帧与更早的帧的比较获得的。描述动画合成的属性包括:你可以直接添加动画因素来操作这些物体,而不需要绑定个人的数据。Leap Motion analyzes the overall animation in earlier frames in the scene and factors in typical movement rotation and scaling. For example, if you move your hand to the left and keep it in Leap's field of view, the frame contains information about the movement. If you bend your hand like you're spinning a ball, the frame contains information about the rotation. If you move your hands relative to each other or towards each other, the scaling information is included in the frame. The Leap device's analysis of the animation is based on all objects in the field of view. If there is a hand in it, it will be analyzed based on the factor of this hand. Frame animation is generated by comparing the current frame with earlier frames. Properties that describe animation composition include: You can directly add animation factors to manipulate these objects without binding personal data.
Leap Motion设备检测视野范围内的手、手指或工具,并为其赋予一个唯一ID号码作为标记,通过Leap Motion建立不同的手势动作,如简单的“剪刀”、“石头”、“步”等手势,这些手势代表上、下、左、右、前、后、抓取和松开动作,并将这些手势动作存储至手势库中。The Leap Motion device detects hands, fingers or tools within the field of vision, and assigns them a unique ID number as a mark, and establishes different gestures through Leap Motion, such as simple gestures such as "scissors", "rock", and "step" , these gestures represent up, down, left, right, forward, backward, grab and release actions, and store these gesture actions in the gesture library.
S1012:所述Leap Motion设备实时采集手部运动数据,根据所述手部运动数据提取手掌中心到Leap Motion设备原点的坐标,计算得到手部的偏移角度。S1012: The Leap Motion device collects hand motion data in real time, extracts the coordinates from the center of the palm to the origin of the Leap Motion device according to the hand motion data, and calculates an offset angle of the hand.
当手置于Leap Motion上方约40-500mm处,设备会赋予手一个唯一的ID号(Handid) 作为标记。操作人员在Leap Motion上方作出不同的手势动作,通过Palm position()函数方法返回手掌中心到Leap设备原点的坐标,通过算法计算出手的偏移角度。When the hand is placed about 40-500mm above the Leap Motion, the device will give the hand a unique ID number (Handid) as a mark. The operator makes different gestures on the Leap Motion, returns the coordinates from the center of the palm to the origin of the Leap device through the Palm position() function method, and calculates the offset angle of the hand through the algorithm.
S1013:获取手部每个指骨的开始坐标位置和手移动后的坐标位置,计算得到中指和无名指的第一根指骨和第二根指骨之间的夹角。S1013: Obtain the starting coordinate position of each phalanx of the hand and the coordinate position after the hand moves, and calculate the angle between the first phalanx and the second phalanx of the middle finger and ring finger.
根据Leap Motion采集的手部运动数据计算得到中指和无名指的第一根指骨和第二根指骨之间的夹角,3.14即表示180度。观察一下石头、剪刀、步三个手势,不难看出只需判断这两个角即可区分。According to the hand motion data collected by Leap Motion, the angle between the first phalanx and the second phalanx of the middle finger and ring finger is calculated, and 3.14 means 180 degrees. Looking at the three gestures of rock, scissors, and step, it is not difficult to see that it is only necessary to judge these two corners to distinguish them.
S1014:根据所述夹角识别所述手部的手势,将所述手势与手势库中的手势进行对比。S1014: Recognize the gesture of the hand according to the included angle, and compare the gesture with gestures in a gesture library.
根据中指和无名指的第一根指骨和第二根指骨之间的夹角识别出手部运动代表的手势,查询手势库中是否拥有与其相同的手势,若手势与手势库中的手势相同,则可按照手势库中的手势对应的操作执行机械臂相应的操作。According to the angle between the first phalanx and the second phalanx of the middle finger and the ring finger, the gesture represented by the hand movement is recognized, and the gesture library is checked to see if there is the same gesture. If the gesture is the same as the gesture in the gesture library, you can Perform the corresponding operations of the robotic arm according to the operations corresponding to the gestures in the gesture library.
S200:根据所述特征参数识别手部运动是否属于平移操作。S200: Identify whether the hand movement belongs to a translation operation according to the characteristic parameters.
手势库中的手势有代表机械臂进行上、下、左、右、前、后平移的手势和代表机械臂抓取和松开的手势,将采集到的手势与手势库中的手势进行对比,判断该手势是代表平移操作的手势还是抓取操作的手势。The gestures in the gesture library include gestures representing the up, down, left, right, front and back translation of the robotic arm and gestures representing the grabbing and releasing of the robotic arm. Compare the collected gestures with the gestures in the gesture library. Determines whether the gesture represents a pan gesture or a grab gesture.
S300:若是,则发送代表机械臂平移的数据信号至所述机械臂主控板,通过所述主控板发出控制信号实现所述机械臂的平移动作。S300: If yes, send a data signal representing the translation of the mechanical arm to the main control board of the mechanical arm, and send a control signal through the main control board to realize the translational movement of the mechanical arm.
若Leap Motion采集的手势代表平移操作的手势,如“步”手势,则PC端向机械臂主控板发送代表机械臂平移的数据信号,该数据信号包括大臂、小臂的移动距离、角度及方向等信息,通过主控板发出控制信号实现机械臂的平移动作。If the gesture collected by Leap Motion represents the gesture of translation operation, such as the "step" gesture, then the PC sends a data signal representing the translation of the robot arm to the main control board of the robot arm. The data signal includes the moving distance and angle of the big arm and the small arm And direction and other information, the control signal is sent through the main control board to realize the translational movement of the mechanical arm.
S400:若否,再继续识别所述手部运动是否属于抓取操作。S400: If not, continue to identify whether the hand movement is a grasping operation.
当Leap Motion采集的手势与手势库中代表平移操作的手势不一致时,再继续判断该手势是否与手势库中代表抓取操作的手势一致,用于实现机械臂的旋转动作。When the gesture collected by Leap Motion is inconsistent with the gesture representing the translation operation in the gesture library, continue to judge whether the gesture is consistent with the gesture representing the grasping operation in the gesture library to realize the rotation of the robotic arm.
S500:若是,则发送代表机械臂抓取的数据信号至所述机械臂主控板,通过所述主控板发出控制信号实现所述机械臂的抓取动作。S500: If yes, send a data signal representing the grabbing of the robotic arm to the main control board of the robotic arm, and send a control signal through the main control board to realize the grabbing action of the robotic arm.
当Leap Motion采集的手势与手势库中代表抓取操作的手势一致,如“石头”手势,则PC端向机械臂主控板发送代表机械臂抓取的数据信号,该数据信号包括气泵的高压、低压等信息,气泵控制吸嘴的吸、放,从而实现机械臂的抓取动作。When the gesture collected by Leap Motion is consistent with the gesture representing the grasping operation in the gesture library, such as the "stone" gesture, the PC sends a data signal representing the grasping of the robotic arm to the main control board of the robotic arm. The data signal includes the high pressure of the air pump , low pressure and other information, the air pump controls the suction and release of the suction nozzle, so as to realize the grabbing action of the robotic arm.
实施例二Embodiment two
参见图7,为本发明实施例提供的一种基于Leap Motion的机械臂控制方法的另一实施例的流程图。Referring to FIG. 7 , it is a flow chart of another embodiment of a method for controlling a robotic arm based on Leap Motion provided by an embodiment of the present invention.
本发明实施例提供的基于Leap Motion的机械臂控制方法包括如下步骤:The method for controlling the mechanical arm based on Leap Motion provided by the embodiment of the present invention includes the following steps:
S100:Leap Motion设备实时采集手部运动数据,提取所述手部运动数据的特征参数。S100: The Leap Motion device collects hand motion data in real time, and extracts characteristic parameters of the hand motion data.
S1021:所述Leap Motion设备实时采集手部运动数据,根据所述手部运动数据提取手掌坐标值和手偏移翻转角度。S1021: The Leap Motion device collects hand motion data in real time, and extracts palm coordinates and hand offset flip angles according to the hand motion data.
S1022:将所述手掌坐标值和手偏移翻转角度转换为机械臂的动作参数。S1022: Convert the palm coordinate value and hand offset flip angle into motion parameters of the robotic arm.
基于Leap Motion来确定机械臂的空间位置,由于Leap Motion具有强大的手势数据捕获能力,它可以检测到包括手掌、手腕、小臂等部位的空间精确数据,在良好环境下精确度甚至可以逼近手指,利用它检测返回的空间坐标、旋转角度等数据,可以实现对机械臂的仿真控制,因此,我们不采用传统的机器人空间运动学方法——DH坐标建立法,而采用一种相对简捷的方法。如图8、图9所示,我们将以+Z方向作为机械臂所处基坐标系的向前方向,+Y方向作为机械臂所处基坐标系的向上方向,+X方向作为机械臂所处基坐标系的向右方向。The spatial position of the robotic arm is determined based on Leap Motion. Because Leap Motion has powerful gesture data capture capabilities, it can detect spatially accurate data including palms, wrists, forearms, etc., and the accuracy can even approach fingers in a good environment. , using it to detect the returned space coordinates, rotation angle and other data, can realize the simulation control of the manipulator. Therefore, we do not use the traditional robot space kinematics method - DH coordinate establishment method, but adopt a relatively simple method . As shown in Figure 8 and Figure 9, we will use the +Z direction as the forward direction of the base coordinate system where the manipulator is located, the +Y direction as the upward direction of the base coordinate system where the manipulator is located, and the +X direction as the direction of the manipulator. The right direction of the base coordinate system.
设该作品返回的空间坐标为(x,y,z),大臂和小臂的长度分别为11、12,底座舵机、大臂舵机和小臂舵机的旋转角度分别为a1、a2、a3,手腕离坐标原点的距离为r,根据坐标图不难列出以下等式:Suppose the space coordinates returned by the work are (x, y, z), the lengths of the upper arm and the forearm are 11 and 12 respectively, and the rotation angles of the base servo, the boom servo and the forearm servo are a1 and a2 respectively , a3, the distance from the wrist to the coordinate origin is r, it is not difficult to list the following equations according to the coordinate diagram:
r2=x2+y2+z2r2 =x2 +y2 +z2
l1+r2-l22=2l1rcosb1l1 +r2 -l22 =2l1 rcosb1
l12+l22-r2=2l1l2cosb2l12 +l22 -r2 =2l1 l2 cosb2
α3+b2=πα3 +b2 =π
其中,b1和b2是以大臂和小臂为邻边所围成三角形的两个内角,解以上等式,得到:Among them, b1 and b2 are the two interior angles of the triangle surrounded by the big arm and the small arm as the adjacent sides. Solve the above equation to get:
以上是检测到z﹥0的情况,当z﹤0时,只要将求得的α2值取反即可。The above is the case where z>0 is detected. When z<0, just reverse the obtained α2 value.
根据Leap Motion设备采集的手部运动数据,提取得到手掌坐标值和手偏移翻转角度,根据手掌坐标值和手偏移翻转角度计算得到大臂、小臂、转轴的移动位置和方向,手指的角度控制吸嘴的吸放。According to the hand movement data collected by the Leap Motion device, extract the palm coordinates and hand offset flip angle, and calculate the moving position and direction of the big arm, forearm, and rotating shaft according to the palm coordinates and hand offset flip angle, and the movement position and direction of the fingers. The angle controls the suction and discharge of the nozzle.
本发明实施例的其他方法步骤与实施例一的方法步骤相同,此处不再赘述。Other method steps in this embodiment of the present invention are the same as those in Embodiment 1, and will not be repeated here.
通过Leap Motion模仿手指动作控制机械臂动作主要有两种实现方式,一种是PC端,在PC端操作机械臂时,机器人的Flash中已经存储有录制过的机械臂动作,在串口设置完握手成功后,可直接选中要执行“机器内动作列表“内的指令,控制软件除了可以完成单条指令的循环执行,还可以将多条指令添加到循环指令列表,完成多条指令的循环执行,这样就可以通过编程使机械臂实现码垛、装箱、分拣等操作。同时机械臂还可以进行多点连续动作生成。There are two main ways to control the movement of the robotic arm by imitating finger movements through Leap Motion. One is the PC side. When operating the robotic arm on the PC side, the recorded robotic arm movement has been stored in the robot’s Flash, and the handshake is set on the serial port. After success, you can directly select the instruction to be executed in the "machine action list". In addition to completing the cyclic execution of a single instruction, the control software can also add multiple instructions to the cyclic instruction list to complete the cyclic execution of multiple instructions. It is possible to enable the robotic arm to perform operations such as palletizing, packing, and sorting through programming. At the same time, the robotic arm can also perform multi-point continuous motion generation.
另一种是手机端,在手机端的控制界面上,可以选择点击动作序号按钮,让机械臂执行相应的动作,也可以在输入框中手动输入动作序号,然后点击“执行”按钮,即可让机械臂执行相应的动作。从而使不会编程的人也可以使用此机械臂,感受机械臂带来的便捷和乐趣。通过手机端连接机械臂有两种模式可以选择,如下所述:The other is the mobile phone terminal. On the control interface of the mobile terminal, you can choose to click the action number button to let the robot arm perform the corresponding action, or you can manually enter the action number in the input box, and then click the "Execute" button to let the robot arm perform the corresponding action. The robotic arm performs the corresponding action. So that people who do not know how to program can also use this robotic arm to experience the convenience and fun brought by the robotic arm. There are two modes to choose from when connecting to the robotic arm through the mobile phone, as follows:
(1)AP模式(1) AP mode
AP模式,即机械臂开放一个wifi的热点,使用者通过android设备连接到这个热点上。机械臂接通电源,功能指示灯蓝绿闪烁,等待一段时间后指示灯处于蓝色状态,此时,机械臂处于AP模式。打开android设备的wifi设置界面,机械臂的AP热点格式为“Robot_XXXX”。wifi列表中,“Robot_XXXX”即为机械臂的热点。连接“Robot_XXXX”,输入统一的密码,连接成功成功后,即可使用APP与机械臂通信。AP mode, that is, the robot arm opens a wifi hotspot, and the user connects to this hotspot through the android device. When the robot arm is powered on, the function indicator light flashes blue and green. After waiting for a while, the indicator light turns blue. At this time, the robot arm is in AP mode. Open the wifi setting interface of the android device, and the AP hotspot format of the robotic arm is "Robot_XXXX". In the wifi list, "Robot_XXXX" is the hotspot of the robotic arm. Connect "Robot_XXXX", enter a unified password, and after the connection is successful, you can use the APP to communicate with the robotic arm.
说明:AP模式下,最多只允许一台android设备连接。Note: In AP mode, only one android device is allowed to connect at most.
(2)Clien模式(2)Client mode
Client模式以路由器为中心,使机械臂与android设备都连接到路由器上,即机械臂与android设备处于同一网络下。The Client mode is centered on the router, so that both the robotic arm and the android device are connected to the router, that is, the robotic arm and the android device are under the same network.
通过Leap Motion模仿控制机械臂动作时,将机械臂连接电源,通过microUSB连接PC端,在PC端打开机械臂控制软件,进行在线编程。通过WIFI模块实现无线远程操作,利用C标准库Socket,通过TCP/IP协议调用笔记本的WIFI与WIFI模块进行通讯,WIFI 模块将接收到的数据直接传输给stm32做进一步处理,通过手机端连接机械臂。在机械臂模式下,连接机械臂,进行无线控制。将Leap Motion连接到电脑上,通过安装Leap Motion Controller上位机,在执行模式或者实时模式下,控制机械臂模仿完成相应动作。When using Leap Motion to imitate and control the action of the robotic arm, connect the robotic arm to the power supply, connect to the PC via microUSB, open the robotic arm control software on the PC, and perform online programming. Realize wireless remote operation through the WIFI module, use the C standard library Socket, call the WIFI of the notebook to communicate with the WIFI module through the TCP/IP protocol, the WIFI module will directly transmit the received data to the stm32 for further processing, and connect the mechanical arm through the mobile phone . In the robotic arm mode, connect the robotic arm for wireless control. Connect the Leap Motion to the computer, and install the Leap Motion Controller host computer to control the robotic arm to simulate and complete the corresponding actions in the execution mode or real-time mode.
从上述实施例可以看出,本发明实施例提供的基于Leap Motion的机械臂控制方法包括:Leap Motion设备采集手部动作后,将数据发送给Leap Motion Controller(上位机),在上位机中对数据进行分析并将其转化为能控制机械臂的对应操作指令,根据动作指令控制机械臂模仿人的手部动作,整个操作过程十分流畅并且精准度高。基于Leap Motion实时控制的机械臂摆脱了传统的按钮等控制方式的不人性化设计,操作简单而且精准度高,将人类思维与机器思维结合在一起,以便于更好地执行目的任务。As can be seen from the foregoing embodiments, the Leap Motion-based robotic arm control method provided by the embodiments of the present invention includes: after the Leap Motion device collects hand motions, the data is sent to the Leap Motion Controller (host computer), and the control method is performed in the host computer. The data is analyzed and converted into corresponding operating instructions that can control the robotic arm. According to the action instructions, the robotic arm is controlled to imitate human hand movements. The entire operation process is very smooth and accurate. The robotic arm based on Leap Motion's real-time control gets rid of the inhumane design of traditional buttons and other control methods. It is easy to operate and has high precision. It combines human thinking and machine thinking to better perform purpose tasks.
本申请提供的机械臂及基于Leap Motion的机械臂控制方法不仅可以应用于工业上的搬运、焊接等工作,还可以当做儿童的开发益智玩具,也可以用于教学演示,增强学生们的动手能力还可以让他们对机械臂的工作原理有着更加深入的了解。The manipulator and the Leap Motion-based manipulator control method provided by this application can not only be applied to industrial handling, welding, etc., but also can be used as educational toys for children's development, and can also be used for teaching demonstrations to enhance students' hands-on skills Capabilities can also give them a deeper understanding of how the robotic arm works.
本领域技术人员在考虑说明书及实践这里发明的公开后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosure herein. This application is intended to cover any modification, use or adaptation of the present invention, these modifications, uses or adaptations follow the general principles of the present invention and include common knowledge or conventional technical means in the technical field not disclosed in the present invention . The specification and examples are to be considered exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
以上所述的本发明实施方式并不构成对本发明保护范围的限定。The embodiments of the present invention described above are not intended to limit the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710881150.1ACN107738255A (en) | 2017-09-26 | 2017-09-26 | Mechanical arm and the Mechanical arm control method based on Leap Motion |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710881150.1ACN107738255A (en) | 2017-09-26 | 2017-09-26 | Mechanical arm and the Mechanical arm control method based on Leap Motion |
| Publication Number | Publication Date |
|---|---|
| CN107738255Atrue CN107738255A (en) | 2018-02-27 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710881150.1AWithdrawnCN107738255A (en) | 2017-09-26 | 2017-09-26 | Mechanical arm and the Mechanical arm control method based on Leap Motion |
| Country | Link |
|---|---|
| CN (1) | CN107738255A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108466266A (en)* | 2018-03-22 | 2018-08-31 | 山东农业大学 | Mechanical arm motion control method and system |
| CN109202848A (en)* | 2018-09-12 | 2019-01-15 | 西南大学 | Man-machine collaboration picking robot and its control method based on Leap Motion and machine vision |
| CN109315144A (en)* | 2018-07-27 | 2019-02-12 | 湖南人文科技学院 | Fruit intelligent picking device and picking method |
| CN109636708A (en)* | 2018-12-31 | 2019-04-16 | 青岛黄海学院 | Unmanned boat image collecting device and method under a kind of briny environment |
| CN110640739A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Grabbing industrial robot with center position recognition function |
| CN110640744A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot with fuzzy control of motor |
| CN110640737A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot for measuring data fusion attitude |
| CN110640742A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot platform of multi-mode control |
| CN110640741A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Grabbing industrial robot with regular-shaped workpiece matching function |
| CN110640738A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot platform of developments seizure |
| CN110666801A (en)* | 2018-11-07 | 2020-01-10 | 宁波赛朗科技有限公司 | Grabbing industrial robot for matching and positioning complex workpieces |
| CN110694286A (en)* | 2019-11-05 | 2020-01-17 | 厦门大学 | Method for simulating palm puppet performance by using mechanical arm |
| CN111185906A (en)* | 2020-01-10 | 2020-05-22 | 上海大学 | A master-slave control method of dexterous hand based on Leap Motion |
| CN111604911A (en)* | 2020-06-28 | 2020-09-01 | 哈尔滨工程大学 | Auxiliary mechanical arm and auxiliary robot |
| CN111941426A (en)* | 2020-08-17 | 2020-11-17 | 常州工程职业技术学院 | A control system and method for remotely controlling a mobile manipulator |
| CN112025772A (en)* | 2020-07-28 | 2020-12-04 | 沈阳建筑大学 | Mechanical arm autonomous calibration method based on visual measurement |
| CN112847435A (en)* | 2020-12-31 | 2021-05-28 | 洛阳尚奇机器人科技有限公司 | Light mechanical arm with passive gravity compensation |
| CN113442121A (en)* | 2021-07-30 | 2021-09-28 | 上海宜硕网络科技有限公司 | Mechanical arm, adjusting method and device thereof, and electronic equipment |
| CN115302488A (en)* | 2022-08-30 | 2022-11-08 | 浙江工业大学 | A wearable external limb robot |
| CN115489822A (en)* | 2022-10-24 | 2022-12-20 | 江苏理工学院 | A button battery automatic testing equipment |
| CN117862453A (en)* | 2023-03-29 | 2024-04-12 | 日昭(深圳)机器人科技有限公司 | Robot for spraying and picking and placing castings |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108466266A (en)* | 2018-03-22 | 2018-08-31 | 山东农业大学 | Mechanical arm motion control method and system |
| CN109315144A (en)* | 2018-07-27 | 2019-02-12 | 湖南人文科技学院 | Fruit intelligent picking device and picking method |
| CN109315144B (en)* | 2018-07-27 | 2021-10-08 | 湖南人文科技学院 | Fruit intelligent picking device and picking method |
| CN109202848A (en)* | 2018-09-12 | 2019-01-15 | 西南大学 | Man-machine collaboration picking robot and its control method based on Leap Motion and machine vision |
| CN110640738A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot platform of developments seizure |
| CN110640744A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot with fuzzy control of motor |
| CN110640737A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot for measuring data fusion attitude |
| CN110640742A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Industrial robot platform of multi-mode control |
| CN110640741A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Grabbing industrial robot with regular-shaped workpiece matching function |
| CN110666801A (en)* | 2018-11-07 | 2020-01-10 | 宁波赛朗科技有限公司 | Grabbing industrial robot for matching and positioning complex workpieces |
| CN110640739A (en)* | 2018-11-07 | 2020-01-03 | 宁波赛朗科技有限公司 | Grabbing industrial robot with center position recognition function |
| CN109636708A (en)* | 2018-12-31 | 2019-04-16 | 青岛黄海学院 | Unmanned boat image collecting device and method under a kind of briny environment |
| CN110694286B (en)* | 2019-11-05 | 2020-11-10 | 厦门大学 | A method for simulating palm puppet performance using a robotic arm |
| CN110694286A (en)* | 2019-11-05 | 2020-01-17 | 厦门大学 | Method for simulating palm puppet performance by using mechanical arm |
| CN111185906A (en)* | 2020-01-10 | 2020-05-22 | 上海大学 | A master-slave control method of dexterous hand based on Leap Motion |
| CN111604911A (en)* | 2020-06-28 | 2020-09-01 | 哈尔滨工程大学 | Auxiliary mechanical arm and auxiliary robot |
| CN112025772A (en)* | 2020-07-28 | 2020-12-04 | 沈阳建筑大学 | Mechanical arm autonomous calibration method based on visual measurement |
| CN112025772B (en)* | 2020-07-28 | 2021-11-23 | 沈阳建筑大学 | Mechanical arm autonomous calibration method based on visual measurement |
| CN111941426A (en)* | 2020-08-17 | 2020-11-17 | 常州工程职业技术学院 | A control system and method for remotely controlling a mobile manipulator |
| CN112847435A (en)* | 2020-12-31 | 2021-05-28 | 洛阳尚奇机器人科技有限公司 | Light mechanical arm with passive gravity compensation |
| CN113442121A (en)* | 2021-07-30 | 2021-09-28 | 上海宜硕网络科技有限公司 | Mechanical arm, adjusting method and device thereof, and electronic equipment |
| CN115302488A (en)* | 2022-08-30 | 2022-11-08 | 浙江工业大学 | A wearable external limb robot |
| CN115489822A (en)* | 2022-10-24 | 2022-12-20 | 江苏理工学院 | A button battery automatic testing equipment |
| CN117862453A (en)* | 2023-03-29 | 2024-04-12 | 日昭(深圳)机器人科技有限公司 | Robot for spraying and picking and placing castings |
| Publication | Publication Date | Title |
|---|---|---|
| CN107738255A (en) | Mechanical arm and the Mechanical arm control method based on Leap Motion | |
| CN110238831B (en) | Robot teaching system and method based on RGB-D image and teaching device | |
| CN204997657U (en) | Biomimetic mechanical hand with imitate function | |
| CN207573956U (en) | An orchard intelligent manipulator picking device based on human-machine collaboration | |
| JP6314134B2 (en) | User interface for robot training | |
| CN207606868U (en) | A kind of simple activation lacking mechanical finger | |
| CN103192387B (en) | Robot and its control method | |
| CN103895022A (en) | Wearable type somatosensory control mechanical arm | |
| CN108284436B (en) | Remote robotic dual-arm system and method with imitation learning mechanism | |
| CN105459090A (en) | Instructive six-degree-of-freedom carrying manipulator | |
| EP3290165A2 (en) | Robot control device, robot, and robot system | |
| CN103271784A (en) | Man-machine interactive manipulator control system and method based on binocular vision | |
| CN104057458A (en) | Multi-shaft mechanical arm visual control system and method based on somatosensation and touch | |
| CN108482000A (en) | A kind of auto-portrait robot system | |
| CN207155803U (en) | A kind of mechanical arm | |
| CN110076796A (en) | A variable topology multi-joint collaborative follower robot | |
| CN107838932A (en) | A kind of robot of accompanying and attending to multi-degree-of-freemechanical mechanical arm | |
| CN206643917U (en) | A multipurpose robot | |
| CN111843997A (en) | Handheld general teaching system for mechanical arm and operation method thereof | |
| CN119427324B (en) | A force feedback exoskeleton and humanoid robot imitation learning method | |
| CN105965485B (en) | Nonopiate six axles teaching bar | |
| CN103600351A (en) | Six-axis-force-torque transducer based six-freedom-degree robot operating system and control method thereof | |
| Salah et al. | Smartphone Sensor-based Development and Implementation of a Remotely Controlled Robot Arm | |
| CN204724476U (en) | A kind of novel sorting system based on kinect | |
| CN205184776U (en) | Remove robot control device based on data glove |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WW01 | Invention patent application withdrawn after publication | ||
| WW01 | Invention patent application withdrawn after publication | Application publication date:20180227 |