pick and place robot using forward and inverse kinematics -凯发k8网页登录
this example models a delta robot performing a pick and place task. the robot picks up a part using a vacuum gripper, moves the part to each of the four markers on the table, drops the part at the first marker, and then returns to the home position. this example demonstrates how to:
create objects and call them via matlab function blocks to compute forward and inverse kinematics during simulation.
model contact using blocks.
model
delta robot subsystem
the delta robot subsystem models a 3-dof delta robot. the motion of the end effector is purely translational due to the kinematic structure of the robot. the robot's actuators correspond to the three torque-actuated revolute joints mounted to the upper base plate. to mimic encoder data, the subsystem outputs the positions (angles) of the actuators. a camera frame is mounted underneath the base plate and looks down towards the end effector. the geometry associated with the end effector is exported via a simscape bus to facilitate contact modeling. see the block for more information.
planning and control subsystem: forward and inverse kinematics
because trajectory planning for the end effector is done with respect to the xyz coordinates of the robot's camera frame, a forward kinematics map is needed to transform the positions and velocities of the actuators to the position and velocity of the end effector. similarly, an inverse kinematics map is needed to transform the desired position of the end effector computed by the planner to the corresponding positions of the three actuators. these forward and inverse kinematics computations are done using objects. the objects are defined as persistent variables in the functions and . these functions are called by the matlab function blocks and highlighted below. to speed up computation and help ensure the kinematicssolver object for the inverse kinematics problem finds the desired solutions, the previous solution is used as the initial guess for the current problem. whenever the parameters of the delta robot subsystem change, the sm_pick_and_place_robot_fk and sm_pick_and_place_robot_ik functions are cleared from memory so that the kinematicssolver objects are regenerated at the beginning of the next simulation. this ensures that the kinematicssolver objects and the model stay in sync.
planning and control subsystem: path planner
planning occurs in the matlab function block highlighted below. the planner transitions the robot between three different modes:
go to location directly above part
grasp part and move to goal location
go home
whenever a mode begins, a trajectory is computed that takes the end effector from its current position to the mode's goal position in a fixed amount of time. the trajectory is generated in two stages: first, a third-order polynomial is computed corresponding to the path of the end effector in xyz camera coordinates from its current position to the goal position; second, a fifth-order polynomial is computed which is used to scale the time along the path such that the initial and final velocities and accelerations are all zero. a mode transition occurs when the position and velocity of the end effector are sufficiently close to the goal values. given the current time, the planner returns the desired position and velocity of the end effector along the trajectory as well as the desired state of the vacuum.
planning and control subsystem: controller
the subsystem highlighted below contains a discrete time pid controller that drives the actual positions of the actuators to their desired values.
vacuum subsystem
to grasp the part, a simple vacuum is modeled between the part and the robot's end effector. whenever the planner commands suction, the vacuum applies a constant force between the center of mass of the part and the tip of the end effector.
contact subsystems
spatial contact force blocks inside the end effector-part contact forces and part-table contact forces subsystems are used to model contact. to speed up the simulation, three contact points equally spaced around the tip of the end effector are used as proxies for full cylindrical geometry when it is in contact with the part. similarly, three equally spaced contact points around the bottom edge of the part are used as contact proxies for when it makes contact with the table. the vacuum force keeps the part in contact with the end effector, and friction prevents it from slipping during transport.
image processor
the image processor subsystem uses transform sensor blocks to simulate the processing of camera data to track the locations of the part and the markers on the table.
see also
|