repetier firmware proposal for delta endstop offset calibration
May 23, 2013 07:41AM
Hi all and mainly Repetier ;-)

I've recently built a delta printer running perfectly fine under repetier host + repetier firmware (see [groups.google.com]), so first of all many thanks for those two nice and clever pieces of software thumbs up.

Calibration of deltas requires a perfect trimming of the 3 endstops which is usualy done using mechanical stuff like screws to modify the moment the endstop signal occurs. This works fine but somewhat complexifies the hardware at the level of either the carriages or the endstops supports. in order to simplify all this I had an idea of "firmware offset trimming" I want to propose here...

When trimming the delta an simple method consists in moving the effector close to the vertical position of each tower, check the distance of the effector to the bed and compensate the 2 highest towers with the trimming screws. Rather than this last step, would it be possible to introduce in the firmware 3 offset_endstop (X,Y,Z) parameters in which we could set the height (one per axis) the firmware would correct after hitting the endstops. It could be either real number parameters allowing to set a length in millimeters or an integer giving the number of motors steps we would add to the axis after homing.
It would be perfect if there would be room enough in the EEPROM to perform this from the EEPROM GUI...

What do you think of this ?

Alain
Re: repetier firmware proposal for delta endstop offset calibration
May 24, 2013 11:50AM
You should know that sousousx has written the delta part. I'm currently building my own to join the delta development. Something like this planned for the release after my delta is finished. I plan even to do it with a z-probe to make it even easier. So it will come a few days after my delta is ready, at least in the development tree. In the main tree when everything is tested and satisfying.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: repetier firmware proposal for delta endstop offset calibration
June 12, 2013 05:15PM
Hi All,

I eventually jumped into the firmware to code the proposed modification...
It works fine !

Here is a video which show the homing process in action: [youtu.be]


I've introduced a kind of "software endstops trims" just to avoid to install screws at the endstop levels.
For this the modification in repetier host is quite simple:
1- in configuration.h added 3 parameters:
//=============================================================================== added code
//software endstops trimming. expressed in mm always >=0
#define X_ENDSTOP_OFFSET 0
#define Y_ENDSTOP_OFFSET 2.6
#define Z_ENDSTOP_OFFSET 1.4
// end added code ==========================================================================

each of them defines the amount of vertical offset needed for each column (in millimeters)

2- in command.cpp, added few lines in homing procedure to do the levelling job:
//added code ======================================================================

// approx dh = racine(3)*dz (dh1 is stored in X_ENDSTOP_OFFSET)
// go down of (dh1 + dh2 +dh3)
move_steps(0,0,axis_steps_per_unit[0]*-(X_ENDSTOP_OFFSET+Y_ENDSTOP_OFFSET+Z_ENDSTOP_OFFSET),0,homing_feedrate[0]/ENDSTOP_X_RETEST_REDUCTION_FACTOR, true, false);
// move each arm :
// arm1x X: dh1 Y: dh1/racine(3)
// arm2y X: -dh2 ; Y: +dh2/racine(3)
// arm3z Y: -dh3*2/racine(3)
move_steps(axis_steps_per_unit[0]*(X_ENDSTOP_OFFSET-Y_ENDSTOP_OFFSET),axis_steps_per_unit[0]*(X_ENDSTOP_OFFSET+Y_ENDSTOP_OFFSET-2*Z_ENDSTOP_OFFSET)/1.73205,0,0,homing_feedrate[0]/ENDSTOP_X_RETEST_REDUCTION_FACTOR, true, false);

printer_state.currentPositionSteps[0] = 0;
printer_state.currentPositionSteps[1] = 0;
printer_state.currentPositionSteps[2] = printer_state.zMaxSteps;
calculate_delta(printer_state.currentPositionSteps, printer_state.currentDeltaPositionSteps);
printer_state.maxDeltaPositionSteps = printer_state.currentDeltaPositionSteps[0];
//end added code ====================================================================

with this, the homing functions includes 2 other steps:
- go down a few mm
- offset the effector so that each column is offset by the required amount

If you use a magnetic system with ball ends, it is very simple to level all this.
Just disconned the effector, let the arms hang down. Home the delta, go down untill the first arm touches the bottom plate, record the Z value, bend this couple of arms, go down until the second arm touches the bed, record the seconf value and do the same for the third arm.

Then set 0 to the first arm offset value, and the distance between Zfirst - Zsecond, Zfirst-Zthird to the other arms offset.
Compile, upload and the bed leveling is done. You then need to fix the curvature of the plate, then the Zmax value of course.

Clearly this is not as smart as Johann's self levellling system, but this is a first step towards simplicity ;-)


and the links to the modified files:
[groups.google.com]
[groups.google.com]

Alain
Re: repetier firmware proposal for delta endstop offset calibration
July 01, 2013 08:12AM
I've been playing with hacking an auto-calibrate function in for deltas and seem to have run across a slightly more direct way to apply the trims by directly offsetting the delta state and then forcing them to resync, no assumptions about the arm geometry needed.

Here's my complete delta homing function with trims. I've got some of the defines replaced with state vars as I've got them exposed to eeprom, but the logic is all still there.

void home_axis(bool xaxis,bool yaxis,bool zaxis) {
  long steps;
  bool homeallaxis = (xaxis && yaxis && zaxis) || (!xaxis && !yaxis && !zaxis);
  if (X_MAX_PIN > -1 && Y_MAX_PIN > -1 && Z_MAX_PIN > -1 && MAX_HARDWARE_ENDSTOP_X & MAX_HARDWARE_ENDSTOP_Y && MAX_HARDWARE_ENDSTOP_Z) {
    UI_STATUS_UPD(UI_TEXT_HOME_DELTA);
    // Homing Z axis means that you must home X and Y
    if (homeallaxis || zaxis) {
      delta_move_to_top_endstops(homing_feedrate[0]);	
      move_steps(0,0,axis_steps_per_unit[0]*-ENDSTOP_Z_BACK_MOVE,0,homing_feedrate[0]/ENDSTOP_X_RETEST_REDUCTION_FACTOR, true, false);
      delta_move_to_top_endstops(homing_feedrate[0]/ENDSTOP_X_RETEST_REDUCTION_FACTOR);	
      printer_state.currentPositionSteps[0] = 0;
      printer_state.currentPositionSteps[1] = 0;
      printer_state.currentPositionSteps[2] = printer_state.zMaxSteps;
      calculate_delta(printer_state.currentPositionSteps, printer_state.currentDeltaPositionSteps);

      //update our delta state based on our end-stop soft trimming
      printer_state.currentDeltaPositionSteps[0] -= axis_steps_per_unit[0]*printer_state.tower1_trim;
      printer_state.currentDeltaPositionSteps[1] -= axis_steps_per_unit[0]*printer_state.tower2_trim;
      printer_state.currentDeltaPositionSteps[2] -= axis_steps_per_unit[0]*printer_state.tower3_trim;

      //set max delta steps based on the tallest tower incase all 3 towers have trim values applied for some reason
      printer_state.maxDeltaPositionSteps = max(printer_state.currentDeltaPositionSteps[0], printer_state.currentDeltaPositionSteps[1]);
      printer_state.maxDeltaPositionSteps = max(printer_state.maxDeltaPositionSteps, printer_state.currentDeltaPositionSteps[2]);

      //move down in Z equal to the largest trim value, this re-syncs the cartesian and delta states
      move_steps(0,0,axis_steps_per_unit[0]*-(max(printer_state.tower1_trim,max(printer_state.tower2_trim,printer_state.tower3_trim))),0,homing_feedrate[0]/ENDSTOP_X_RETEST_REDUCTION_FACTOR, true, false);


    } else {
      if (xaxis) printer_state.destinationSteps[0] = 0;
      if (yaxis) printer_state.destinationSteps[1] = 0;
      split_delta_move(true,false,false);
    }
    printer_state.countZSteps = 0;
    UI_CLEAR_STATUS 
  }
}
Re: repetier firmware proposal for delta endstop offset calibration
July 01, 2013 10:01AM
I'm already working on the auto calibration for delta printer. Picking the 3 points with a sensor already works and computing the plane. Your suggestion is exactly the solution it will use to trim the bed position, also it is done a bit different. But the idea is the same. Hope to finish that part in the next days.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: repetier firmware proposal for delta endstop offset calibration
July 01, 2013 07:09PM
Sweet, really looking forward to that. I'm probing the origin point as well to set up zheight and recompute deltaRadius so I can swap between different end effectors at will.
Re: repetier firmware proposal for delta endstop offset calibration
July 04, 2013 02:17AM
And just for the curious, here is the entirety of my own dirty hack
[github.com]

It's manual deploy/retract, and it spits out estimated correction values to the log similar to PIDautotune rather than just making the fixes itsself. But it's got me to around +- 50 micron and tiding me over until the real release.
Re: repetier firmware proposal for delta endstop offset calibration
July 06, 2013 03:21PM
Thanks to all of you for working on this feature. I'm designing and building a number of deltabots (Cerberus, Cerberus-Pup and some other unreleased designs) and I'm really keen on implementing this feature.

@Repetier - I would be happy to help out with testing. Let me know if, and how I can help.

Steve Graber
3d.grabercars.com
Re: repetier firmware proposal for delta endstop offset calibration
July 07, 2013 07:24PM
I am building a Prisa i3, Repetier will this offset calibration be available for other types of 3D printers too???

Great work.
Re: repetier firmware proposal for delta endstop offset calibration
July 08, 2013 02:36AM
@wamaker This kind of calibartion makes only sense with the delta printer. For delta printer it is essential to have all endstops stop at the same height, or we get distorions.

For normal printers you can also configure an offset:
ENDSTOP_X_BACK_MOVE
ENDSTOP_Y_BACK_MOVE
ENDSTOP_Z_BACK_MOVE

but only with fixed values in the configuration file. The distance is how far the extruder goes back from the endstop after the endstop had it's final hit. I like to go away a few mm from the xy endstop, so it is not triggered by accident if I move along the x/y axis for x/y=0. For the z axis this make not much sense if the bed is leveled correctly, except perhaps the max endstop.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: repetier firmware proposal for delta endstop offset calibration
August 15, 2014 06:14PM
Quote
extent
And just for the curious, here is the entirety of my own dirty hack
[github.com]

It's manual deploy/retract, and it spits out estimated correction values to the log similar to PIDautotune rather than just making the fixes itsself. But it's got me to around +- 50 micron and tiding me over until the real release.

EXTENT! you are a genius! cool smiley.. Thank you very much for sharing your files, you solved my problem!!.. Thank you Thank you Thank you!
Sorry, only registered users may post in this forum.

Click here to login