Autocalibration: Measure distance to home from unknown position
July 04, 2017 11:22AM
My setup:
Absolute cheapest i3 clone, marlin fimware, melzi board. Work(ed) really well, albeit dead slow.

What I want to know:
Considering the firmware lost it's current position (power loss os missed steps) how do I measure the distance from the current position to home endstops?

Why do I need this:
I recently updated my computer and lost all the custom gcode I had set in Slic3r for my printer. Instead of trying to find out it's mechanical limits by hand once again, I thought I could automate it.

The idea is:
  1. Manually level the Z axis.
  2. move the printer to the far end of X, Y and Z.
  3. Tell the firmware to measure distance to home, and you get the build volume.
  4. Tell the firmware to move to a safe position in the volume.
  5. Set a testing jerk, acceleration, and speed profile.
  6. Have the printer violently swing the printhead and bed a little.
  7. Measure distance to home.
  8. If steps were skipped then go more conservative on the motion profile, otherwise go more aggressive.
  9. Return to step 4 and repeat until the limit is known.
  10. Manually use a satety margin, say 25%, to de-rate the tested limits.
Sounds pretty simple to implement on the host computer, except for the "measure distance to home" part.
Re: Autocalibration: Measure distance to home from unknown position
July 05, 2017 02:16AM
Depending on the controller firmware you are using, there are several "probe" methods. Check out G29, G31 if they work with endstops on all axes.
In real life the boundaries of a cartesian printer are not critical. You won't print on the edge of the bed anyway, or do you?
Re: Autocalibration: Measure distance to home from unknown position
July 05, 2017 06:27AM
Setting the dimensions of the print bed in firmware is normally a one-time thing. There's probably some way to automate it, but is programming it going to be less effort than simply jogging the axes through the machine's limits?

In real life the limits of the printer's motion are unimportant until they are important. Some printers can print right to the edges of the bed and when you print multiple parts at the same time, having accurate set-up of the printer's limits and the bed's dimensions and offsets (in the slicer) will allow placement of parts to maximize use of the available bed space.

Ultra MegaMax Dominator 3D printer: []
Re: Autocalibration: Measure distance to home from unknown position
July 06, 2017 12:45AM
My primary interest are actually the jerk, acceleration and speed limits. These are way harder to set manually, and you will only know you are too high when it is too late.

Print volume is easy to setup manually, and yes it is a one time thing. However, since I already intended to measure the hard part why not do the easy one too? One less thing to do manually.

G29 and G31 are Z-probe specific... I wanted something like that for X and Y... Sad.

Anyways, I ended up finding my custom GCODE snippets in an old file on the printer's SD. Still would like to do that autocalibration, though.
Re: Autocalibration: Measure distance to home from unknown position
July 06, 2017 09:27PM
I would also like to see that auto calibration !

Wouldn't it be enough for the firmware to get one new command ? A "move towards end stop and count the number of steps you needed" command? You probably want to supply if it should go towards min or max end stop (most printers only have one end stop per axis and moving towards the wrong direction endlessly is not fun..) and you also want to specify which axis to move.

The homing move is rather similar to this as that move is also unlimited. So one would "only" need to add the step counting part. Depending on how the firmware is implemented that might still be a rather big change.

The whole process of testing the size and testing the max accelerations could then be done by a script running on a PC sending G-Codes. That way it is probably easier to implement and change than to have all that functionality in the firmware.

Please push forward on this!
Re: Autocalibration: Measure distance to home from unknown position
July 11, 2017 10:22PM
That is precisely the intention, all I need from the firmware is distance from "here" to endstop.

All the rest of the code should be on the PC-side, including an option to chose which way to home.
Re: Autocalibration: Measure distance to home from unknown position
July 12, 2017 05:06AM
RepRapFirmware has an option for measuring distance to home, it's the S3 option on the G1 command. It homes the axis, but instead of setting the current position to the axis limit afterwards, it does the reverse. You can then retrieve the current position using M114 or the axis limits using M208. So this sequence would do what you are asking for:

G92 X0. ; Set current position to 0
G1 S3 X-300. ; Home to X minimum and set the axis limit
M208 ; Report axis limits
M208 S1 X0. ; Set axis limit back to 0
G92 X0. ; Set current position as 0

Large delta printer [], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [].
Sorry, only registered users may post in this forum.

Click here to login