Precision Piezo z probes guide for duet users reference
-
Hi,
I have a D-BOT coreXY (30x30x30cm), i've purchased the precise piezo last week and it is on its way.
While i'm waiting for it i want to prepare the firmware.
So in Z probe section of config.g i've put the digital code:M558 P5 I0 R0.4 F300 X0 Y0 Z1 ; Digital Z probe, also used for homing the Z axis G31 X0 Y0 Z-0.1 P100 ; Set the probe height
i would like to use the piezo also for the z home in z min so i put "Z1 in M558".
These are my homez.g and homeall.g:
;********************************** ;homeall.g ;homing using a x-MIN, Y-MAX and z-MIN endstops ;********************************** G91 ; relative mode G1 Z4 F400 ; lowers bed 4mm to avoid dragging nozzle over the bed G1 S1 X-340 Y340 F2000 ; move 340/340mm in -X (x endstop is MIN) and +Y(y endstop is MAX) G1 S1 X-340 ; course home X G1 S1 Y340 ; course home Y G1 X4 Y-4 F500 ; move away from the endstops G1 S1 X-10 ; fine home X G1 S1 Y10 ; fine home Y G1 Z4 F200 ; lowers bed 4mm to avoid dragging nozzle over the bed G90 ; back to absolute mode G1 X150 Y150 F4000 ; put head over the centre of the bed, or wherever you want to probe G30 ; probe G91 ; relative mode G1 Z4 F50 ; move slowly 4mm in the +Z direction G90 ; back to absolute mode G30 ; probe
;********************************** ; homez.g ;homing using a z-MIN endstop ;********************************** G91 ; relative mode G1 Z4 F200 ; lowers bed 4mm to avoid dragging nozzle over the bed G90 ; back to absolute mode G1 X150 Y150 F4000 ; put head over the centre of the bed, or wherever you want to probe G30 ; probe G91 ; relative mode G1 Z4 F50 ; move slowly 4mm in the +Z direction G90 ; back to absolute mode G30 ; probe
and in my starting code i put this to perform the bed leveling/compensation:
M561 ; Cancel any existing bed compensation by sending M557 X10:290 Y10:290 S40 ; Define the probing grid G29 ; Probe the bed and save height map to SD ;M190 S[70] ; i don't have a bed heater M109 S130 ; set 130 extruder temp G28 ; home axes
Is this correct or i have to change something?
Any advice and suggestions will be greatly appreciated -
Looks okay to me, but then I'm not so good at just eyeballing it and spotting errors, just use low motor current at first so any crashes just stall the z motor, not do any damage. And tune the piezo carefully, so that a gentle tap up triggers it, and you see the trigger on DWC screen in Z-probe box goes red and says 1000.
The do G30 with nozzle way above the bed, tap up with your finger or a tool, to make sure the firmware registers triggered and reacts to it before trying it on your bed.
Then hit home all and go from there. But I'd say you are well prepared.
-
I don't have a Piezo probe so can't comment on your homez.g but your homeall.g file has errors related to homing Y.
I note that the Y end stop is at Y max so the course homing part is fine but after this:
G1 S1 Y340 ; course home Y
you have this:
G1 X4 Y4 F500 ; move away from the endstops
G1 S1 X-10 ; fine home X
G1 S1 Y-10 ; fine home YIn the first line above you want to move Y away from the end stop but it's already at max (Y=340 from the previous course home) so to move it away from the end stop, you need to move it negative i.e G1 X4 Y-4 F500 (Y minus 4)
Then you have G1 S1 X-10 which is fine but G1 S1 Y-10 is wrong as it'll be moving away from the end stop so it needs to be G1 S1 Y10 (no minus sign).What will happen if you don't correct this is that course homing will work fine, then fine homing of X will work but after that, Y will move slowly away from the end stop (towards you) and keep going for ever (or at least until something nasty happens).
HTH
-
Ok, thank you! I have edited the homeall.g code.
When the piezo arrive i will edit all the code so it can maybe help someone else and use it for a starter point. -
I'm wanting to replace my Z axis home switch on my CoreXY, Z home's at the top.
M558 P0 X0 Y0 Z0 H5 F120 T6000
I think I need the following in my config.g,
M558 (P1/P5) I1 R0.4 F300 X0 Y0 Z0 G31 X0 Y0 Z-0.1 P600
I'm using the v2 PCB in a NC configuration. I'm also unclear what the difference is between the analog/digital and what it is used for? Does the board still need to be tuned in a digital usage or is that irrelevant?
I also am a little confused on the homing sequence. I think I need to home X/Y then move to the center of the bed and run a G30, is this correct?
Appreciate some help.. thanks.
ampapa,
-
You need to tune the PCB first whatever method you use this sets up the pcb to trigger when the nozzle is tapped. This sets up the sensor itself. If it's the v2 kit it triggers active low I1 if it's the Piezo20 unit it triggers active high I0 in M558.
Next step is setup how your printer will use this information.
Analogue mode (not present on most other lesser 3d printer controllers) allows you to set a threshold, if you are over it the firmware considers the z probe triggered, so you can use M558 P1…... As you have shown. Set the threshold for 500 and see how you go, you can raise it or lower it to change sensitivity. You can see the current value in the Z-probe box on DWC or paneldue.
You can also make it more or less sensitive on the piezo pcb read the instructions see www.precisionpiezo.co.uk on how to do it as this is not duet/RRF specific but applies to any setup.
Digital mode P5 is how most other 3d printer controllers run endstops and sensors either on or off. In this mode a change from 0v to more than 1.65v on the z probe signal wire (or 3.3v to less than 1.65v if using active low mode) will be considered a trigger (its probably more complicated than that but that's the gist of it). So use this mode if you prefer (I do). If using P5 then there is no adjustable threshold, as the threshold is fixed, as described above. But you can debounce the signal by filtering it slightly and that's what the G31 Pxxx refers to when P5 mode is chosen in M558. 100ms seems to be the right value.
There is also a P8 mode on 1.20 firmware which removes filtering and is digital like P5, so that you get more precision, once you have got your system working smoothly using P1 or P5 try it instead, but you'll only notice the improvement when doing sensor testing and using high microstepping.
-
Thanks for the quick feedback DjDemon.
I ran a first test with the unit and it seems to be working correctly.
In my homing files (homez/homeall) what would that look like now, something like the following?
ORIGINAL homez.g
G91 ; Relative positioning G1 Z-350 S1 F300 ; Move Z down until the switch triggers G1 Z2.5 F300 G1 Z-5 S1 F150 ; Move Z down until the switch triggers G1 Z2.5 F150 G90 ; Back to absolute positioning G92 Z2.5 ; Tell the firmware where we ar
NEW homez.g
G91 ; relative mode G1 Z4 F200 ; lowers bed 4mm to avoid dragging nozzle over the bed G90 ; back to absolute mode G1 X150 Y150 F4000 ; put head over the centre of the bed, or wherever you want to probe G30 ; probe G91 ; relative mode G1 Z4 F50 ; move slowly 4mm in the +Z direction G90 ; back to absolute mode G30 ; probe G1 Z2.5 F150 G90 ; Back to absolute positioning
EDIT
Just wanted to close the loop on this and post my working Z homing file.
G91 ; relative mode G1 Z4 F400 ; lowers bed 4mm to avoid dragging nozzle over the bed G90 ; back to absolute mode G1 X40 Y265 F4000 ; put head over the center of the bed, or wherever you want to probe G30 ; probe G91 ; relative mode G1 Z4 F150 ; move slowly 4mm in the +Z direction G90 ; back to absolute mode G30 ; probe G1 Z2.5 F150 ;Move Z to 2.5 above the bed G90 ;back to absolute G1 X0 F4000 ;move to X0
-
Yes that should work.
-
One additional follow up question on setting the Z axis positioning.
[c]G31 X0 Y0 Z-0.1 P600[/c]
If the piezo is effectively able to find Z=0 then why the need for an offset in the config.g file? Is this to force the probe to go below the bed surface?
When the probe touches the bed surface shouldn't that effectively be the Z=0, no offset is needed from that point forward?
-
Great question. If the probe could do it's job with 0.1g of force then you'd be right z=0 would be 0mm above the bed. But it takes about 10g-15g which means the piezo disc deflects about 0.1-0.15mm before triggering. Effectively it triggers below the bed. So the offset is -0.1mm to -0.15mm.
The good news is that it's consistent so determine your offset by babystepping your first layer until it's perfect (assuming really good extruder calibration) then reverse the sign and change your G31 offset. So if you babystep up 0.05 then subtract 0.05 from G31 Z and vice versa.
-
After homing, assuming I'm using -.01 as posted above my control panel shows Z at -0.1 that assumes a deflection of the piezo if I understand you post correctly. The -0.1 is then adjusted based on baby stepping and printing of the 1st layer and ultimately could be less or more and that actual number should be reflected in the config.g file, correct?
So in Slic3r I need a Z offset that reflects that actual number +/-… I think I understand.
Thanks,
-
So if the offset is -0.1 in G31 after homing your DWC/paneldue/M114 will show Z=0, but the actual nozzle will be either too close or too far away from the bed.
You then babystep on your first print, record the amount you babystepped then reverse the sign and add it to the G31 offset. I use the first layer solid infill as my visual guide, if its got lines between the extrusion then its too high, if it piles up its too low, but this method relies on precise extruder calibration (and a precise extruder) to be accurate.
So just to be super clear
When its too low and you have to increase gap between nozzle and bed.
Initial G31 Z Offset -0.1
Babystep Amount 0.05 (up)
New G31 Z offset -0.15When its too high and you have to decrease gap between nozzle and bed.
Initial G31 Z Offset -0.1
Babystep Amount -0.05 (down)
New G31 Z offset -0.05If you prefer you could put feeler gauges under the nozzle and measure it that way, or jog up and down and measure it. But if its too low this isn't going to be practical.
-
I have a bit of a SNAFU on my install. in the DWC it reads 1000 in red. when I use a meter on the PCB it reads the opposite of what is listed in the directions. the Positive reads 10 Kohms and the Negative reads 4.4 Mohms.
M558 P1 I1 R0.8 F300 X0 Y0 Z0 H5 F120 T6000 ; Set Z probe type to unmodulated, the axes for which it is used and the probe + travel speeds
G31 X0 Y0 Z-0.1 ; Set Z probe trigger value, offset and trigger height
M557 X40:285 Y20:310 S20 ; Define mesh gridon the Duet board I am plugged into the Z-Probe spot +3.3, GND and Z Probe IN
-
Use P5 (or P8 if you are on a recent firmware) and use E0 endstop input, also set Z to 1:
M558 P8 I1 R0.8 X0 Y0 Z1 H5 F300 T6000 (use I0 if you are using a v1 board)
-
I have it set like in your example, except for the Z1. I don't plan to use it to home since my hot-end parks off to the side and doesn't touch the bed. Just to clarify, you are using the E0 endstop for all the wires, and not the Z-probe socket on the board beside the Panel Due socket?
-
Hi guys sorry for the slow response. Using the z probe connector is no issue. If the DWC or paneldue shows 1000 when the probe is open/untriggered, then just change the M558 I parameter from I1 to I0 or vice versa.
What version of piezo device are you using? If correctly set up (red light on until triggered) a V2 universal kit board will output an active low signal (also called NC or inverted 3.3v open and nearer to 0v triggered). This offers failsafe operation in that a wire break between piezo pcb and the duet controller will show as triggered and therefore avoid a head crash. Upcoming versions of the piezo PCB (anything with V2) will work this way. Use I1.
Currently, Piezo20 PCBs (which are v1) and the original V1.x universal kit PCBs operate with the blue LED off when open, it comes on momentarily when triggered, these devices, are active high (NO or 0v open and 3.3v triggered). Use I0. No failsafe, so when commisioning, use low motor current to avoid head crash issues.
You can set up a v1 universal PCB inverted by moving VR2 until its just past the point where the blue LED comes ON and leaving it there, use I1 in this mode. But please DO NOT set up a Piezo20 PCB (the small one with one piezo connector) in this mode as it might burn out the blue LED (although this is less likely with 3.3v than with 5v.
The piezo20 PCB piezo connector is wrongly labelled, so ignore the + and -, however this sometimes has to be the case as not every piezo disc is correctly polarised. The only reliable test (without a scope) is to push up on the nozzle (or down on the bed for underbed) not tap, and see if it triggers when you push. Then release the pressure, see if it triggers when you release. If it triggers on push it's correct, if it triggers on release its the wrong polarity, just turn the piezo disc plug to the piezo PCB the other way, retune and try again. If it helps when I build the ready-to-run units using genuine Murata 7bb piezos the black lead from the piezo goes to the upper pin (nearest the outside of the PCB), most of the time, but occasionally I find an inverted piezo disc.
-
I have an odd issue in that if I have anything connected to the VIN pin on any endstop or the probe connector the duet becomes unresponsive until I unplug the VIN wire regardless of using the VIN pin on the z endstop connection or the z probe connection. Any ideas?
-
Sounds to me like you have the polarity on youre piezo board not in the right order,
please check if you got the signal and graund the right way around.mfg
Kai -
Double check wiring. On current generation piezo pcbs the wires at the Piezo PCB:
Vin - Red - positive (3-5v)
SIG (also labelled TRG) - green
GND - Black - negative - 0vAt the Duet (four pin plug) it goes
VIN RED
BLANK
GND BLACK
SIG/TRGWith the red Vin towards the sd card slot end of the duet board.
Please be aware standard endstop cables have GND and SIG the other way around. I swap them over when shipping (it's very tedious). We also leave the controller board end unwired to ensure that full attention is given to putting the wires in the right pins as every controller is different.
We are bringing a new generation of boards out this year which have the wiring as per the standard endstop cable, much less work, but will cause confusion for upgraders who will need to reconfigure their cable.
-
seems to be an issue unique to my duet board because when testing with another sensor (dc42 ir sensor) the same issue occurs. Also tested with an inductive sensor and the same problem. If I use the 3.3v VIN on any endstop pin or the z probe pin on the duet I end up with the board dying (for lack of a better explanation) until I unplug the wire from whatever 3.3 VIN port its connected to.