Robotic kinematics
-
@tony73 @JoergS5 I got everything set up and working accept the m669 command. I read the documentation and am unsure that I need to do and what the values mean for my specific machine. here is a copy of the config. config (15).g
-
@3dpotter the config looks ok, only the angle settings parameter A are missing in M669:
If you start the Duet, it needs to know where the homing*) positions are located. This task is done by the endstops and the information in config.g file and the homeall.g file:
- endstops trigger when homing location is reached for a specific axis (for robots, it is a specific angle of the arm, actuator, stepper position)
- config tells in parameter A of M669 which angle the robot arm has when the endstop triggers. Parameter A specifies min, endstop and max angles for every axis, 5 axes with optional rail, 15 values.
- homeall.g are commands to move the axes so the enstops are triggered. Please see example homeall.g files for CoreXY or other 3D printers how this is done (G1 moves with H1, H2 etc.)
*) homing means: when the Duet starts, it doesn't know where your arms and stepper positions are located. The homing procedure finds out by rotating the arms until the endstops are triggered. Together with the angle information in parameter A of M669 the controller then knows when the arm triggers at the endstop, that the arm has angle 34 degree at the endstop position (as example). Together with the M92 information Duet knows how much to move the stepper to change by x degrees.
To decide how to make the homing is one of the most difficult parts.
If you tell me where your endstops are located, we can discuss which value to set for the angles. You can describe by making images of the 3 actuators (axis 1 is the rotation horizontally, 2 and 3 the arms) and paint the locations of the endstops into the image.
The M208 settings in config.g are ignored in the robot kinematics, because the original meaning of M208 is to restrict the print area to a xyz area. A robot has a print area which looks a bit like a donut, so it doesn't fit this original idea of a cubic print area. So I calculate the print area in the code directly to decide whether a coordinate is reachable by the robot arms.
If you don't understand M669, please tell me which parameter is unclear for you.
For the A parameter of M669, please check documentation. The example
Default is A-45:0:45:0:0:70:-70:0:0:-170:-90:0:-225:0:225[:0:0:1000]
means: -45 and 45 are the min and max angles of axis 1. The second parameter is important for the homing of axis 1 and means when endstops triggers, Duet sets the axis 1 position to 0 degree. And so on. I programmed so that 15 or 18 parameters must be set (without or with rail). Even if you have only 3 actuators with 9 settings, you need to spedify 15 parameters (the last 6 ones dummy values). I'll change that in a future release. -
@joergs5 said in Robotic kinematics:
where your endstops are located, we can discuss which value to set for the angles. You can describe by making images of the 3
I started to set up the axis angle limits and homing offset for the arm. as shown in the first video the axis seem to be moving incorrectly. The second video explains where the endstops are located and how the machine triggers them.
-
@3dpotter let's first discuss that your actuators are not X,Y,Z world coordinates, but axis 1,2,3, and to verify that your 3 actuators are rotating correctly:
Please test Axis 1 with
G1 H2 X10
H2 means to move the first axis individually.Same with axis 2 and 3 with G1 H2 Y10 and G1 H2 Z10.
Please be aware that G1 H2 commands ignore the endstops, so you can run them with impossible angles.
You can verify that the axes are rotating in the correct direction. Please see documentation: https://duet3d.dozuki.com/Wiki/Configuring_RepRapFirmware_for_a_FiveAxisRobot?revisionid=HEAD#Section_Construction
- axis 1 positive is counterclockwise
- axis 2 and 3: rotating upwards is positive
If you later say G1 X10, this has a different meaning: it means to rotate all 3 axes so that the world coordinate X changes by10.
I've explained the difference of X as axis 1 and X as world coordinate in
https://forum.duet3d.com/topic/17222/duet3d-3-custom-delta-printer-inconsistant-motor-problems/14
In respect to algorithms, robot kinematics is similar to a delta: the actuators are connected by trigonometric functions and result in X, Y, Z world (cartesian) coordinates.If the rotation of a stepper is incorrectly, you can change it in the config by changing:
M569 P0 S0
to
M569 P0 S1
or other round for the S0/S1 values. P0 is axis1, P1 is axis 2, P2 is axis 3. -
@3dpotter the next thing to check is when your endstop are triggering:
- axis 1 often triggers if the robot looks straight to the direction of the nozzle/gripper, which would be 0 degree
- axis 2 would be 0 degree if the axis 2 arm is horizontally
- axis 3 like axis 2
But please check first that the steppers are rotating in the correct directions and the rotation degrees are correct: if you say G1 H2 10, it should rotate 10 degree counterclockwise, e.g. If not, config must be changed. I often take an easy to recognize rotation like 90 degree to check the setting, but the arms must have enough space to make this rotation.
-
@3dpotter
Hello! how does the configuration on the robot proceed? I am building a 5-axis robot, but the work is slow! if you have time to write how it goes with yours, it will be of great help! -
This post is deleted! -
This post is deleted! -
I remember that I have a separate thread about building the prototype. I move the posts there, and this thread is for firmware topics.
The prototype description is here: https://forum.duet3d.com/topic/20209/robot-type-1-45-cm-belt-gear-direct-drive-r0
-
I have thought about the further development of the robot:
- the 5 axis robot is a special case of a 6 axis robot, the 4th axis being fixed
- build a 6 axis robot, which includes special work modes like 5 axes and a vertical hotend
I'll let the 5 axis robot code exist until I have calculated the 6 axis robot and built a prototype. For the 6 axis robot's 4 th axis, the rotating arm, I'll try the idea https://www.youtube.com/watch?v=2YC-0C8oPUo which is based on an expired patent https://patents.google.com/patent/US5954611
In the long run, I'll try to DIY harmonic drives. -
I've thought about how to design the kinematics for the 6 axis robot. Developing the firmware, I want to follow the following ideas. If someone doesn't agree or has additional main topics, please tell me:
- following the Denavit-Hartenberg (DH) transformation https://en.wikipedia.org/wiki/Robotics_conventions#Denavit–Hartenberg_line_coordinates and the DH parameters: https://en.wikipedia.org/wiki/Denavit–Hartenberg_parameters
- the DH parameters are set directly with M669 parameters
- implement kinematics, inverse kinematics, speed and accel calculations
- to calculate inverse kinematics, store current workmodes of the arms and stay when possible inside it
- possibility to set the robot into classical 3d printing mode (5 axis robot mode): 4th axis 0 degree always, 5 th axis such that 5th arm is vertical, 6th axis and arm rotates horizontal, so the hotend is vertical always
- collision detection and avoidance
- simulation to check whether the planned object is creatable with given constraints
- homing, calibration, measure accuracy and precision proposals
- in a later release railed version and bending corrections
-
@joergs5
bye! it's been a long time since I let myself be heard! I would like to know if you are continuing the robot arm project, I have had many commitments, but now that it is better I would like to continue building a prototype! -
@tony73 I've researched the last threee months how to build a good robot, and your timing is perfect, as I restarted building it this weekend.
The robot is now 6 axis, as you proposed some time ago. When the 4th axis fixed at 0 degree, it's the same like the 5 axis robot before. But 6 axes allow all positions (xyz and rotations by xyz).
Robot's properties are
- 6 axis, the parameters following Denavit-Hartenberg parameters
- harmonic drives and belt drives as alternatives
- encoder for position control and homing
- brakes at the hinges
- toolchanger at the tip
- calibration tool by 2 actuators at robot's base
The encoder is an absolute encoder. I'm still not sure whether it's fast enough for the 1HCL to support closed loop, but I'll try. If it's not fast enough, two encoders for every hinge is still possible.
In a separte thread was a discussion that using the full potential of non planar printing, better slicers are needed. This will be a necessary next step.
-
@tony73 there's a chinese saying from Lao Tzu: "A journey of a thousand miles begins with a single step". Let's start with two steps this week.
Everyone who wants to build a robot from scratch is invited to follow my descriptions and building the objects needed. I'll try to offer alternative ways to produce them, from needing easier/less or more/expensive tools. Using easier tools may mean lower quality or more time needed.
The goal is to manufacture in a DIY way all mechanical robot's parts, including harmonic drives, encoders and toolchanger.
The first steps are preparation steps to be able to manufacture small parts and control their quality. The following two parts help achieving those goals:
differential screw
@mrehorstdmd has brought to my attention differential screws: two screws matched together and having different pitch result in a high resolution small movement. Resolution is 0.125 µm for one step of a 400-step stepper for the configuration I've selected.
The differential screw will be needed for
- calibration robot and/or bed (2 needed)
- focus 1:1 lenses (3 needed)
- manufacturing of the teeth of the harmonic drives
- manufacturing the cross roller bearings
- tasks in the teststation
Documentation: https://forum.duet3d.com/topic/25448/differential-screws-robot-series
1:1 lens
It is possible to make images with the resolution of the camera sensor's pixel size! I've detected it in https://www.raspberrypi.org/forums/viewtopic.php?t=59889 and is also known as coupling lenses, macro stacking or coupled reversed lenses. It is not reverting one objectiv, but coupling two of them (or two lenses reverted). The maximum resulution is for a Raspberry OV5467 e.g. 1.4 µm and ESP32-CAM's OV2640 pixel size is 2.2 µm! I will also use Canon EOS CMOS sensors, they have pixel size of about 4.3 µm, but with lower noise.
The lenses will be needed for
- checking teeth quality of the harmonic drives
- checking roller quality of the cross roller bearings
- absolute optical encoder reading
- quality control in general, e.g. of printed objects
I will create a new thread and place the link here to describe the two steps.
-
@joergs5
I'm here, waiting for you to publish the instructions! I would like to know if the prototype you built of the 5-axis robot, were you able to print objects with it? -
@tony73 said in Robotic kinematics:
were you able to print objects with it?
the robot was ready for printing, but the arms were vibrating/swinging so much that I didn't want to do it. I wanted to avoid demotivation and take a step back, improving all parameters. Later, after disassambly, I had the idea that the only action to take was to speed down and set acceleration very low to solve it (today I would try input shaper...). But I was a bit frustrated, because I want to build a good 3D robot printer, which can also be used for light router tasks, grinding, 3D scanning and similar tasks. In fact, I want two robot arms which work together.
Another reason why I didn't start printing was, printing bad quality would not help motivating other users to build a robot. That's a reason, why I want to achieve building the robot with tools every user has and at the same time a good quality robot. I know it's difficult. Differential screw and 1:1 lenses are means for micromanufacturing with low cost, and a good start.
But anyway, my view with all printer types is, stability and precision is key to good prints, and I am working and researching for this goal.
-
@tony73 I started documentation of the differential screw, lenses and harmonic gears now in https://forum.duet3d.com/topic/25448/differential-screws-11-lenses-harmonic-gear-robot-seriesto give an overview which tools are needed. Images and detailed instructions of building will follow.
-
@joergs5
hi,I looked at the project of the differential screw and read the various measures, but I cannot understand how it would be assembled, I do not know this type of reducer. I think I understand that there are pulleys, screws and a linear guide, if built with high precision can the backlash be zero or very low? -
@tony73 said in Robotic kinematics:
if built with high precision can the backlash be zero or very low
The differential screw documentation is not finished yet. I'll describe all details and steps. A general description of differential screws: https://en.wikipedia.org/wiki/Differential_screw The first image shows how I'm building it, rotated to vertical, with stepper driving the rotation being in the middle and the dark gray parts being two big blocks.
If Differential screws stay at one flank, it has no backlash. This can be reached by pushing it into one direction always.
-
@tony73 I've changed the title of the description to produce differential screws, because I added lenses and harmonic gear to the thread, the new link is https://forum.duet3d.com/topic/25448/differential-screws-11-lenses-harmonic-gear-robot-series