Custom G28 command

Hi. I want to take full advantage of some slic3r features, one of them the ability to use a custom bed shape. For that I need some custom homing routine. I can do it inside slic3r since it lets me customice the start Gcode to be use at the beginning of the print. But it daesnt work if I use the plate contro, and issue a "home all" command since it uses the G28 command from the firmware.

So my question is: is it posible to mdify the G28 command inside the firmware so every time I invoque it it executes my custom homeing routine?

Thanks in advace


  • Sure. It is open source and homing in defined in Printer.cpp - Just write your own version or modify existing. Also I do not see the rerquirement even with a different bed shape. Homing is about getting a defined position and is independent on bed shape.
  • Imagine you have a bed of 22X22 cms, and you want to take full advantage of it, you want to use hole bed. But in the corners of the bed you have a screw. If you configure the bed shape to have 22X22 cms, at the moment of usueing a G28 command, the noozle will chrash against the screw located in the 0.0.0 position
    In slic3r you can define a custom bed shape annd so you can draw a bed shape of 22X22 cms  and little "no print areas" in the corners (where the screws are located), and slic3r will avoid those areas, so no problem there. But still if you issue a G28 command, you will have a crash

    So my intention is to have a G28 command that does this: home X and moves 10, home Y and move 10 (this way Im sure the noozle is out of the corner area where there is a screw) and finally issue a Z home.
    Since Im not a coder, can someone tell me how to modify the printer.cpp file to achieve this behaviour?
    Thanks in advance
  • Your logic will fail for some special cases where y is on height of scrow and z is low enough.

    There is a homing case ZTXYZ whcih is what you might try. It does z homing, goes to a higher height and then homes xy and afterwards goes to a predefined xy position. Set homing temperature to 0 in that case. With z being above screws for homing you avoid hitting the screws. Only drawback is that you end up at homing height (also I see this as advantage) and first z move will the move it to correct height.
Sign In or Register to comment.