This project generates toolpaths for an English wheel forming process on sheet metal.
The Python script creates position and orientation waypoints that can be sent to a robot (e.g., a UR robot) to trace:
- Triangular / zig-zag paths across a sheet,
- Straight lines along a chosen axis, or
- Pure rotational motions about a given axis.
The code also includes functions to compensate for the robot wrist rotation so that the desired motion is expressed correctly in the tool coordinate frame.
-
Triangular/zig-zag toolpath generation
Generate a zig-zag pattern between two edges of the sheet based on:- Sheet length in
x - Sheet width in
y - Number of peaks (triangles) across the width
- Sheet length in
-
Straight line path generation
Generate a straight line along thex,y, orzaxis with user-defined:- Total length
- Division count (number of segments/points)
-
Pure rotation sequences
Generate a sequence of rotation waypoints about thex,y, orzaxis with:- Total rotation angle
- Step size (number of increments)
-
Wrist rotation compensation
Functions to adjust both:- Translations (2D and 3D)
- Rotations
so that the motion is correctly expressed in the robot tool frame, given a wrist angle.
main.py(or your script name)
Contains:- Rotation compensation helpers:
compensate_wrist_rotation2(dx, dy, theta)compensate_wrist_rotation3(dx, dy, dz, theta)
- Rotation matrix helpers:
Rx(theta),Ry(theta),Rz(theta)
- Rotation compensation for rotational motion:
compensate_wrist_rotation_v2(rx, ry, rz, theta)
- Path generators:
generate_line()rotate()generate_tp()(triangular / zig-zag path)
- Setpoint builder:
convert_to_setp()
- Rotation compensation helpers:
convert_to_setp() assembles the generated data into an N x 6 array of setpoints:
[x, y, z, rx, ry, rz]