Welcome! Log In Create A New Profile

Advanced

How to set custom home position and drive directions

Posted by oBezruki 
How to set custom home position and drive directions
March 30, 2023 11:06PM
Hey everyone!

I have come back to RepRap from Klipper, and I would always flip the Y axis on my prints while using RepRap because my limit switches are at XMIN, YMAX and ZMIN. Its a printer I retrofitted with opensource hardware and used as much of the original components as I could.
In Klipper I was able to set my drive to move in its normal direction, as well as the end stop being my max, but I cant seem to get it to work quite right in RepRap.

Currently when homing the Y drive moves towards the endstop, and homes as it should, showing my axis maximum, but as soon as I attempt to travel toward the minimum, it will crash and skip at the endstop, showing a value lesser than my set maximum.
But if I reverse the drive direction it will not go towards the end stop.

I've attempted to search a few things for the past hour or so now, and I've also been looking through the G-Code dictionary for some results and turned up nothing.

I'm sorry if it's an easy fix and its something simple I'm missing, I'm not very good at the programming part of this.

(Pic of my retrofit build for fun smiling smiley )

Thanks!!!
Attachments:
open | download - IMG_0091.JPG (3.61 MB)
VDX
Re: How to set custom home position and drive directions
March 31, 2023 01:40AM
... you can use G92 to set any desired position - with "G92 X0 Y0 Z0 E0" the actual position will be home with resetted extruder ... any other numbers will set to the specified position - so you can for example home at a corner/edge, but set the new home position to the center of bed ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: How to set custom home position and drive directions
March 31, 2023 11:32AM
So I would have to add the G92 code X0 Y290 Z0 to my config? Or just my homing macros?
VDX
Re: How to set custom home position and drive directions
March 31, 2023 01:52PM
... a homing macro ist enough - after execution this position ist stored after next G92 oder restart.

You can define the virtual home-position in the configuration file too - then the firmware "knows" the offset-positions of the switches and sets 0-position after the G28 homing commando on its own.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: How to set custom home position and drive directions
March 31, 2023 09:30PM
I can get the machine to make my home position X0 Y290 Z0 however the same problem still persists, I can only add positive values or it will crash into the frame.
I cant simply reverse the direction of the drive either because the endstop is at YMAX, when flipped it homes in the wrong direction
VDX
Re: How to set custom home position and drive directions
April 01, 2023 01:58AM
... then maybe you have to redefine moving directions and switch positions (MIN/MAX).


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: How to set custom home position and drive directions
April 02, 2023 09:46AM
@oBezruki when you say RepRap do you mean you are running RepRapFirmware, or are you actually running Marlin? If you are running RepRapFirmware then please post your config.g and homing files.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: How to set custom home position and drive directions
April 02, 2023 01:30PM
Hi DC42!


Yes I'm running RepRap Firmware 4.3.5, please find the configs copied below.

Thanks,
Jake









; Configuration file for Duet WiFi (firmware version 3.3)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.3.10 on Fri Jan 21 2022 22:14:04 GMT-0500 (Eastern Standard Time)

; General preferences
M575 P1 S1 B57600 ; enable support for PanelDue
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves
M550 P"Cube Pro Duo" ; set printer name

; Input/Output

M581 P2 S0 T2 R0 ; Maintenance POS - PIN 4 - trigger2.g
M950 J2 C"!^exp.4" ; Input 1 uses pin 4, inverted, pullup enabled

M581 P3 S0 T3 R0 ; Preheat - PIN 9 - trigger3.g
M950 J3 C"!^exp.9" ;Input 2 uses pin 9, inverted, pullup enabled

M581 P4 S0 T4 R0 ; Home All - PIN 14 - trigger4.g
M950 J4 C"!^exp.14"

; Network
M552 S1 ; enable network - Set Static IP
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet

; Drives
M569 P0 S1 ; physical drive 0 goes forwards
M569 P1 S1 ; physical drive 1 goes forwards
M569 P2 S0 ; physical drive 2 goes backwards
M569 P3 S0 ; physical drive 3 goes backwards
M584 X0 Y1 Z2 E3 ; set drive mapping
M350 X16 Y16 Z16 I0 ; configure microstepping without interpolation
M350 I1 ; configure microstepping with interpolation
M92 X87.90 Y87.90 Z1066.67 E82.89 ; set steps per mm
M566 X1000.00 Y1000.00 Z12.00 E600 ; set maximum instantaneous speed changes (mm/min)
M203 X4000.00 Y4000.00 Z1200.00 E1800 ; set maximum speeds (mm/min)
M201 X200.00 Y200.00 Z250.00 E500.00 ; set accelerations (mm/s^2)
M906 X800 Y800 Z800 E800 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout

; Axis Limits
M208 X0 Y0 Z-0.3 S1 ; set axis minima
M208 X280 Y290 Z190 S0 ; set axis maxima


; Endstops
M574 X1 S1 P"!xstop" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin !xstop
M574 Y1 S1 P"!ystop" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin !ystop
M574 Z1 S1 P"!zstop" ; configure switch-type (e.g. microswitch) endstop for low end on Z via pin !zstop

; Z-Probe
M558 P0 H5 F0 T6000 ; disable Z probe but set dive height, probe speed and travel speed
M557 X15:215 Y15:195 S20 ; define mesh grid

; Heaters
M308 S0 P"e0temp" Y"thermistor" T117500 B4138 ; configure sensor 0 as thermistor on pin e0temp
M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0
M307 H0 B0 R0.298 C756.7 D2.36 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit
M140 H0 ; map heated bed to heater 0
M143 H0 S120 ; set temperature limit for heater 0 to 120C
M308 S1 P"e1temp" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin e1temp
M950 H1 C"e1heat" T1 ; create nozzle heater output on e1heat and map it to sensor 1
M307 H1 B0 R2.782 C148.1 D5.24 S1.00 V23.7 ; disable bang-bang mode for heater and set PWM limit
M143 H1 S280 ; set temperature limit for heater 1 to 280C

; Fans
M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency
M106 P0 C"Part Cooling" S0 H-1 ; set fan 0 name and value. Thermostatic control is turned on
M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency
M106 P1 C"Heat Sink (F1)" S1 H1 T45 ; set fan 1 name and value. Thermostatic control is turned on
M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency
M106 P2 C"Board Fans" S1 H1 T100 ; set fan 2 name and value. Thermostatic control is turned on

; Tools
M563 P0 S"Extruder 1" D0 H1 F1:0 ; define tool 0
G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C

; Custom settings are not defined

; Miscellaneous
M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss
T0 ; select first tool




HOME Y


; homey.g
; called to home the Y axis
;
; generated by RepRapFirmware Configuration Tool v3.3.10 on Fri Jan 21 2022 22:10:44 GMT-0500 (Eastern Standard Time)
G91 ; relative positioning

G1 H2 Z5 F6000 ; lift Z relative to current position
G1 H1 Y-300 F54000 ; move quickly to Y axis endstop and stop there (first pass)
G1 H2 Y5 F6000 ; go back a few mm
G1 H1 Y-300 F360 ; move slowly to Y axis endstop once more (second pass)
G1 H2 Z-5 F6000 ; lower Z again
G90 ; absolute positioning
Re: How to set custom home position and drive directions
April 02, 2023 01:43PM
Okay I have made some progress by just seeing the code I posted, I changed the G1 H1 Y300 F54000, and reversed my drive direction, additionally used G92 to set my position to Y290 after it homes. the printer is now doing what I want it to.
However, when homing it just crashes into the frame and stops after a few skipped steps. The only thing I changed was the -300 to 300 value and added the set position at the end. It does this for both homing actions.



; Drives
M569 P0 S1 ; physical drive 0 goes forwards
M569 P1 S0 ; physical drive 1 goes BACKWARDS
M569 P2 S0 ; physical drive 2 goes backwards
M569 P3 S0 ; physical drive 3 goes backwards
M584 X0 Y1 Z2 E3 ; set drive mapping
M350 X16 Y16 Z16 I0 ; configure microstepping without interpolation
M350 I1 ; configure microstepping with interpolation
M92 X87.90 Y87.90 Z1066.67 E82.89 ; set steps per mm
M566 X1000.00 Y1000.00 Z12.00 E600 ; set maximum instantaneous speed changes (mm/min)
M203 X4000.00 Y4000.00 Z1200.00 E1800 ; set maximum speeds (mm/min)
M201 X200.00 Y200.00 Z250.00 E500.00 ; set accelerations (mm/s^2)
M906 X800 Y800 Z800 E800 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout




; homey.g
; called to home the Y axis
;
; generated by RepRapFirmware Configuration Tool v3.3.10 on Fri Jan 21 2022 22:10:44 GMT-0500 (Eastern Standard Time)
G91 ; relative positioning

G1 H2 Z5 F6000 ; lift Z relative to current position
G1 H1 Y300 F54000 ; move quickly to Y axis endstop and stop there (first pass)
G1 H2 Y5 F6000 ; go back a few mm
G1 H1 Y300 F360 ; move slowly to Y axis endstop once more (second pass)
G1 H2 Z-5 F6000 ; lower Z again
G90 ; absolute positioning
G92 Y290






; homeall.g
; called to home all axes
;
; generated by RepRapFirmware Configuration Tool v3.3.10 on Fri Jan 21 2022 22:10:44 GMT-0500 (Eastern Standard Time)
G91 ; relative positioning
G1 H2 Z5 F6000 ; lift Z relative to current position
G1 H1 X-285 Y-300 F54000 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H2 X5 Y5 F6000 ; go back a few mm
G1 H1 X-285 Y-300 F360 ; move slowly to X and Y axis endstops once more (second pass)
G1 H1 Z-195 F360 ; move Z down stopping at the endstop
G90 ; absolute positioning
G92 Y290 Z0 ; set Z position to axis minimum (you may want to adjust this)

; Uncomment the following lines to lift Z after probing
;G91 ; relative positioning
;G1 Z5 F100 ; lift Z relative to current position
;G90 ; absolute positioning
Re: How to set custom home position and drive directions
April 03, 2023 03:06AM
Please post the whole config.g file, in particular we need to see the M574 commands that configure the endstops.

You can test the endstops, either by enabling and opening the Object Model Browser in the Web interface and expanding the "sensors" key, or using the M119 command.

For faster response to questions about RepRapFirmware post your question at [forum.duet3d.com].



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

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

Click here to login