Robot¶
openwaam.robot.BeadModel
dataclass
¶
Parabolic single-bead cross-section, area = 2/3 * width * height.
layer_height_multibead
property
¶
Layer height of a flat multi-bead layer (area / step-over).
step_over
property
¶
Centre distance between adjacent beads for a flat layer: 0.738 w, the tangent overlapping model of Ding et al. (2015).
from_meltpool(metrics)
classmethod
¶
Bead from MeltPoolSim.bead_metrics().
from_process(process, aspect_ratio=3.5)
classmethod
¶
Bead from mass conservation plus an assumed width/height ratio.
The ratio depends on heat input, wetting and interpass temperature;
3-4 is typical for steel GMAW beads on plate. Replace it with a
measured or simulated value (see from_meltpool) when you can.
layer_height_wall(wall_width=None)
¶
Layer height of a single-bead wall. After the first layer the bead sits on a wall of its own width, so the cross-section is closer to a rectangle with a rounded top: area / (0.9 * width).
openwaam.robot.Toolpath
dataclass
¶
Ordered list of Segment and Dwell items.
Arc-on segments give the TCP (wire tip) position at the top of the bead being laid, so a bead of layer k spans z in [p.z - layer_height, p.z].
block(lx, ly, n_layers, travel_speed, bead, origin=(0.0, 0.0, 0.0), interpass_dwell=0.0, rotate_layers=True, layer_height=None, **kw)
classmethod
¶
Solid block filled with a zigzag raster at the bead step-over, raster direction rotated 90 degrees every layer.
cylinder(radius, n_layers, layer_height, travel_speed, bead=None, center=(0.0, 0.0, 0.0), n_seg=72, interpass_dwell=0.0, stagger=True, **kw)
classmethod
¶
Thin-walled cylinder. stagger rotates the start point every layer so the start/stop defects do not stack.
from_contours(layers, layer_height, travel_speed, bead=None, interpass_dwell=0.0, z0=0.0, power=None, **kw)
classmethod
¶
layers: list (per layer) of lists of (N, 2) closed or open polylines. power: optional function (layer index, polyline) -> arc power multiplier.
from_stl(path, layer_height, travel_speed, bead=None, interpass_dwell=0.0, **kw)
classmethod
¶
Thin-walled part: one bead following the outline of every slice. The outline is treated as the bead centreline.
travel_to(p, layer=0)
¶
Arc-off move: lift, traverse, lower.
wall(length, n_layers, layer_height, travel_speed, bead=None, origin=(0.0, 0.0, 0.0), alternate=True, interpass_dwell=0.0, **kw)
classmethod
¶
Single-bead wall along +x. alternate=True reverses every layer, which evens out the start/end height error.
weld(points, layer=0, speed=None, power=1.0)
¶
Arc-on polyline. Travels to the first point if needed. power
scales the arc power on this polyline (heat input tuning per feature).
openwaam.robot.Trajectory
dataclass
¶
openwaam.parts.Impeller
dataclass
¶
Centrifugal impeller, axis along +z, back plate on the build plate. SI units.
Meridional shape
hub: r_hub(z) = r_nose + (radius - r_nose) * (1 - (z - plate) / hub_height) ** hub_exponent
above the back plate, a cylinder of r_nose above that.
shroud: blades are cut at blade_top inside r_inducer and follow a
quarter ellipse down to plate + tip_width at the rim.
Blades
Camber line in plan view is a logarithmic spiral with angle
backsweep to the radius; lean (rad/m) rotates it with height,
which bends the inducer forward. Lean makes the blade overhang by
atan(r * lean) from vertical.
blade_starts()
¶
(start angle, inner radius) of every blade.
feature(k, loop)
staticmethod
¶
Name of the feature a polyline of layers() belongs to: closed rings are hub, open lines are blades.
fit_to_bead(layer_height, step_over)
¶
Copy whose height is a whole number of layers and whose blades are one bead thick.
layers(layer_height, step_over, ds=0.0025, overlap=0.5)
¶
Planar slices as bead centrelines, for Toolpath.from_contours.
Every layer is: concentric rings filling the hub annulus (direction
of fill alternates between layers, ring start points are staggered),
then one bead per blade from the hub outwards (direction alternates).
overlap is how far, in bead widths, a blade bead starts inside the hub.
max_overhang()
¶
Largest blade lean from vertical, rad.
mesh(n_theta=144, n_z=80, n_r=60, n_h=14)
¶
Triangles (N, 3, 3). The hub is one closed solid; every blade is a closed solid that starts slightly inside the hub.
printability(bead_width)
¶
Warnings about features a bead of this width cannot make.
scaled(diameter, **changes)
¶
Geometrically similar wheel of another diameter (lean scales inversely), with optional overrides.
theta(r, z)
¶
Angle of the blade camber surface at radius r and height z (blade 0).
openwaam.robot.plan_tcp_trajectory(tp, ds=0.001, accel=0.5, corner_tol_deg=5.0)
¶
Sample a toolpath at spacing ds and assign times.
Speed follows each segment's commanded value, limited by accel (m/s2)
with a forward/backward pass. The TCP comes to rest where the arc
switches, at dwells, and slows through corners in proportion to
(1 + cos(angle)) / 2.
openwaam.robot.weave_trajectory(start, end, speed, amplitude=0.0, frequency=0.0, layer=0, rate=200.0, ramp=0.25)
¶
Arc-on pass from start to end at constant forward speed with a
sinusoidal weave across the travel direction (amplitude in m, peak;
frequency in Hz). The weave fades in and out over ramp seconds so the
pass starts and ends on the centreline. Sampled at rate Hz.
openwaam.robot.plan_robot_motion(traj, arm, part_frame=None, torch_axis=(0, 0, -1), retime=True, verbose=False)
¶
Solve inverse kinematics along a TCP trajectory.
part_frame: 4x4 transform from part coordinates to the robot world frame. torch_axis: wire direction in part coordinates (default straight down). retime: stretch time locally wherever a joint would exceed its speed limit, so the returned trajectory is the motion the robot can actually execute. The thermal models then see the real travel speed, including any slow-downs.
openwaam.robot.SerialArm
dataclass
¶
Serial arm defined by standard Denavit-Hartenberg parameters, with joint limits, a base and a tool transform.
frames(q)
¶
World transforms of the base, every joint frame, and the tool tip (n + 2 matrices).
ik(p, axis=None, R=None, q0=None, tol=1e-05, max_iter=200, damping=0.01, null_gain=0.05)
¶
Solve for joint angles placing the tool tip at p.
desired direction of the tool z axis (5-DOF task: rotation
about the wire is left free, which is what an arc torch needs).
R: full 3x3 orientation instead (6-DOF task). Returns (q, ok). The free null space is used to stay near mid-range.
jacobian(q)
¶
6 x n geometric Jacobian of the tool tip in world coordinates.
joint_axes(fr)
¶
World origin and axis of every joint, from the output of frames().
joint_positions(q)
¶
(n + 2, 3) points for drawing the arm as a stick figure.
openwaam.robot.UrdfArm
¶
Bases: SerialArm
Serial arm read from a URDF file: the chain of revolute joints from
the root link to tip_link. Fixed joints are folded into the chain, so
the kinematics are exactly those a physics engine builds from the same
file. Shares inverse kinematics and the rest of the interface with
SerialArm.
frames(q)
¶
Base, the frame of every moving link, and the tool tip.
openwaam.robot.get_arm(name, base=None, tool=None)
¶
Create one of the built-in arms: abb_irb2600, ur10e or generic_6r.
openwaam.robot.bullet.BulletCell
¶
A robot, a pedestal with the build plate, and the growing part.
part_frame: 4x4 transform from part coordinates (plate top at z = 0) to the robot base frame.
collisions(margin=0.0)
¶
Current penetrating contacts of the robot as (link, other, depth).
colour_deposit(values, vmin, vmax, cmap='inferno')
¶
Colour the existing chunks by one value each (NaN = leave grey).
deposit_until(t)
¶
Create the bodies of every chunk finished by time t.
execute(traj, bead_width=None, layer_height=None, kp=0.3, kd=1.0, dwell_settle=0.5, check_every=1, dynamics='ideal', drive=None)
¶
Run the joint trajectory through the motors and return the motion the arm actually performed, with tracking and collision statistics.
dynamics="ideal": PyBullet's built-in position motors on rigid joints. dynamics="flexible": elastic gearboxes, motor friction and a cascaded servo on the motor encoder (see DriveModel).
Long stand-stills (interpass dwells) are simulated for dwell_settle seconds and then skipped; the clock still advances by the full dwell.
plan_deposit(traj, bead_width, layer_height, chunk_length=0.01)
¶
Cut the arc-on path into boxes of at most chunk_length.
render(width=640, height=480, target=None, distance=3.1, yaw=50.0, pitch=-18.0, fov=42.0)
¶
Off-screen RGB image (software renderer, works headless).
render_pair(width=560, height=440)
¶
Overview of the cell next to a close-up of the part.
openwaam.robot.bullet.DriveModel
dataclass
¶
Actuator model of the six axes: an elastic gearbox between each motor and its link, motor-side friction, and a cascaded servo that only sees the motor encoder.
motor (rotor inertia, friction) --[ stiffness, damping ]-- link (PyBullet)
Defaults are typical figures for cycloidal (RV) reducers and servo motors on a 12-20 kg, 1.65 m arm. They are NOT manufacturer data; identify them on your robot if the numbers matter.
Source code in openwaam/robot/bullet.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |