G Code Issue with TronXY X5SA

So yesterday I printed the sample print that came with my printer. And I was happy with the result.
So, today I tried to print my first models that I made, and sliced using Cura 5.6.0.

The first issue was the nozzle was not heating. And I managed to find the start g-code to solve that problem.

But now when I try to print, it is not picking up the Z offset, or it is not reading the z sensor, and so it is hitting the z axis limit switch (modified as per recommendations).

Could someone help with this G-Code issue please?

; X5SA Start Code

G21; Set units to millimeters

G90; Set all axis to Absolute

M82

;

; Uncomment the line below to enable ABL Mesh probing

G29 ; Probe bed mesh for ABL

; For best results do not run nozzle heater while performing ABL

M107 T0; Disable all fans

M140 S{material_bed_temperature_layer_0}

M104 S{material_print_temperature_layer_0} T0

M190 S{material_bed_temperature_layer_0}

M109 S{material_print_temperature_layer_0} T0

G28; Home all axis

G1 Z15.0 F6000; Raise nozzle to prevent scratching of heat bed

G1 X0 Y0 ; Move nozzle to Home before heating

G0 E3 F200

G92 E0 ; Set Extruder position to zero

; Uncomment the following lines to enable nozzle purge line along left edge of bed

;G1 Z2.0 F3000 ; Raise Z axis

;G1 X1.1 Y20 Z0.2 F3600.0 ; Move to purge line start position

;G1 Y220 F1500.0 E10 ; Draw first purge line

;G1 X1.4 F3600.0 ; Move to the side

;G1 Y20 F1500.0 E20 ; Draw second purge line

;G92 E0 ; Reset Extruder

;G1 Z2.0 F3000 ; Move Z Axis up a little to prevent scratching of Heat Bed

;G1 X5 Y20 Z0.2 F3600.0 ; Move over to finish nozzle wipe

;G92 E0

Can you past the start of the gcode for the file that worked? That will make it clear how they expect the printer to be initialized.

This seems to be the right bit of the working code… I included some from the beginning, just in case there was something hidden in the hex strings…

M4010 I12678 T395 ‘6b6d300fce7930376b6d300dce7930046b6d300fce7930106b6d300bce79301b6b6d3003ce7930196b6d3011ce596b6d300ece7930136b6d3008ce79301b6b6d3007ce7930146b6d3020ce7930186b6d3004ce79301b6b6d300b’
M4010 I13073 T152 ‘ce7930106b6d3020ce79301b6b4dce79301b6b6d300ece79300d6b6d3016’
;FLAVOR:Marlin
M2100 T1447
;Filament used: 0.977854m
;Layer height: 0.1
;Generated with Cura_SteamEngine 3.2.1
M82 ;absolute extrusion mode
G21
G90
M82
M107 T0
M140 S40
M104 S200 T0
M190 S40
M109 S200 T0
G28
G92 E0
G1 Z15.0 F6000
G0 E3 F200
G92 E0
;LAYER_COUNT:199
;LAYER:0
M107
G0 F3000 X156.294 Y156.294 Z0.3
;TYPE:WALL-INNER

just in case I have screwed anything up, I am just reinstalling Cura 5.6.0… I did try a simple cut and paste of the start g-code… But as the working model was sliced using 4.8.0, it just sat there, so I am missing something. I have spent years in blessed ignorance of G-Code, as I usually only work with the hardware. I know it exists in the same way I know the Higgs boson exists, and my working knowledge of both is about the same :rofl:

I should also mention that I have not updated the firmware yet, as I thought I should get it running with the original firmware before changing even more things…

M4010 is for a picture of the part.

Here’s the Marlin gcode reference:

I note that the working gcode doesn’t G29 to do automatic bed leveling at all. And G29 is three-point automatic bed leveling which requires three independent Z axes, which you don’t have on this printer.

The good news is that if you synchronize your two Z axes with a belt, you’ll never get out of sync and never get out of level, and G29 is just a waste of time. :grin:

OK, I think I am beginning to understand… So the Auto levelling on my printer is effectively a standalone function, not related to the slicer. Therefore it does not need to be enabled in the start-up G-Code.

So it would appear that for whatever reason, when the printer is moving to the start coordinates to print, it is not removing the z offset when I slice my own models, but it is removing the z offset on the supplied model.

I am right in that assumption? (and yes, I do try never to assume anything :rofl: But I need to start somewhere…

I was wrong. G29 is interpreted differently depending on configuration, so I think it does apply to this printer:

Sorry about that; I’ve done this only with Klipper, not with Marlin.

But you probably don’t need to do it on each print, especially after you move to synchronized axes.

You really want to get your bed trammed (“level”), and two unsynchronized motors will get out of sync. If your bed isn’t trammed to the Z axis, you will print parts with skew.

Bed mesh probing/compensation is for the bed not being flat. Once you have the bed trammed, then 3D printing is very sensitive to variations in layer thickness. You either need a very flat bed (e.g. using cast tool plate) or you need to probe the bed, build up a model of how unflat it is, and compensate somehow for its lack of flatness.

But your bed is only going to change its shape if you heat it to different temperatures. So you can probably probe once and store that and just use it, once you get the axes synchronized.

So, with regard to my hitting the nozzle issue, part of it that I am an absolute Muppet.

I did not notice that when the bed is taken to print height using the working model, it measures the height in the centre of the bed.

With the gcode that crashed the bed into the nozzle, it is measuring at the front left corner, so the level sensor is missing the bed altogether.

I need to find the gcode to take the sensor to the centr of the bed before measuring the z axis height…

I am going to look at the g code library again, And try to find the command, but if anyone knows the code to return the head to the centre, i would be very grateful if you would share it…

On klipper (which you don’t have) it’s just setting safe_xy_position in the safe_z_home section of the config file and restarting klipper.

In Marlin, that’s a compile time option:

I don’t know whether this can be overridden at run time. Marlin config changes often require rebuilding the firmware.

Oh, you are trying to use G29 before G28. I think that just using G28 is fine, as evidenced by the working print from the gcode they shipped.

So, a friend of mine who has a lot of experience came over. we both started out printing on my replicator mk1🤣

I always looked at 3d printers as way to perform rapid prototyping and to play with concepts. But the whole world of printing captured my friend, and he is now far better at building these things than I am. Incidentally he was the one who introduced me to Arduino. And I have out paced him in this field…

Anyhow, I ramble…
I am pleased to say that he could not make it work (makes me feel better :rofl:)

So he uninstalled it, installed 4.8 in the same way I tried, using the same settings as were set in 5.6, he did exactly what I did, and now it works perfectly. Even though we cannot see any difference between setups or, in fact, when we look at the saved GCode file, we cannot see any difference. But it now works, with the nozzle being in position, z-axis offset.

How? Why, what and logic all seem to not only out for lunch, but to have done a runner from the restaurant.

I have no idea what is going on, but other than the syncing the z axis once Amazon have brought a couple of pulleys and a drive belt, i have finished printing a belt tensioner or two, all I have is the simple job pressing slice on my designs… And if I want to print with exotics inside a heated enclosure, or some other such activities.he tells me what to buy or build, and then I install it, or make and install it, and he will come over and do the settings :grin:. He will also teach me.:+1:… Thank you all for reading and or helping.
The only accurate diagnosis was something was doing something.

I think it was something dark and mysterious that men and dogs and some birds were not to wot of.

My next post on this will be accompanied by me clicking on the solved button when I reply…

I sent a support ticket to Tronxy and they have responded by sending me the correct start and stop G-Code

I am now at home, and so I cannot screenshot the whole q-code, but I will post it all in it’s entirety when i get back to work in the morning :grin:

1 Like

So, When I got my TronXY X5SA Pro, I was having horrific problems trying to get the unit to start printing with Cura 5.6.0
The bed constantly crashed into the head. Although the sample part included on the SD card worked perfectly. So, after a little while, I managed to get Cura 4.6.0 working with the help of a friend. But I have had a reply from TronXY. Unfortunately, as I am currently have a huge amount of printing waiting to be done for a work project, I have not wanted to lose time playing with the slicer settings but I thought I would post the (Hopefully) solution here.

change the start code to this :
; Start Code
G21
G90
M82
M107 T0
M140 S{material_bed_temperature_layer_0}
M104 S{material_print_temperature_layer_0} T0
M190 S{material_bed_temperature_layer_0}
M109 S{material_print_temperature_layer_0} T0
G28
G92 E0
G1 Z2.0 F3000 ; Move Z Axis up little to preventscratching of Heat Bed
G1 X15 Y20 Z0.3 F3600.0 ; Move to start position
G1 X15 Y140.0 Z0.3 F1500.0 E25 ; Draw the first line
G1 X15.6 Y140.0 Z0.3 F3600.0 ; Move to side a little
G1 X15.6 Y20 Z0.3 F1500.0 E50 ; Draw the second line
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X15 Y20 Z0.3 F3600.0 ; Move over to prevent blob squish

change end code to this.
M107 T0
M104 S0
M104 S0 T1
M140 S0
G92 E0
G91
G1 E-1 F300
G1 Z+5 E-5 X-20 Y-20 F9000
G28 X0 Y0
M84 ;steppers off
G90 ;absolute positioning

Once I have got my current ‘print queue’ finished, I will have time to try these, and will give an update then. I do apologise for not posting this earlier, but I am currently making some quite large control box housings and control panels. I am even having to sleep in my office as the four largest prints are taking between 1 1/2 to 2 1/2 days each. Although everything I have printed fits together really well and all in all I am quite pleased with the printer.

5 minutes, and I shall let you all know if this is correct!! :hand_with_index_finger_and_thumb_crossed:

You need to do the G28 BEFORE the G29
Also, at least MY X5SA wants M83 relative filament extrusion, not absolute.

This script warms everything, does an ABL on a HOT Bed, then goes OFF the bed and extrudes a LOT to clear the big shutdown retraction, and then does the standard “draw a line” Prime.

I use the Glass Tronxy Surface with Hairspray. If I get the Z-Offset right it is happy for DAYS…

My startup for a X5SA-2E follows:

G28 ; home all axes
M104 S210 T0; set and DON’T WAIT
M190 S60 ; Set and WAIT for Bed to Heatup
G92 E0 ; reset Extruder
G29 ; Build new Mesh on HOT Bed
M420 S1 ; re-enable Leveling
M83 ; E relative
G92 E0 ; reset extruder
M211 S0 ; Dissable Software Endstops so can go off Bed
G1 X340 Y0 Z20 F5000 ; Move to corner where nozzle is just off bed
M109 S[extruder0_temperature] ; Wait for Nozzle temp
G1 E50 F500 ; Squirt on Bed corner 50mm
M211 S1 ; turn endstops back on
G1 X5 Y5 F6000 ; move to prime
G1 Z0.3 F3000 ; get ready to prime
G92 E0 ; reset extrusion distance
G1 X120 E20 F600 ; prime nozzle
G1 X140 F5000 ; quick wipe