(solved) G28 Error: Bad command
-
If you compare the example homing files here: https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files to what you have you'll see what I mean about missing S2 from your G1 moves that try to move an axis before it's been homed.
Also take care with G90 and G91 to ensure you're in the right coordinate mode for the moves you want to be doing. Do you want to go to Z5, or just move the bed by 5mm?
-
@karim Are you saying that if you home all, everything works fine but if you just want to home Z you get the error? It's a long time since I checked but it always used to be the case that you have to home X and Y before you can home Z, which makes sense if you use a probe.
-
@karim They way I fixed my homing files: In each added S2 to all movements that didn't involve the endstops, the S1 lines.
-
Here a video explaining what I am trying to say. This might be ok,
https://youtu.be/BKMrRjuZcC8 -
@karim So the homeall button turns red when you hit home z to indicate that the machine is no longer fully homed. If the home z were able to complete successfully, the homeall button would turn back to homed state.
Can you post the contents of homez.g as it is now?
-
; Home Z using the Z probe mounted on the X carriage'''
G91
G1 Z4 F200 ; raise head 4mm to keep it clear of the bed
G1 U429 F2000 ; make sure the U carriage is out of the way
G90
G1 X245 Y200 F2000 S2 ; move to bed centre for probing
G30 ; probe the bed and set Z height -
And if you change it to this, what happens?
G91 G1 Z4 F200 S2 ; raise head 4mm to keep it clear of the bed G1 U429 F2000 S2 ; make sure the U carriage is out of the way G90 G1 X245 Y200 F2000 S2 ; move to bed centre for probing G30 ; probe the bed and set Z height
-
@phaedrux said in G28 Error: Bad command: ''' Now home Z using the Z probe''':
G1 U429 F2000 S2 ; make sure the U carriage is out of the way
G1 U429 F2000 S2 ; make sure the U carriage is out of the way
S2 Make the U Axis goes into the endstop. Replace S2 to S1 fix that.Now Z axis works but something wired now, look at the video when homing Z axis, X axis move about 20mm then Z home.
;Home Z
G91
G1 Z4 F200 S2 ; raise head 4mm to keep it clear of the bed
G1 U422 F2000 S1 ; make sure the U carriage is out of the way
G90
G1 X245 Y200 F2000 S2 ; move to bed centre for probing
G30 ; probe the bed and set Z height; homeall.g
; called to home all axes
;
; generated by RepRapFirmware Configuration Tool v2 on Sat Dec 01 2018 16:55:23 GMT-0800 (Pacific Standard Time)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G1 S1 X-435 Y-400 U422 F3000 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 X5 Y5 F6000 ; go back a few mm
G1 S1 X-10 Y-10 U10 F360 ; move slowly to X and Y axis endstops once more (second pass);Now home Z using the Z probe'''
G1 X245 Y200 F2000 S2 ; move to bed centre for probing
G30 ; probe the bed and set Z height -
As I said before, you need to pay attention to G90 and G91
G90 moves to the absolute position on the bed
G91 moves the amount relative to the current locationSo for your home all it looks like you're still in relative positioning when you should be in absolute positioning to place the print head for probing Z
; homeall.g ; called to home all axes ; ; generated by RepRapFirmware Configuration Tool v2 on Sat Dec 01 2018 16:55:23 GMT-0800 (Pacific Standard Time) G91 ; relative positioning G1 Z5 F6000 S2 ; lift Z relative to current position G1 S1 X-435 Y-400 U422 F3000 ; move quickly to X and Y axis endstops and stop there (first pass) G1 X5 Y5 F6000 ; go back a few mm G1 S1 X-10 Y-10 U10 F360 ; move slowly to X and Y axis endstops once more (second pass) G90 ; absolute positioning ;Now home Z using the Z probe''' G1 X245 Y200 F2000 S2 ; move to bed centre for probing G30 ; probe the bed and set Z height
That should get your print head into the same location for both homeall and homez. Now that may not be the position you expect it to be in, but you can modify that by just changing the coordinates for both.
I suspect that your X endstop position is actually a bit off the side of the bed.
-
@karim said in G28 Error: Bad command: ''' Now home Z using the Z probe''':
;Home Z
G91
G1 Z4 F200 S2 ; raise head 4mm to keep it clear of the bed
G1 U422 F2000 S1 ; make sure the U carriage is out of the way
G90
G1 X245 Y200 F2000 S2 ; move to bed centre for probing
G30 ; probe the bed and set Z heightI think I got now. Machine Status shows X185 Y210
;Home Z
G91
G1 Z4 F200 S2 ; raise head 4mm to keep it clear of the bed
G1 U422 F2000 S1 ; make sure the U carriage is out of the way
G90
G1 X185 Y210 F2000 S2 ; move to bed centre for probing
G30 ; probe the bed and set Z height -
Thank you. This was driving me nuts.