Printer Package

This section will describe the current implementation of the printer package used for interpreting g-code files for simultaneous movement and extrusion. It is to be replaced by the offline motion plan in development. For the offline motion plan, the time joint package should be used. The package depends on having a running duet communication interface and having the controller for the robot along with moveit active.

In the printer package, each command is interpreted one-by-one without lookahead. Each type of command is handled separately.

  • M Commands are passed directly to the Duet Board without any processing.

  • G Commands are processed based on the command type. The main type of command used is either a G1 or G0. For these, the last pose for the robot arm and the new pose are calculated based on the values in the command. Any axis (X, Y, Z) with a provided value is updated, while those not specified retain their previous value. For the base printer package, the orientation is fixed to the quaternion (0, 0, 0, 1). This pose is planed to using PILZ in MoveIt. The plan is executed after creation. When an E value is specified, a modified command is sent to the Duet Board. This command only contains the extrusion value and an updated feedrate. The reasoning for this is that the Duet Board would scale the extrusion speed based on its own set velocity and acceleration without the information about the arm’s motion plan. To determine the F value to provide, the most recent F value recieved from the g-code is scaled by a factor of (extrusion_amount/commanded_motion_distance).

Multi-arm Printing

Nonplanar Printing

Currently, nonplanar printing is only supported on the “nonplanar_printing” branch of crm_core. The major difference between this branch and others is that the end effector orientation is not fixed. There are a few constraints applied to generate the nozzle orientation, with the goal being to avoid interference between the nozzle and the already printed part.

The main constraints are orienting the nozzle normal to the movement of the arm and leaning away from a pre-designated point. Keeping the nozzle normal to the movement ensures that the hot end will not be directly interfering with its current motion plan. A vector is created based on the starting and final position specified in the G-Code. Then a plane of orientations normal to this movement can be obtained. From that plane, to select a specific orientation, the factors considered are the previous orientation and a location that should be avoided. The point to avoid is currently configured as the home (X,Y,Z) of the arm in the printer package. This ensure that, generally, the arm leans away from the model if it is being printed at the center of the buildplate. This is sufficient for avoiding interference with meshes sliced using a concave surface (e.g. x^2). For more complex surfaces, this point should be dynamically found. Lastly, the orientation calculated is clamped to be within 15 degrees of vertical to ensure small movements do not result in the arm wildly swinging around.