Posted on Leave a comment

Setup E3D Chimera/Dual Head on Duet WiFi/RepRapFirmware – and watercooling intro

Some time ago I bought the, at the time, new E3D Chimera+ Watercooled hotend and some extra stuff for it.


(sorry, misplaced photo of unpacked new Chimera+. I’ll see about digging some up!)

I’ve had a bit of issues getting it up and running as the first pump/Reservoir combo I bought from China didn’t work.

A reservoir is just a container where extra water is stored to make sure the system doesn’t run low. It also makes it easier to fill up and maintain, and catch the air/bubbles the bubbles you always have in a new watercooled setup. All of these things can be done without a reservoir, but it makes it a lot easier to get going and easier to maintain and keep a look on waterlevel.

I’ve done a lot of custom watercooling on computers, servers and rack equipment (yes, you can watercool a switch and U1 server), so went into the basement to find some spare equipment.

So, why did I buy a Chinese pump when I allready had a lot of watercooling equiptment the smart reader might ask, and the answer is simply that I figured my pumps were far too powerfull, and yes, they were still too powerfull when I looked at them again, hehe.

My tubings also didn’t match precisely, which I could have worked around and I needed to print some Nylon barbs to work as an adapter from E3Ds bowden solution to the tubes – You can now buy a Water-cooling barbed adapter kit seperately from E3D, which you couldn’t at the time of my purchase… I could do all this, but I still needed a new pump and reservoir.

I could buy a new pump/reservoir combo from China and wait one more month and hope it worked this time…

Or I could buy the Watercooling kit from E3D and get going. This would also make it possible for me to get a look at their new stuff and document it for you in the form of STEP files on GrabCad.

  1. Prelude
  2. Configure RepRapFirmware
  3. Tool Definition
    1. Tool0
    2. Tool1
    3. Tool definition section code
  4. BLTouch offset from Nozzle0
    1. Mesh Grid
    2. The combined section code is like this
  5. Calibrate BLTouch for Z-offset
    1. Find Z-Offset
  6. Define Leadscrew coordinates for Autolevel
      1. How to use it
      2. X coordinates for M671
      3. Y Coordinate for M671
      4. The combined section code is like this
  7. Setup probe coordinates in bed.g

2) Configure RepRapFirmware

Since I’m using my new xBot Chimera+ Watercooled Carriage I need to both setup a new Tool (the second nozzle) which encludes configuring nozzle distance from each other, configure BLTouch placement in regards to my Nozzle, and reset my Z-offset of my BLTouch. Finally I’ll need to redo the coordinates used to do my probing sequce to autolevel my bed.. yes, it’s a lot actually, but taking it one step at a time, and it’s usually not really that hard.

I’ll recommend writing down what you do, if you are like me and work well with having documented what you do and what to do. 
Regardless of the details of your documentation I’ll strongly recommend you do not delete or change existing setup lines, but instead comment them out using ; and create a new line of code, for your new setup.

3) Tool Definition

Lets first add a new tool using M563 for our second nozzle by editing the config.g file. This includes defining which heater and extruder we are going to be using as well as the relative position it has to the first nozzle.

You can name the Tools if you like, which will show up in your web display. I’ve named them Nozzle1 and Nozzle2 respectively.

3.1) Tool0

First tool is Tool 0 (P0), using Extruder 0 (D0) and Heater 1 (H1)
M563 S"Nozzle1" P0 D0 H1 ; Define tool 0
The Tool ofset is defined using G10 and in relation to the origin of the head. I might have used the point between the two nozzles as the origin and defined offset as -10 and +10 on the X axis respectively, but I’m going to be using Nozzle 1 as the origin. This means the offset coordinates for Tool0 are all just 0.
G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets

3.2) Tool1

The second nozzle looks like: Tool 1 (P1), using Extruder 1 (D1) and Heater 2 (H2)
M563 S"Nozzle2" P1 D1 H2 ; Define tool
The offset of the second nozzle to the first one is +20 on the X axis, so it will look like this:
G10 P1 X20 Y0 Z0 ; Set tool 1 axis offsets

Note on Fans: If you use the default recommend fan0 as print object cooling fan, you do not need to define a fan.

 

3.3) Tool definition section code:


; Tools
; P = Tool Nr
; D = Extruder Drive nr
; H = Heater used
M563 S"Nozzle1" P0 D0 H1 ; Define tool 0
G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
;
M563 S"Nozzle2" P1 D1 H2 ; Define tool 1
G10 P1 X20 Y0 Z0 ; Set tool 1 axis offsets

4) BLTouch offset from Nozzle0

Next up we need to modify the BLTouch position in relation to the Head Origin, which in our case is the first nozzle Tool0.

It is our G31 in the config.g we need to modify. Just leave the Pnnn value as is.

The BLTouch is placed 10mm to the right of the nozzle, which is X10 and 24,26mm in front of the nozzle, which translates to Y-24.26.

Important: Do not use , as normal in metric systems when denoting decimals when defining the gcode.

We are going to set Z offset to 0, and setup this again later to match our new carriage.

This means our (base) G31 looks like this:
G31 P600 X10 Y-24.26 Z0 ; BLTouch offset in relation to Tool0

4.1) Mesh Grid

My Mesh grid is spanning the area from X5,Y5 up to X205,Y165 and probing every 10mm.

Tip: When doing initial setup of the Bed I like to make the probing distance larger, at 20mm to get a rough map to use for manual adjustment.

It means my M557 looks like this:
M557 X5:205 Y5:165 S10 ; Define mesh grid

4.2) The combined section code is like this:

; ## Nozzle Distance from BED - Offset. Higher value, closer to bed.
; Set Z probe trigger value, offset in realtion to nozzle and trigger height adjustment
G31 P600 X10 Y-24.26 Z0 ; Zero offset
M557 X5:205 Y5:165 S10 ; Define mesh grid

5) Calibrate BLTouch for Z-offset

Previously we reset the Z offset using G31 to Z, so it now looks like this:
; ## Nozzle Distance from BED - Offset. Higher value, closer to bed.
; Set Z probe trigger value, offset in realtion to nozzle and trigger height adjustment
G31 P600 X10 Y-24.26 Z0 ; BLTouch offset in relation to Tool0

So, lets go find the proper Z offset:

5.1) Find Z-Offset

  1. Move your sensor to around the middle of the bed. You might even want to make a Macro for this, as it can be usefull for many different cases.
    1. Herer’s a simply macro I named Move to Centerbed, where I home X and Y first:
      G28 XY
      G1 X97 Y120 F4000 ; Move probe to middle of bed
      G28 Z

      We need to home Z before we can continue, or it fails to test properly after firmware 1.21
  2. Move Z untill your nozzle is about 10cm (4 inches) from the bed.
    1. Be ready to click the Emergency Stop in case the probe misbehaves.
    2. Now issue G30 command.
    3. Your BLTouch should now send the Pin Down and your bed should now move up (or nozzle down) untill the BLTouch is triggered.
    4. Hit the Emergency Stop if it didn’t stop or the Pin didn’t drop down.
      1. Go through your deployprobe.g if the Pin didn’t drop down.
  3. With #2 successfull you put your sensor over the middle of the bed and jog Z axis untill your nozzle is touching the bed.
    1. Note: If it refuses to move as it has reached Z-minima you can type in G92 Z5 to tell it, that you are 5mm from Z=0.
  4. Once your nozzle just touched the bed tell the machine we are at Z=0 by issuing:
    G92 Z0
  5. Move Z 10mm away from nozzle
    G1 Z10
  6. Now send G30 S-1 at which point the Pin drops down and the z-axis closes the gap until the BLTouch is triggered.
    1. Z now stops moving and reports the current position without changing anything. Note down the reported value.
  7. You might want to repeat the steps 4-6 a few times to insure consistency. I personally just did it 2 times and later did final adjust by looking at print starts.
  8. Mine reported the following:
    G30 S-1
    Stopped at height 2.4mm
  9. I should insert 2,4mm now, but I’ll detract 0,2 as a safety margin, so I’ll change the Z parameters in the G31 line from 0 to 2.2.
    G31 P600 X10 Y-24.26 Z2.2
    Important: The higher Z value the closer you move the nozzle and bed to each other! It’s better to have a value too low here than too high to avoid the nozzle and bed doing a mating game when homing.
    Important: If you later redo the offset method you should reset the offset to Z0 before starting or it might lead to strange results I’ve found on some occasions.

6) Define Leadscrew coordinates for Autolevel

Since the xBot is using 3x independent motors for our Z axis we need to define the coordinates of the leadscres in relation to the hotend and carriage combination we are using.

This can be a bit harry, but lets start by looking at the xBot Probe Point Helper Drawing I made for this purpose:


The Drawing is not made specifically for the my current xBot Carriage Chimera+ Watercooled but instead lising the dimensions in relation to the rear center manual finger screw. I did it this way to make it easier for people to use their own favorite carriage and hotend solution.

If you want indepth explanation on what I’m doing here, you should read the section on Z-Leadscrew Placement.

6.1) How to use it:

Before starting you should check if your X and Y -maxima coordinates should be changed. I needed to change mine.

Now home your X and Y axes, then move your carriage to the center rear, so BLTouch is lined up to the rear fingerscrew.
The position reads as X97 and I measure the BLTouch to be placed 20mm in front of fingerscrew, meaning my nozzles are actually placed exactly at my Y-Maxima, which is Y215.

6.2) X coordinates for M671

First leadscrew

Front right is placed 153,6mm to the right of the center rear fingerscrew.

Since my center is X97 it amounts to: 97+153,6 = 250,6 for first X coordinate.

Second leadscrew

Front left is placed 153,6mm to the left of center.

So 97-153,6 = -56,6 for second X coordinate.

Third leadscrew

Rear center is placed at the center, so we use 97 for our third X coordinate.

This adds up to the first part of the M671 line, which looks like this so far:
M671 X250.6:-56.6:97

6.3) Y Coordinate for M671

First Leadscrew

Front right is placed 241,1mm in front of the rear center leadscrew, which has the coordinate Y215 since my Nozzles are exactly on top of it and it corresponds to my Y-Maxima

So we take the Y position 215 and detract 241,1, which gives us 215-241,1 = -26,1 for our first Y coordinate

Second Leadscrew

This is placed at the same point on the Y axis as the first leadscrw, so -26,1 for our second Y coordinate

Third Leadscrew

This on is placed 63,5mm further out the Y axis, so:

215 + 63,5 = 278,5 for our third Y coordinate

When adding the Y coordinates to our M671 codeline we get the following:
M671 X250.6:-56.6:97 Y-26.1:-26.1:278.5 S3

The trailing S3 defines maximum correction the leadscrews can do. Default is 1.

6.4) The combined section code is like this:

; Define the X and Y coordinates of the leadscrews.
; Must come after M584, M667 and M669
; S = Maximum correction
; Motor order: Front right, front left, rear center.
; Snn Maximum correction to apply to each leadscrew in mm (optional, default 1.0)
M671 X250.6:-56.6:97 Y-26.1:-26.1:278.5 S3

7) Setup probe coordinates in bed.g for G32

Now its sime to review our bed.g file to see if it’s still valid.

It’s not really crucial where you probe, but you should try to make the probe points as close to each leadscrews as possible.

I set all mine to 2mm from min and max for each axis.. just in case a wire or something got between my carriage and the printer edges.

The Third point needs to take into account how BLTouch is placed 20mm in front of the nozzles, as it wouldn’t be able to probe at Y215 but at best at Y190. I’ve deducted the extra 2mm and landed on Y188.

It might be a bit fiddly to figure it out, as the actual probing coordinates is for the nozzle, so can be confusing when looking at it.

; bed.g
; Called using G32
; Called to perform Autolevel using 3-point probe
;
M561 ; clear any bed transform
; Made allowances for BLTouch being up to 30mm in front of nozzle. Typical is 27mm+/-
Probe 3-point
M401 ; Deploy probe - deployprobe.g
G30 P0 X207 Y2 Z-9999 ; Front Right
G30 P1 X2 Y2 Z-9999 ; Front Left
G30 P2 X97 Y188 Z-9999 S3 ; Center Rear
M402 ; Retract Probe - retractprobe.g

Posted on 7 Comments

BLTouch on Duet WiFi – Configuration and usage

In a previous post we connected our BLTouch sensor physically to the Duet hardware and made some basic configurations as well.

In this post I’ll talk about Probes and Sensors interchangeably and will be using the BLTouch name/model during this post, as that is the one I’m using to test this.

If you want to read a bit of an intro into the differences between autolevel and autocompensation, I wrote a brief section about this in Is this autolevel?

I’ve had some correspondence with a lot of peopleduring the writing of this post and I’ve come to understand that I need to specify the printertype I’m talking about here. My printers, which I’m using as basis for this post are:

  1. A box type printer with fixed XY gantries at the top, working together using the cross method to move a carriage around (like an Ultimaker and my xBot), and using a single z-motor to lift the z-gantry containing the printing bed surface.
  2. My xBot which uses the same XY cross-method, but has 3 seperate Z motors for the Z axis, making it possible to adjust it automatically for true autolevel.

You can still use all information even if you are using a Tower printer (like Prusa etc), but I am going to be referring to the two machine models above throughout this post.

i know very little about Delta machines, so I haven’t written with those machines in mind. Donate a Delta and I’ll write some how-tos on it 😁

In this blog-post I’ll try to go through different types of more complete configurations and usage scenarios like:

  • Setup BLTouch in Config.g including defining Mesh Grid to probe using M557.
  • Doing a Mesh Grid Probing sequence using G29
  • Doing a Basic Single Probe using G30 before print start.
  • Doing an Advanced Probing sequence using G32 for Autolevel
  • Setup Slizer Startup Gcode to apply our Mesh Grid to the z-plane after doing the Autolevel Probing.
  1. Using a Probe – Intro and Explained
    1. Auto Bed Compensation drop-down menu walkthrough
    2. Summing up
    3. Usage
  2. Wiring of BLTouch
    1. Probe switch function
    2. PWM Channel for Servo Function
    3. Duex owners
  3. Configuring BLTouch
    1. Create a deployprobe.g and retractprobe.g file
    2. Create a BLTouch Macro Group
  4. Change config.g file
    1. Disable Heater to free up PWM pin
    2. Change Endstop Settings
    3. Define Probe Type
    4. Probe Position
    5. Define Mesh Grid
  5. Total Configuration – Summing up
      1. Config.g changes
      2. New Configuration files
      3. Macros
  6. Calibrate our sensor
    1. Find Z-Offset
    2. Run Mesh Grid Compensation sequence
    3. Save Custom named height maps
  7. Before Printing
    1. Homez.g
    2. Homeall.g
    3. Slizer startup gcode
  8. Multi Z-motor setup using bed.g
    1. Z-leadscrew placements
    2. Define XY Coordinates in config.g
    3. Lets have a look at Homing using a Probe
      1. Slizer Startup and Endcode Examples
      2. Single Z-Motor Machine
      3. Triple Z-Motor Machine
  9. Gcodes used

Using a Probe – Intro and Explained

When adding a Z-probe to your 3D Printer it also means introducing a lot of new terms and it requires a fair bit of setup to do and gcodes to learn to use.

Most printers just have some sort of basic limit switch or maybe a hall or IR -sensor for X, Y and Z. This means a G28 command is enough to home all axes.

When using RepRapFirmware a basic homing sequence requires 4 files to work:

  1. homex.gG28 X
  2. homey.gG28 Y
    1. By issuing: G28 XY you can opt to home X and Y at the same time without Z.
  3. homez.gG28 Z
    1. This command will just home Z without the X and Y axes.
  4. The homeall.g file, which is executed using G28 without specifying any axes afterwards.
    1. This file normally homes all axes your machine might have.

Important: When using a Probe located on Z-min (at your nozzle) and using the most basic/normal probetype with 1x Z-motor using Mesh Grid Compensation the Z-Max endstop will be disabled regardless of any virtual axes you might make to get around this issue! 

I am told that his is not the case when using a Delta type Printer. I am not familiar with Delta configurations.

If you have 2 or more individual Z-motors and have configured Auto Bed Compensation in combination with Mesh Grid Compensation a Z-max endstop is mandatory (is it really?) in order for the Printer to calculate your Z plane accurately.

In order to use a Probe we need to configure it using several new M/Gcodes, which we go through below.

We also get a new arsenal of Gcodes to use during startup, and we can use the various functions in the Auto Bed Compensation drop down menu in our web gui:

Auto Bed Compensation drop-down menu walhthrough

  • The actual button Auto Bed Compensation constitutes a G32 which can only be used if you have 2 or more independent Z-motors.
    • When issuing a G32 command, the bed.g macro file is executed.
    • I don’t know how to make the “Show Probed Points” active?
  • The Disable Bed Compensation is used if you have  Auto Bed Compensation in effect but want to disable it.
    • This can also be done by issuing the M561 command which cancels any bed-plane changes you might have in effect by probing (or anything else).
    • The M561 is also placed first in the bed.g file before doing a new Auto Bed Compensation run.
  • G29 – Run Mesh Grid Compensation – Performs a Mesh Probe which is saved to a heightmap.csv file.
    • By probing the bed you automatically enable it as well.
    • You can use custom names. More on this later.
  • The Show Mesh Grid Heightmap displays the grid performed by G29 graphically.
  • The Load Heightmap from SD Card constitutes a G29 S1 command, which you would typically place in your startupgcode file in your slizer after the probing sequence.
  • Disabled Mesh Grid Compensation equals G29 S2 and stops the printer from using the heightmap.

Before we can run G29 we need to define the mesh to probe, which is done via M557 in our config.g file, which we will further down in this post under Define Mesh Grid.

Summing up

  • We setup and configure our Probe/Sensor in config.g
  • Bed.g is only used if we have 2 or more  independent Z-motors. Tower printers would use this method if the Z motors are using seperate drivers.
  • The bed.g file is used to define probe points using M671 in relation to our Z-motors.
  • The bed.g file is not used if we do not have more than 1 independent Z-motor.
  • You can even have multiple differently named heightmaps to use, if you for instance have different plates for different materials.

Usage

  • M561 should always be used before running a new probe sequence of any kind.
  • We use G30 (without parameters) to do to the Z-min probe as defined by G31 in the config.g file
  • If we have 2 or more independent Z-motors we use G32 to do the probing sequence as defined in the bed.g file.
  • Any Heightmaps you want to use is loaded after you have finished your probing sequence.

Wiring of BLTouch

We can seperate the 5 wires of the BLTouch into 2 seperate groups:

  1. Probe switch function:
    The Black (GND) and White (Signal – Z Probe IN) which connects to the Probe Connector on the Duet Controller.

    Note: My “white” wire is red on this photo.
  2. PWM channel for Servo Function.
    The Brown (GND), Red (+5v) and Yellow(PWM) goes either onto  a PWM/Servo connector on a Duex board or we use 3 pins in the 40-pin expansion-connector.
    Note: Regardless of wheter we use a Duex or not, I am going to be using Heater7 in my setup examples, which is PWM channel 5. I do this as it is the last one, so it’s easy to remember and it is physically the PWM channel on Duex which sits closest to the edge of the board.
  3. Here is he complete overview of pins used if you do no have a Duex board.

    1. For Duex owners, the Heater7/PWM5 is the connector you see on the middle left side here and the upper one is the Probe connector on the Duet Controller.

      Note: On the photo I have a resistor installed in the Probe Connector. This is necessary if you are using one of the older BLTouch models without the trace you can cut on the rear of it, to make it run 3.3v logic.
      Note: I had a machine where I thought I had cut the trace, but it wasn’t cut all the way, but it still worked, so you might be able to skip this. Ie mine worked fine even though it was still setup as running 5v logic, which means it was still without correct readings it seemed.

Configuring BLTouch

Now that we have everything hooked up, we need to setup our firmware to be able to use it. This includes creating some files and editing config.g and in some cases also bed.g

Create a Deploy and Retract file

Regardless of setup we need to create a deployprobe.g  and a retractprobe.g file.

  • Deployprobe.g
    M280 P7 S10 I1
  • Retractprobe.g
    M280 P7 S90 I1
    These files are used to execute our probe as needed.

Note: If you use Duex2/5 you do not need the i1 parameter

Create a Levelplate Macro Group

This is not strictly necessary, but really usefull, so go to your Macro area and create a new Directory named BLTouch.

Now we create some macros as shown:

  • Alarm Release + Pin UP
    M280 P7 S160 ; Alarm Release and Push-Pin UP
  • Pin Down
    M280 P7 S10 ; Send PWM channel 7 the s10 (angle) command
  • Pin Up
    M280 P7 S90 ; Send PWM channel 7 the S90 (angle) command
  • Self-Test
    M280 P7 S120 ; Send PWM channel 7 the S10 (angle) command

You might want to create some more macros to quickly run your probe to the center of your bed and each corner etc.

Change config.g file

We need to make some changes in our config.g file in order to make use of our probe.

Please note that some or all of these entries exists in your config.g file alrleady if you used the RepRapFirmware online configurator to create your files.

Disable Heater 7

We use M307 to disable Heater 7 to free up the PWM5 channel for our servo (probe).

I’ve put this down with my oher Heater settings for hotend (M301) and heated bed (M307) in the config.g file.
; BLTouch - Heaters
M307 H7 A-1 C-1 D-1 ; Disable the 7th Heater to free up PWM channel 5 on the Duex board.

Change Endstop Settings

Next up we need to change our Endstop Settings, which is done using M574 gcode

It might look something like this now:
M574 X1 Y2 Z2 S1 ; X home to min. Y and Z home to max. Normally Closed limit switches.
We need to remove the Z2 from this line, and add a new line defining Z as using a probe.

The two new lines are going to look like this:
M574 X1 Y2 S1 ; X home to min. Y home to max. Normally Closed limit switches.
M574 Z1 S2 ; Define Z to use Probe. Home to Min

Define Probe Type

Next up we define our probe type using M558, which is Type 5 in our case:

  • P is probe type
  • H is diveheight, which means how far bed moves down/hotend up, between each probes
  • F is the speed of bed up/down movement. If it’s too slow the Probe pin might hit the bed and cause an error.
  • T is the movement speed between probepoints.
  • The X, Y and Z denotes which axes are used by the probe. X and Y are not used, while Z is.

M558 P5 H5 F500 T4000 X0 Y0 Z1 ; Set Z probe type/mode 5. H=Dive Height. F=Speed the bed moves

Probe Position

Next up we use G31 to define the Sensor’s offset from the nozzle in XY and the Bed in Z.

My carriage with hotend and BLTouch looks like this seen from below.


As you can see, the BLTouch is placed:

  • X is directly in line with the nozzle (X0)
  • Y is -25.3mm in front of nozzle (Y-25.3)
    • Note: if you build my xBot it most likely is further away due to the nature of the Carriage.
  • We start with a Z offset of 0.0mm in regards to actual probe activation and factual distance. This value will be adjust later on, to match our setup.
    • Important: It is important to have Z-offset at 0 before calibrating.
  • P is the value needed to trigger the BLTouch. I’ve seen and tried a lot of different values between 25 and 600 and havn’t noticed any difference. But put a pin on this one in case your probe results are inconsistent.

G31 P25 X0 Y-25.3 Z0.0 ; Z probe trigger value, offset in relation to nozzle. And trigger height adjustment

Define Mesh Grid

Next up we use M557 to define the grid on our printbed we want to probe, in order to create a Mesh the controller can use to compensate for surface inaccuracies.

We start by typing M557 then define start and end points on our X and Y axes. Example below shows how we probe from X5/Y5 to X205/Y165.

The Snn parameter defines the spacing between each probe point, where we have defined it to probe with 20mm interval.

Hint: It can be useful to start out with a big interval like 40mm, to make the probing sequence faster, and it is useful to do some manual leveling based on the probing result.
Afterwards, if you have individually driven motors, you do a fine mest for auto compensation when you can’t manually adjust it any better.

Note: There is a maximum of 400 points available for probing, so making it too fine will result in an error. If you get an error, try raising the Snn parameter.

M557 X5:205 Y5:165 S20 ; Define mesh grid

You could do your Mesh Probe sequence now, but it’s important to calibrate your BLTouch first, by calculating the Z-offset

Total Configuration – Summing up

  • Config.g changes Lets combine all our code snippets and put them in our config.g file at your current Endstop section.
  • M574 X1 Y2 S1 ; X home to min. Y home to max. NC microswitches.
    M574 Z1 S2 ; Define Z to use Probe. Home to Min.
    M558 P5 H5 F500 T4000 X0 Y0 Z1 ; Set Z probe type/mode 5. Not using on XY, but using it on Z.
    G31 P25 X0 Y-25.3 Z0.0 ; Z probe trigger value, offset in relation to nozzle. And trigger height adjustment
  • Disable the Heater PWN channel to free it up for our usage:
    ; BLTouch - Heaters
    M307 H7 A-1 C-1 D-1 ; Disable the 7th Heater to free up PWM channel 5 on the Duex board.
  • New Configuration Files
    Regardless of how your setup looks we also created a deployprobe.g  and a retractprobe.g file.

    • Deployprobe.g
      M280 P7 S10 I1
    • Retractprobe.g
      M280 P7 S90 I1
      These files are used to execute our probe as needed.

Note: If you use Duex2/5 you do not need the i1 parameter

    • Macros
      While not strictly necessary it comes in very handy to have created these:

      • Alarm Release + Pin UP
        M280 P7 S160 I1 ; Alarm Release and Push-Pin UP
      • Pin Down
        M280 P7 S10 I1 ; Send PWM channel 7 the s10 (angle) command
      • Pin Up
        M280 P7 S90 I1 ; Send PWM channel 7 the S90 (angle) command
      • Self-Test
        M280 P7 S120 I1; Send PWM channel 7 the S10 (angle) command
      • It isalso very usefull to creeate macros on various places on your bed. Ie in the front corners, center of bed and center rear and so on, depending on your setup.

Note: If you use Duex2/5 you do not need the i1 parameter

Calibrate our sensor.

Now is the time to define the Z-offset parameter in the G31 command in our config.g which looks like this right now:

G31 P25 X0 Y-25.3 Z0.0

Find Z-offset:

  1. Move your sensor to around the middle of the bed. You might even want to make a Macro for this, as it can be usefull for many different cases.
    1. Herer’s a simply macro I named Move to Centerbed, where I home X and Y first:
      G28 XY
      G1 X100 Y120 F4000 ; Move probe to middle of bed
  2. Move Z untill your nozzle is about 10cm (4 inches) from the bed.
    1. Be ready to click the Emergency Stop in case the probe misbehaves.
    2. Now issue G30 command.
    3. Your BLTouch should now send the Pin Down and your bed should now move up (or nozzle down) untill the BLTouch is triggered.
    4. Hit the Emergency Stop if it didn’t stop or the Pin didn’t drop down.
      1. Go through your deployprobe.g if the Pin didn’t drop down.
  3. With #2 successfull you put your sensor over the middle of the bed and jog Z axis untill your nozzle is touching the bed.
    1. Note: If it refuses to move as it has reached Z-minima you can type in G92 Z5 to tell it, that you are 5mm from Z=0.
  4. Once your nozzle just touched the bed tell the machine we are at Z=0 by issuing:
    G92 Z0
  5. Move Z 10mm away from nozzle
    G1 Z10
  6. Now send G30 S-1 at which point the Pin drops down and the z-axis closes the gap until the BLTouch is triggered. Z now stops moving and reports the current position without changing anything. Note down the reported value.
  7. You might want to repeat the steps 4-6 a few times to insure consistency. I personally just did it 2 times and later did final adjust by looking at print starts.
  8. Mine reported the following:
    G30 S-1
    Stopped at height 0.980 mm
  9. This means I’ll change the Z parameters in the G31 line from 0 to 0.98.
    G31 P25 X0 Y-25.3 Z0.98
    Important: The higher Z value the closer you move the nozzle and bed to each other! It’s better to have a value too low here than too high to avoid the nozzle and bed doing a mating game when homing. 
    Important: If you later redo the offset method you must set the offset to Z0 before starting or it might lead to strange results I’ve found on some occasions.

Run Mesh Grid Compensation sequence

Now that we have all our parameters in place we can run a Mesh Probe Sequence by clicking the “Run Mesh Grid Compensation” via the Drop Down Menu, or just type in G29

This Mesh Grid consists of a lot of X, Y and Z coordinates. It can be very helpfull to use this to do some manual adjustment of the Z plane. Ie, meaning you try to make your printbed as level as possible manually by running some faster rougher sequences, and then use a final high resolution mesh sequence when done.

The first Mesh Probe sequence I ran at 11:23 had a mean error of 0.182 and a deviation of 0.084. In normal words the rear bed was a tad higher than the front, so I gave the center rear screw half a turn and did the sequence again. This time the mean error went down to 0.077 and the deviation also decreased a good deal.

You can hover the mouse over the probe points to see the XYZ coordinates.

By Running the mesh grid compensation sequence by either clicking in the menu or typing G29 it will be saved into the file heightmap.csv and be activated.

Save Custom named height maps

If you use multiple different surfaces as I do, you might want to have several heightmaps on hand.

You can use M374 to save the heightmap with a different name than the default heightmap.csv. Below I’ve saved the heightmap as “bareplate.csv” as this is directly onto the surface of my PEI-Coated aluminium plate.

I’ll be making different files for when I’m using glass for printing Nylon, FlexiPlate for PLA and so on.

In order to use one of our custom named heightmaps we can not just use G29 S1 to load the default map, but instead we use M375 to call up our desired height map:
M375 P"bareplate.csv"

Before Printing

Before we can wrap up our configuration we need to adjust our homeing files to match.

Homez.g

The Gcode G30 is actually enough to deploy the probe and make your Z axis home. I’ve added a line to move the bed to Z=10 after probing like so:

; Homez.g
G30 ; Do a single probe to home our Z axis
G90 ; Make sure we are in absolute mode

G1 Z10 F6000 ; Rapidly move the Z axis to Z=10.

The G30 just probes and set Z to 0. The Offset we configured previously adjust the distance to match.

Homeall.g

I’m a bit confused here actually as it seems the machine uses homeall and then issue homez even if we havn’t made references to it in the homeall.g file.

Can anyone shed light on this behaviour?

Slizer startup gcode

In order to actively be using our Mesh and use the Sensor when we print, we need to add some lines to our slizer’s startup gcode

  • Here I’m first homing my X and Y axis.
  • Then clearing any Bed Transform I might have in place, as it would otherwise affect the probing.
  • I’m then moving the probe to be at the middle of the bed. If it oozes, you might want to omit or change this.
  • I’m then issuing the G30 command which brings my Z axis to close the distance between nozzle and bed and do the single probe.
  • Now it’s time to load the heightmap we have created previsouly using our Mesh Grid. It is important this comes after the bed probe.
    • You either use G29 S1 to load the default heightmap.csv or you use the M375 to load a custom heightmap.
    • I’ve loaded my custom heightmap below.
  • Finally I’m moving the Z to 20

G28 XY ;Home XY
M561 ; Clear any bed transform that might be in place
G1 X104.5 Y130 ; Move Probe to middle of bed
G30 ; Do a single probe
M375 P"bareplate.csv" ; Load my custom heightmap. Otherwise use G29 S1
G1 Z20.0 F6000 ; Move Z to 20

Multi Z-motors setup using bed.g

Now we have all the common stuff in place we are ready to look at the functions where we use the bed.g file to define how our individual Z-motors are placed and react when probing.

Note: Remember I’m talking from a Box Printer perspective here, but you can use it just fine for Tower Printers  just keep my references in mind!

In order to use the multi z-motor functione we use he multi-probe gcode G32 when homing Z, which calls on the macrofile bed.g where we have multiple probe points instead of just using the single probe point defined via M557 in our config.g file, using the single-probe command G30.

Z-Leadscrew placements

In order to put in some meaningfull coordinates in bed.g we need to know where our Z-leadscrews are in relation to our probe.

Here we can see the placement of my 3 leadscrews on my xBot printer, in relation ot the fingerscrews on my bed.

I used the rear center screw to pinpoint the exact XY coordinate of the probe in relation to the screws.

The numbers in the red circles are the placement and numbering of my Z-motors, while the square boxes indicates the coordinate and probe sequence of my bed.g file.

  • The bed.g starts by issuing a M561 to clear any bed-plane fitting/transform we might have in place by a previous probing.
  • Next we clear any heightmap we might have in effect as the height map should only be loaded after performing our bed leveling probe sequence.
  • Deploy our probe using M401 which simply call on our deployprobe.g we created earlier.
  • Now we come to the business of defining where we probe our bed. We issue the G30 command 3 times, starting with motor 1 through 3.
  • It is 3 times as I have 3 independent Z motors.
    • Important: It is very important we use same sequence as we will be defining the leadscrews in our config.g (next step) file using M671
  • The S3 we have listed after our third line of G30 is crucial to the function, as it must be equal to the number of probe points/individual leadscrews we are using.
    • The strange Z-9999 is there as a Z value less than -9999 causes the machine to probe at the current point to get Z, rather than using the given value.
    • If an S field is specified (e.g. G30 P2 X100 Y165 Z-9999 S3) the bed plane is computed for compensation and stored which is exactly what we want here!
    • if using a Tower Printer with 2 individual Z motors, you would put S2 after the last line instead.
  • Now that we have probed one time pr leadscrew and set it up for computation we retract our probe using M402, which just calls our retractprobe.g file.

; bed.g
; Called using G32
; Called to perform True Autolevel using 3-point probe
;
M561 ; clear any bed transform
G29 S2; Clear bed height map

; Probe 3-point
M401 ; Deploy probe - deployprobe.g
G30 P0 X200 Y0 Z-9999 ; Front Right
G30 P1 X0 Y0 Z-9999 ; Front Left
G30 P2 X100 Y165 Z-9999 S3 ; Center Rear
M402 ; Retract Probe - retractprobe.g

Define XY Coordinates in config.g

When using the bed.g file to setup multiply points to probe in relation to the leadscrews, we need to define the XY position of the leadscrews in our config.g file.

These coordinates will be outside our printing area and can as such be much higher and even have negative values.

In order to define these, we use the M671 which I’ve placed above my Endstop section in the config.g file.

We obviously also need to know where our leadscrews are placed in relation to our nozzle, for which I’ve made this drawing:

The coordinates we fill in using M671 are the XY coordinates placed at each of the round numbers, in that order.

Remember you can do this with just 2 individual Z-motors, and as such do not need 3 for full autolevel. Using 2 motors will only level the bed on one axis though, but that is still very neat.

The actual syntax used here is a bit strange as we start by issuing the M671 command, then type the axis in question (X at first), followed by the 3 X coordiantes, seperated by :
Next up we do the same with the Y coordinates and terminated by the optional S3 parameter – not to be confused by the S3 we used above!

I used 3mm in the S as I had some issues with Z sync not working as I wanted it to do. It’s defaulting at S1, so you might do fine without specifying anything for S.

; Define the X and Y coordinates of the leadscrews.
; Must come after M584 (Set drive mapping), M667 (Select CoreXY Mode) and M669 (Choosing Kinematics type)
; Motor order: Front right (1), front left (2), rear center (3).
; Snn Maximum correction in mm to apply to each leadscrew (optional, default 1.0)
M671 X256.6:-53.6:100 Y239.10:239.1:65.50 S3

Lets have a look at Homing using a Probe

Now everything is setup according to our system and we are ready to do an autolevel for the first time.

I’m writing Autolevel as my machine is doing an actual true autolevel. If you use 2 z-motors you “only” level it on one axis where as the Mesh Grid applied after the autolevel is our Auto Compensation.

You need to have homed the X and Y axes before starting, but aside from this, you only really need to type in G32 to do the magic.

It will do a probe sequence on the 3 coordinates defined in the bed.g file and calculate the Z-plane based on these measurements and coordinates of the leadscrews as we just defined in our config.g using M671

If you wonder, my homez.g file just home using a single probe action and rapidly moves the bed down again. I have this in place if I want to redo offset.
; Homez.g
G91 ; Relative Positioning
G30
G90 ; Absolute Positioning
G1 Z20 F4000

Slizer Startup and Endcode Examples

As a rounding up on this post I’m posting my start and end codes on 2 machines:

Single Z-Motor Machine

I’m using Cura as my slizer, so I do not need all the “wait for temperature” gcodes of some other slizers, as these are automatcially in place – except for Chamber Heater, which you must add manually if using such a one.

; Startup Gcode
G91                        ; Relative Positioning
G1 Z-1                     ; Move Z down 1mm
G90                        ; Absolute Positioning
G28 XY                     ; Home XY
M561                       ; Clear any bed transform
G1 X104.5 Y130             ; Move Probe to middle of bed
G30                        ; Do a single probe
M375 P"flexiplate.csv"     ; Load heightmap (you can use G29 S1 instead)
G1 Z20.0 F6000             ; Move Z to 20
G1 X5 Y5                   ; Move Head to front left
G92 E0                     ; Zero Extruder
G1 F200 E15                ; Prime the extruder
G92 E0                     ; Zero Extruder

EndGcode

; End Gcode
G10 P0 R-273.15 S-273.15     ; Turn off Tool0
G10 P1 R-273.15 S-273.15     ; Turn off Tool1
M140 S-273.15                ; Turn off Bed
M106 S0                      ; Object fan off
G1 Z210                      ; Move Z to Z210
G92 E0                       ; Zero Extruder
G1 E-2 F300                  ; Retract 2mm
G92 E0                       ; Zero Extruder
G28 XY                       ; Home XY
M84                          ; All motors Off

Triple Z-Motor Machine

And my startup gcode for my xBot triple Z-motor machine.

; Startup Gcode
G91                      ; Relative Positioning
G1 Z-1                   ; Move Z down 1mm
G90                      ; Absolute Positioning
G28 XY                   ; Home XY
M561                     ; Clear any bed transform
G1 X104.5 Y173           ; Move Probe to middle of bed
G32                      ; Start 3-point probe sequence
M375 P"bareplate.csv"    ; Load heightmap
G1 Z20.0 F6000           ; Move Z to 20
G1 X5 Y5                 ; Move Head to front left
G92 E0                   ; Zero Extruder
G1 F200 E20              ; Prime the extruder
G92 E0                   ; Zero Extruder

My Endcode for xBot

In this one I home it to XY and U. The U is my virtual axis I’ve made for Z in order for it to be able to home to Z max, which I can’t otherwise do.

This doesn’t work with the setup for the single Z-machine. I have not yet had time to see if I can get around this, by using bed.g even though I don’t need it for that one.

; End Gcdoe
G10 P0 R-273.15 S-273.15   ; Turn off Tool0
G10 P1 R-273.15 S-273.15   ; Turn off Tool1
G10 P2 R-273.15 S-273.15   ; Turn off Tool2
M140 S-273.15              ; Turn off Bed
M141 S-273.15              ; Turn off Chamber Heater
M106 S0                    ; Object fan off
G92 E0                     ; Zero Extruder
G1 E-2 F300                ; Retract 2mm
G92 E0                     ; Zero Extruder
G28 XYU                    ; Home XY and U to Z max
M84                        ; All motors Off

 

Gcodes Used

Here’s a list of (some of) the M and Gcodes introduced in this post:

  • G28
  • G29 – Detailed Z-Probe
  • G30 – Single Z-Probe
  • G31 – Set or Report Current Probe Status
  • G32 – Probe Z and Calculate Z-Plane

 

  • M280 – Set Servo Position
  • M374 – Save height map (with alternate name)
  • M375 – Load (custom) height map
  • M557 – Set Z Probe point or define probing grid
  • M558 – Set Z Probe Type
  • M561 – Set Identity Transform (Reset any Mesh probes or adjustments in place)
  • M671 – Define positions of Z leadscrews or bed levelling screws
Posted on Leave a comment

Duet WiFi – Activate and connect the WiFi… when it doesn’t work!

Guess we’ve all tried it.. just can’t get the WiFi to connect to our home network. Especially after a firmware upgrade.

For some reason the non-macro manual method doesn’t always work, and I’ve learned that the most simple solution then, is to create a macro file with the needed info and execute the macro.

This post is a boiled down version of my Duet WiFi/Eth – Recover from Erase + basic setup post.

Macrofile for networksetup

  • We need to create a small macrofile to make it connect to our WiFi.
    I tried doing this manually without the Macro, but I simply just could not get it to connect..
  • So, go to your Macros folder on your SD card and create a new file named SetNetwork containing the following commands (without spaces before or after the commands on each line):
    M552 S0
    G4 P1000
    M587 S"your-network-ssid" P"your-network-password"


    Source info
  • Now eject the card from your computer and insert it into your Duet WiFi and connect it to your computer using the USB cable

Activate WiFi

  • Connect to your Duet WiFi using Pronterface and type M552 S0 to start the WiFi module
    M552 S0
    SENDING:M552 S0
    WiFi module started
  • Type in M98 P/macros/SetNetwork to execute the macro we created
    >>> M98 P/macros/SetNetwork
    SENDING:M98 P/MACROS/SETNETWORK
    WiFi module started
  • Send M587 and check that your network is listed
  • Send M552 S1.
    After a few seconds you should see a message that it has connected to your access point and display the IP it has recieved.
  • Connect via the web interface
  • Enable the M552 S1 command in config.g – if it’s not in there, then just make a new line and type it in.
  • For security reasons you might want to delete the SetNetwork macro file

SD Card Folder Structure

It’s usefull to know how the structure is supposed to be on the SD-card and also to know the function of each of the files and more info.

All this is shown on the SD Card folder structure wiki page

Posted on 2 Comments

Duet WiFi/Eth – Use M584 to autolevel or sync Z-axis using 2 or more motors

I originally planned to use 3 seperate Z-motors for my BeTrue3D Printer project back last christmas, but since I’m using some special hollow Nema 17 and bespoke 1204 Ballscrews + top-fixing blocks the price would be like $100 for one extra motor on the Z-axis.

The money was just one concern. One which I could have overcome (by waiting some) if I wanted to, but it would also cause the printer to be much deeper without giving me larger printing area, and so it wouldn’t fit on my desk.. which was a primary requirment!

A rather big issue was how the RepRapFirmware at the time did not support this form for autolevel and there was no date for when it might be available.

Anyway, here’s a blog-post about it. I’ll at some later date make some youtube video to show how it works, so stay tuned! 🙂

  1. Independent Z-Motors
  2. Is this autolevel?
    1. Autocompensation
    2. Autolevel
  3. My usage of 2x Z-motors
    1. What am I going to do here exactly?
    2. Why? Is it even needed?
    3. How is this going to work in practice?
  4. Motor remapping for dual Z
    1. Physical Drive Connection
    2. Use M584 to remap the drives
    3. Configure Drives
    4. Endstop setup
  5. Example setup for non-duex user
  6. New Homing files

1) Independent Z Motors

It all ended up with me using 2 independent Z-motors.

I started out driving both from the same Z-driver but installed a limit-switch at each motor, which would be at Z-max, and planned how to trigger them using identical screws on both sides, mounted down through a threadded m3 hole in the Z-gantry for just this purpose.

The screws can of course be turned some, if fineadjustment is needed. I used some Loctite Threadlocker (open UK Ebay) to make sure it didn’t rattle loose.

2) Is this autolevel?

You might ask if this is autolevel by now, as it looks completely different than what you are used to see with a probe or sensor or similar..

Autocompensation

We normally see some sort of sensor near the hotend, which probes places around the bed and then compensate according to how uneven the printbed is.

This sort of automation is more correctly called autocompensation as it can compensate for various erros, most often just for a non-flat printbed though.

The compensation for non-flat surface is achieved by compensating for these errors by gradually, over the first xx layers flattening out the area on which it is printing. Ie, some areas are printed with a thicker layer than on others. After xx layers it can start printing normally

There are more to this, and different methods to compensate for non-square frame and axes etc, but this is beyond this blog-post

Autolevel

Autolevel on the other hand is when one or more sensors determine the posistion of the printbed and by using 2 or more motors makes it completely level compared to the XY axes.

You would want to use 3 or more motors to make most out of this Autolevel function.

A short note on using Autolevel: functions with RepRapFirmware: The M320 autolevel gcode is not currently implemented in the firmware, and seems it’s not going to be either, as the current functions G29-G32 is fullfilling the same functions more or less. Currently only Repetier firmware is making use of the M320-322 gcodes.

3) My usage of 2x Z-motors

As I talked about previously I selected to only use 2 Z-motors and the function to use these for Autolevelfunctions were recently made available in the RepRapFirmware via the M584: Set drive mapping, so now I’m in business!

In all fairness, the M584 has been around for some time, but I’ve been waiting for a finished sort of system for autolevel, which, as it turns out (see note above) is not going to be implemented, so here I am!

What am I going to do here exactly?

I’m going to home my Z-axis to Z-max and make each motor make use of it’s own endstop in order to make sure each end of the Z-axis is synchronized.

Why? Is it even needed?

In my optics, yes! Asolutely. Any machine using more than 1 z-screw should have this implemented.

Problem with multiple independent z-motors, yes, and even multiple axes driven by a single belt, is that one or more of the axes might get turned a bit. It can happen if you accidentially push on the plate or turn the screw, if you happens to move the z faster than it likes and one motor or screw skips a step or belt etc.

It might also be that your axes aren’t 100% to begin with, so you need to synch them up before each print, which you can do with this method.

How is this going to work in practice?

I’m going to use 2 different drivers for my Z-motors and use the associated Endstop connectors for these drivers as well. This is accomplished by using the M584 to define virtual axes.

It means we include both Z-motors in the original Z and then make a virtual axis for one of these motors in order for them to be able to move as one, but also make use of each motors’ own limit switch in order to make sure they are synchronized.

Motor remapping for dual Z

Before we get down to using M854, we need to use the M569 to define/check our physical setup.

Physical Drive Connection

My setup/explanation:
  • Drive 0-1 as X and Y, which are standard.
  • Drive 2 as left motor, which is normal Z
  • Drive 3 as Right Z-motor, which is normal Extruder0
  • Drive 4 – Standard Extruder1 – I am not using this, as all my extruders are on Duex5
  • Drive 5-9 – My extruders on Duex5


; Define Drives
; Physical Drive connection
M569 P0 S1 ; Drive 0 X
M569 P1 S0 ; Drive 1 Y
M569 P2 S0 ; Left z-motor (original Z)
M569 P3 S0 ; Right z-motor (Ex0)
; M569 P4 S0 ; EX1 - unused
M569 P5 S1 ; Extruder0 - Physical Tool 0
M569 P6 S1 ; Extruder1 - Physical Tool 1
M569 P7 S1 ; Extruder2 - Physical Tool 2
M569 P8 S1 ; Extruder3 - Physical Tool 3
M569 P9 S1 ; Extruder4 - Physical Tool 4

Use M584 to remap the drives

To make this all work, we need to tell the controller how we have conencted our physical connectors:

How to do this:
  • We are starting the new line, which we place under our M569 section above, by issuing the M584 gcode.
  • Then simply go through and use the definitions we made above.
  • X0 – Using Driver 0 as X
  • Y1 – Using Driver 1 as Y
  • Z2:3 – This is the new part, where we define that we are using both Driver 2 and 3 for our Z. This means both are used when hitting the move Z buttons.
  • U3 – We assign driveletter U to our second Z motor, using Drive 3.
    • When using virtual drivenumbers we can’t just come up with some random letters.
    • As of firmware 1.19, we can use UVWABC letters – in that order!
  • E5:6:7:8:9 – Defines how all drivers on the Duex5 are Extruders.
  • P3 – This defines the number of visible axes in our GUI, starting from the first, meaning the visible ones are: XYZ, while the 4th axis U is not shown up in the GUI.
    • You might want to have U visible at first in order to verify your new setup.

; Motor remapping for dual Z
M584 X0 Y1 Z2:3 U3 E5:6:7:8:9 P3 ; Driver 0 For X, 1 for Y, Z=2:3 U=3, Extruder 5-9

Configure Drives

Next step is to configure our machine to use 2 drivers instead of just 1 and to add the new U drive to our Drives configurations.

What you need to do now, is setup microstepping, steps/mm and all other such settings as if you have 2x Z-drives and 1x U-drive

Endstop Setup

Last item in our config.g we need to change is the Endstop configuration. Contrary to above, we do not define a second Z here (As we only have 1 z endstop), but instead just add the U endstop. It’s important that Z and U homes to same end; in this case at Z-max.

Example configuration for non-duex users

This section is a cleaned up section for all the non-duex owners, so you don’t have to sit and sort out my Duex5 config.

Just use the explanations for the Configure Drivers and Endstop Setup just above here.

Explanation:
  • Drive 0-1 as X and Y, which are standard.
  • Drive 2 as 1st Z-motor, which is normal Z
  • Drive 3 as Extruder0
  • Drive 4 as 2nd Z-motor – this is normally Extruder1


; Define Drives
; Physical Drive connection
M569 P0 S1 ; Drive 0 X
M569 P1 S0 ; Drive 1 Y
M569 P2 S0 ; 1st z-motor (original Z)
M569 P3 S0 ; Extruder0
M569 P4 S0 ; 2nd Z-motor - Normally used as Extruder 1

 

  • X0 – Using Driver 0 as X
  • Y1 – Using Driver 1 as Y
  • Z2:4 – This is the new part, where we define that we are using both Driver 2 and 4 for our Z.
    • This means both are used when hitting the move Z buttons.
  • U4 – We assign driveletter U to our second Z motor, using Drive 4.
    • When using virtual drivenumbers we can’t just come up with some random letters.
    • As of firmware 1.19, we can use UVWABC letters – in that order!
  • E3 – Defines Extruder0 as our extruder.
  • P3 – This defines the number of visible axes in our GUI, starting from the first, meaning the visible ones are: XYZ, while the 4th axis U is not shown up in the GUI.
    • You might want to have U visible at first in order to verify your new setup.

And the code to copy/paste:

; Motor remapping for dual Z
M584 X0 Y1 Z2:4 U4 E3 P3 ; Driver 0 For X, 1 for Y, Z=2:4 U=4, Extruder 3

New Homing files

It’s important we remember to create new/modify our homing files to match our new setup.

In particular we need a new Homez.g and a modified Homeall.g.


And the code for easy copy/paste:

G91 ; Relative mode
M584 Z2 ; Split Z into 2 (Z+U)
G1 Z250 U250 F2000 S1 ; Move up to 250mm in the +Z direction. S1 to stop if endstop is triggered
G1 Z-2 U-2 F600 S2 ; Move 2mm in the -Z direction - (I'm not sure what S2 is for?)
G1 Z3 U3 F100 S1 ; Move slowly 3mm in the +Z direction, stopping at the homing switch
M584 Z2:4 ; Join U to Z again (pay attention to drive numbers used)
G1 Z-5 F3000 ; Move back again 5mm in the -Z direction
G90 ; Back to absolute mode

You need to update your Homeall.g files accordingly as well.

Posted on 2 Comments

Duet WiFi/Eth – PID tuning hotend

Since I just changed my old cartridge for a 24v 80w heater on my 5way Diamond hotend and used High Temperature Liquid Gasket Silicone as a sealant on the heatsinks and the Diamond nozzle itself, as is clearly evident on the photo, I need to do a new PID tuning, which is a good starting point for writing a short blog-post on doing just that.

  1. Gcodes used
  2. Prepare for PID tuning
  3. PID-tune hotend heater
    1. Parameters
    2. Heater to tune
    3. Power
    4. Target Temperature
  4. Parameters to use and store in config.g
    1. New PID-Tuning
    2. I’ll add this in my Heaters/Hotend section
  5. Debug – Failing to tune?
    1. Temperature was not reached
    2. Starting temperature is not stable
    3. Over-powered and a fire risk

1) Gcodes used

  • For the actual PID tuning, we are going to use M303
  • M307 H1 to display the parameters we garnered from the PID tuning.
  • Finally you could use M500 to store the parameters in a config-override.g file, which matches the old school Eeprom M500, and overrule the settings in config.g file.
    • I personally have an aversion to this sort of having configurations stored in different places. Especailly for core parameters that shouldn’t change.
    • In my opinion it just leads to confusion as people tends to forget they have anything stored in the override file and can’t figure out why the printer doesn’t accept the new parameters written in the config.g file.

2) Prepare for PID tuning

I prefer to put my hotend close to the heated bed, heat the bed to my most used temperature and then turn on the object-cooling fans at maximum before doing a hotend PID-tuning.

Why you might ask?

I prefer to similuate actual printing situation to get a PID tuning that most closely matches the actual usage scenarios of my printer.

3) PID-tune hotend heater

Parameters

Hnnn heater number
Pnnn PWM to use, 0 to 1 (you should normally use 1 i.e. full power)
Snnn target temperature

Heater to tune
To actually do a PID tuning we need to use the M303 command followed by H1 to denote the heater used, which is the first heater.

If you PID tune your bed, it is H0 by default.

Power
Next we need to define the amount of power we feed our heater cartridge. This is denoted by P followed by a number like P1 for 100% power and P0.5 for 50% power.

RepRapFirmware used to be very, very restrictive regarding power setting. I had to put it at P0.1 (10%) to do a succesfull tuning in january, but His time I could run it at P1 (100%).

Target temperature
Finally we need to define target temperature using S followed by temperatures in celcius like S220 for 220c. Target the temperature you use the most. So 200ish for PLA if that is what you print, or 240 or something like that, if you mostly print ABS.

It means I’ll tune my to 200c at full power like this (mine failed when target was 220):
M303 H1 P1 S200

Sequence is from the bottom and upwards

4) Parameters to use and store in config.g

As mentioned above I’m not a fan of using the M500 to store in config-override.g method, so I’ll get the result from the PID tuning using M307 H1 and put it into my config.g file.

It all seems a bit confusing to be sure

Lets look at the top line, which is the one we are going to be using:
Heater 1 model: gain 188.4, time constant 121.7, dead time 1.4, max PWM 0.50, mode: PID

This translates into:

  • M307 H1 for Heater 1
  • A188,4 for Again
  • C121.7 for Constant
  • D1.4 for Dead time
  • and S0.5 for max PWM

* Default is PID for hotend, so we don’t need to write parameter for this.
* Default for BED is Bang-Bang method, so you’d have to add B0 in the end, to force it to use PID.

M307 H1 A188.4, C121.7, D1.4 S0.5

I honestly do not know why it puts max power at 50%, so i’ll put it at S1 (100%) and use the new parameters to do a new PID tuning like this:

M307 H1 A188.4, C121.7, D1.4 S1

4.1) New PID-Tuning

Saving config.g with the above parameters I’ll run a new PID-tuning target at 220c like so:

M303 H1 P1 S220

I ended up with new parameters with full power on my heater:
Heater 1 model: gain 375.3, time constant 125.9, dead time 3.8, max PWM 1.00, mode: PID

This translates into:

  • M375.3 H1 for Heater 1
  • A125.9 for Again
  • C125.9 for Constant
  • D3.8for Dead time
  • and S0.5 for max PWM

Which means we are going to add this line to our config.g file.

M307 H1 A375.3, C125.9, D3.8 S1

4.2) I’ll add this in my Heaters/Hotend section.

So, this is ho my Hotend section turned out looking 🙂

5) Debug – Failing to tune?

There are different reasons why it migh fail to tune.

Temperature was not reached

Auto tune cancelled because target temperature was not reached Heater 1 switched off

Solution: Try using a lower temperature. It might fail if it took too long to reach the target temperature.

Starting temperature is not stable

Auto tune cancelled because starting temperature is not stable

Solution: You need to wait for temperature to get almost back to room temperature before trying again.

Over-powered and a fire risk

Warning: Heater 1 appears to be over-powered and a fire risk if left on at full power, its temperature is predicted to reach XXXc

Solution: Lower the value of the P parameter, which is the current you feed your heater during testing

Posted on Leave a comment

Duet WiFi/Eth – Recover from Erase + basic setup

I accidentially hit the Erase button on the edge of my Duet WiFi card, which means it wiped my firmware from the controller! Luckily it didn’t wipe my SD card, so my config files didn’t go missing on me.

I still need to setup my controller again though, and while I previously did write a blog-post on doing that, it was a long time ago and a lot has happened since then on how things are done, so I decided to do a new writeup on it.

Also, since it wiped the firmware from the controller, I am now unable to connect to it the regular way, which we need to solve.

Contents

  1. Download firmware and drivers
    1. Install drivers
    2. Rename firmware files
  2. Download relevant programs
    1. Pronterface/Printrun
    2. SDFormatter
    3. SAM-BA v2.17
  3. Write new firmware using SAM-BA
  4. Getting SD-Card Ready
    1. Format SD-card
    2. Copy over SD-Image files
      1. Rename printerfolder
    3. Put firmware files on the SD-card
    4. Make ready for Duet Web Interface
    5. Macrofile for networksetup
  5. Install WiFiserver and activate WiFi
  6. SD Card Folder Structure

1) Download firmware and drivers

  • In order for your computer to communicate with the controller using USB, we need to get the drivers from DC42s Github driver folder.We also need to download the newest firmware and it’s a good idea to download the SD-Image folder to give us a new set of files for our now defunct printer.All in all, it is easiest to just click the Clone or download on the main RepRapFirmware Github page and select Download Zip, which you extract somewhere easy to find and use.
  • In the directories you just unzipped go into RepRapFirmware-dev/Driver folder and right-click on duet.inf and select install to install the drivers.
  • Browse down through RepRapFirmware-dev/Release/Duet-WiFi/Stable and rename the files:
    • DuetWiFiFirmware-1.19.bin to DuetWiFiFirmware.bin
    • DuetWiFiServer-1.19.bin to DuetWiFiServer.bin

2) Download relevant programs

  • Pronterface/Printrun

    In the Getting connected to the Duet WiFi they suggest using a dedicated terminal program to setup the controller/firmware, but I really much prefer using Pronterface/Printrun, as it also has pure terminal function and in my world is essential to configuring and checking any 3D Printer.

    I vastly prefer it over any form of terminal function in all slizers as the slizers comes with some configured settings which can screw up the result you get when moving and axis or sending a command to check a function.

    So, go to the download page for Pronterface/Printrun 3D Printing Host Suite and select the version fitting for your type of computer.

    To use Pronterface/Printrun you just need to extract/unzip the file and run the pronterface.exe file

  • SD Formatter 4

    Note: The program is named SD Formatter 4, but they have a version 5, which is a bit strange.

    Some of you  are going to wonder about why we need a dedicated program to format the SD card, and the answer is quiet simple: To avoid/minimize the risk of the SD card turning bad, either turning completely unuseable untill reformatted, or just performs really bad, with slow speeds.
    The program simply just does a much better job of preparing SD cards correctly and it can even fix many annoying problems many people experience now and then on their printers.

    Go to the SD Formatter (4/5) Download page, scroll down and download and install the version for your system.

  • SAM-BA 2.17

    Since I hit the erase button on the Duet WiFi I can no longer talk to it using Pronterface, as we first need to burn the firmware onto the controller using SAM-BA 2.17. I don’t know why it has to be 2.17, but the specific version is listed on the Fallback description on the Duet wiki. Install it after downloading and leave it open.

3) Write new firmware using SAM-BA

Note: This step is only necessary if you cannot connect to your controller after having hit Erase

  • Connect the Duet WiFi to your PC via USB.
  • Press the Erase button on the Duet WiFi, then the Reset button.
  • Load SAM-BA. It usually detects the correct COM port automatically. Select board at91sam4e8-ek. Press Connect.
  • In the Send File Name box enter or browse to the DuetWiFiFirmware.bin file to be loaded, then press Send File (leave the Address at the default of 0x400000).
  • On completion it will invite you to lock the region; press Yes.
  • To verify the writeprocess press Compare sent file with memory.
  • Press the Execute button next to the Boot from Flash option in the Scripts box. Then exit SAM-BA.
  • Press Reset on the board.
  • You should now be able to connect via USB/Pronterface.
    Try sending the M115 command to check firmware version

Source for this section was found on the Duet Wiki.

4) Getting SD-card ready

  • Format your SD card using SD-formatter – remember to copy out any config-files you might want to save.
  • Now navigate to the folder RepRapFirmware-dev\SD-image you downloaded in Step 1.
    • Copy the entire content to your SD-Card
  • My printer is a CoreXY, so I’ll rename the sys-CoreXY folder on the SD-card to plain sys

 

Put firmware files on the SD-card

  • Copy over the 3 .bin files from RepRapFirmware-dev/Release/Duet-WiFi/Stable we renamed in Step 1.2 and put them into the newly named sys folder

Make ready for Duet Web Interface

  • Turns out the www folder is rather deprecated and didn’t work at all, at my place, so delete the www folder on the SD-Card
  • Now go to RepRapFirmware-dev\Release\Duet-WiFi\Stable and unzip the DuetWebControl-1.19.zip file
  • Rename ths folder to www and copy it onto your SD-Card

Macrofile for networksetup

  • We need to create a small macrofile to make it connect to our WiFi.
    I tried doing this manually without the Macro, but I simply just could not get it to connect..
  • So, go to your Macros folder on your SD card and create a new file named SetNetwork containing the following commands:
    M552 S0
    G4 P1000
    M587 S"your-network-ssid" P"your-network-password"


    Source info
  • Now eject the card from your computer and insert it into your Duet WiFi and connect it to your computer using the USB cable

Install WiFiserver and activate WiFi

Now it’s time to install the DuetWiFiServer onto our board to enable the usage of WiFi

  • Connect to the DuetWiFi using Pronterface and issue the command M997 S0:1 which is going to install/update both firmwares.

Note: I know we allready have the newest DuetWiFiFirmware on it, but easier to remember just one command.

  • Wait for it to finish and disconnect as it’s restarting.
  • Disconnect and Connect again using Pronterface and type M552 S0 to start the WiFi module
    M552 S0
    SENDING:M552 S0
    WiFi module started
  • Type in M98 P/macros/SetNetwork to execute the macro we created
    >>> M98 P/macros/SetNetwork
    SENDING:M98 P/MACROS/SETNETWORK
    WiFi module started
  • Send M587 and check that your network is listed
  • Send M552 S1.
    After a few seconds you should see a message that it has connected to your access point and display the IP it has recieved.
  • Connect via the web interface
  • Enable the M552 S1 command in config.g – if it’s not in there, then just make a new line and type it in.
  • For security, delete the SetNetwork macro file

SD Card Folder Structure

It’s usefull to know how the structure is supposed to be on the SD-card and also to know the function of each of the files and more info.

All this is shown on the SD Card folder structure wiki page

Posted on Leave a comment

PanelDue – Update firmware

In this post I’ll go through updating firmware on the PanelDue.

It’s really not that difficult, but as always, it can be a bit of a chore figuring out the location of and type of files we need to use.

What we need/in this post

You can check your current version by clicking Setup on your display. Mine was version 1.14 – This is in itself not important for this post, but just nice to know.

Know your PanelDue version

In order to figure out the version of PanelDue we own, we need to look at the back side of the PanelDue PCB.

Mine is V2 as can be seen here.

Get the latest correct firmware

Now we know the hardware version of our PanelDue, so lets go get the newest firmware for it from the PanelDueFirmware page

My screen is 4.3″ inches, so combine that with the version 2 and I need to get the file PanelDue-v2-4.3.bin

Program to update firmware

In order to update our firmware, we need to get a program called “Bossa”.

Go to their Github page and download the file fitting for your system and install it.

Erase and Reset PanelDue

Next step is to Erase and Reset the device to make ready for new firmware.
Some of these steps are taken from the official page.

  • Press and hold the Erase button of the PanelDue for at least one second.
  • Release the Erase button, then press and release the Reset button.
    • If you have a version 2.0 board then the backlight will turn off.

  • Identify the COM port number or port name of the PanelDue board on your PC.
    If you use Windows, you can do this by pressing CTRL+Pause/Break or via Start->Control Panel->System->Device Manager.

    • Then expand Ports (COM and LPT), and look for Bossa port.
    • If you can’t find the port, try repeating the Erase and Reset sequence, or disconnecting and reconnecting the USB cable, or try a different USB port on your computer.

Write new firmware to PanelDue

We are going to use the program Bossa we downloaded and installed previously, but you can also use the command prompt.

I’ll list the command for the commandline option, but I have not tested it.

Command Prompt

Under Windows, open a command prompt and use this command:

Taken from the official page.

bossac.exe --port=COM4 -e -w -v -b PanelDueFirmware.bin

Options:

  • -e, –erase erase the entire flash
  • -w, –write write FILE to the flash; accelerated when
    combined with erase option
  • -v, –verify verify FILE matches flash contents
  • -b, –boot[=BOOL] boot from ROM if BOOL is 0;
    boot from FLASH if BOOL is 1 [default];
    option is ignored on unsupported devices

Using GUI

Run Bossa as Administrator and select the Serial Port we verified above.

  • You must put a mark in Erase all, Boot to flash and Lock.
  • Hit Write and wait for it to finish and click OK.
  • Click the Verify button.

PanelDue up and running

Now hit the Reset button on the PanelDue PCB and display should come back online.

Remember to adjust baud to match your settings in your controllers firmware.

Sources

For full read on the Panel Due https://miscsolutions.wordpress.com/paneldue/
Bossa product page: http://www.shumatech.com/web/products/bossa

Posted on Leave a comment

Duet WiFi – Adding a second extruder

As some might know, I’ve been working on a version 4 of my Belted Extruder and am now ready to put it to use on my primary printer, which has been using a single extruder so far.

Drives section

In the Drives section of our config.g file we need to add 7 changes:

Changes in Drives section described:

  1. Add the drive – Using M569
    We allready have X,Y,Z,E0 which are labeled 0-3 so our new drive is nr. 4.
    My V4 Belted Extruder Design is running in reverse, so we set it to S1
    M569 P4 S1 ; Drive 4 in reverse - E1
  2. Microstepping used – Using M350
    I’m using 1/32 microstepping for both extruders, so just adding :32 to the existing line.
    M350 E32:32 ; Extruder0 microstep
  3. Steps/mm for our new extruder. Using M92
    I have not yet calibrated it, so inputting 2050 to go from, after steps defined for our first extruder.
    M92 E2057:2050 ; Steps/mm for Extruders
  4. Speed change – Using M566
    M566 X1800 Y1800 Z12 E120:120 ; Set maximum instantaneous speed changes (mm/min)
  5. Maximum speed – Using M203
    M203 X18000 Y18000 Z2500 E1200:1200 ; Set maximum speeds (mm/min)
  6. Accelleration – Using M201
    M201 X500 Y500 Z250 E250:250 ; Set accelerations (mm/s^2)
  7. Current – Using M906
    M906 X800 Y800 E700:700 Z1200 I0 ; Set motor currents (mA) and motor idle factor in per cent

Tools section

For now, I only have 1 hotend on this printer, but 2 extruders. I’m using a normal E3Dv6 1.75mm bowden, so I’ll just swap over the bowden tube to the extruder I’m going to be using.

It all means I’m not adding any new heaters for now.

To setup our new Tool, we need to add 3 lines to our config.g file:

  1. Add new tool by defining it. Using M563
    P is the Tool Number, D is Extruder drive, which is not to be confused with machine Drive number we defined above. H is the Heater we use with our new tool.
    ; Pnnn Tool number
    ; Dnnn Extruder drive(s)
    ; Hnnn Heater(s)
    M563 P1 D1 H1; Define tool 1
  2. Tool offset – Using G10
    G10 P1 X0 Y0 Z0 ; Set tool 1 axis offsets
  3. Initial active tool – Using G10
    G10 P1 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C

Note: You can combine the #2-3 G10 commands if you like.

That’s it.

You can now go and see the extra Tool in your Settings – Tools section. Yes, you can add Tools in here, but I rather like doing it the other way, to make sure I have everything how I like it 🙂

Just need to add an extra Extruder to your favorite Slizer 🙂

Posted on Leave a comment

Using Duet with Cura and + Diamond Hotend and Firmware Retract

Note: This post is not complete, and the temperature settings in startup.gcode is not correct for use in Cura – I am working on a new, updated, more comprehensive Guide to using Cura for muticolor printing.

In my ongoing project for my 5way Fullcolor Diamond Hotend I’ve had some issues getting Cura to work in the first place and latter again to make it run using Firmware Retract, which is required to make all 5 extruders retract at the same time.

I finally made it all work yesterday, so here comes the setup-recipy for Cura users, once an for all 🙂

Inherent config changes needed for all Cura users using Duet:

Duet is using Relative Extrusion as standard, which Cura does not support. It shows itself in massively overextruding when printing, while at the same time extruding normally when calibrating extruder using Web Interface.

  • Need to comment out M83 in config.g + Use M82 in cura startgcode.

Adding Diamond hotend and we need more changes:

Firmware Retract and Volumetric

Now, in order to use Firmware Retract in Cura we need to use either the Ulticode or RepRap (Volumetric) Gcode Flavor in Machine settings.
We can’t use the Ulticode one, as it removes the startup.gcode option and the second one requires Duet to use Volumetric.

Duet only just supported Volumetric extrusion in 1.19RC/Beta, so you need to upgrade firmware if you havn’t allready.

Extra special important note: Be sure to read upgrade instructions if using 1.18 or earlier as you can not do it through web interface!

To use Volumetric:
We need to use Firmware 1.19 or newer + use the this in config.g

M200 D1.75

To use Firmware retract
Enabled using through config.g

M207 S1.5 F3000

Now it all works but Extruding manually using web interface after enabling Volumetric extrusion via M200 now extrudes only 4/10 though.. guess it’s to consider a firmware bug.

Summary

  • Need to uncomment M83 in config.g + Use M82 in cura startgcode. (This is always the case when using Duet with Cura)
  • Use Duet Firmware 1.19 or newer – Be sure to read upgrade instructions
  • Cura – Use RepRap (Volumetric) Gcode Flavor in machine settings – to support Firmware Retract.
  • Duet Config.g – Enable Firmware Retract using M207 S1.5 F3000   – Diamond hotend retract at 1.5mm is good.
  • Duet Config.g – Enable Volumetric printign using M200 D1.75
Posted on 5 Comments

BLTouch on Duet Wifi & RepRapFirmware

The time has come to setup BLTouch on my system.

I’m going to use Duet WiFi + Duex5, but I’ll post details about using it without the Duex as well.

Since I do use Duex5 and because of other considerations explained in this blog-post, I’ve decided upon not following the pin selection most often mentioend other places. I do however try to explain my reasoning and how you can use it to customize your own setup.

Please let me know if you have comments or inputs. I do take all comments as a positve thing, also potential corrections to my writings 🙂

When I feel I have everything I need, I’ll boil down on this post and use it as a “how-to” for both duet3d wiki and instructables.com

Index

Physical overview

First a short explanation on how a BLTouch sensor works and what it is: The BLTouch sensor is in the category of Servo sensors, meaning it’s using a mechanical servo mechanism to raise and lower the metal pin to do the testing.

Quote from the maker: ANTCLABS(A&T)

  • BLTouch is an auto leveling sensor for 3D Printers based on open-source.
  • Simple, Smart, High-precision
  • It could work with any kinds of bed materials, such as glasses, woods, metals, and so on.

Probe Connector role

At first the Duet Wifi and RepRapFirmware didn’t support servos, but focused on other sensor types like their own IR-sensor.

It means the description on the WiKi can be a bit confusing for us non-electronical centric people as they talk a lot about using the Probe Sensor, which just doesn’t apply fully to the BLTouch Sensor. (To be honest I get more confused by reading this page, so don’t feel bad if you are like me!)

They have added a BLTouch section now though, which helps a lot. Thumbs up! 🙂

It means we can’t just use all the pins from the Probe connector as the sole connection on the Duet WiFi, but only use 2 of these pins in the Probe Connector, GND and IN, to register the actual signal from the BLTouch. We need to use PWM connector for the other 3 pins from the BLTouch.

The Probe Connector is the one to the right in the photo. Placed next to the LCD connector to the left of it.

The red wire is IN and black wire is GND

Note: You might notice the small 480Ω resistor crimped into the connector here. More on this later.

Using expansion PWM port for Servo

The 3 remaining wires from the BLTouch are there to control the Servo Pin inside the BLTouch.

Since we have a Duex board we are going to use 1 of the 5 ports labeled as “PWM” ports on the board itself, but listed as “Shared with servos” on Duex2/5 main features page.

When looking at the Wiring Diagram, the connectors are labeled as “PWM / Servos“.

Physical Connections

Lets start by looking at the 2 wires for the Probe Connector on the Duet Wifi/Ethernet.

2-Pins for Z signal

We are going to connect the 2 wires labeled Z (white) and GND (black) on the BLTouch and connect to the matching pin on Duet WiFi Probe Connector, as shown in the diagram.

Note: Your wires might be colored differently. Especially if you use a counterfit version like 3DTouch.
My version of the BLTouch is an old Classic version.

5v to 3.3v logic level conversion

The BLTouch is as default configuring using 5v logic. It means we have to make sure we set it up to run as 3.3v logic instead. Don’t worry about not grasping what 3.3v logic means, as it’s really not important to know what it is, only how we hook up our sensor.

If you have an old Classic BLTouch (as I do), you need to either solder or crimp in the included 480Ω (ohm) resistor between the 2 wires for the Probe Connector.

I crimped them into my connector. Mine came with a 480Ω and 10kΩ resistor.

I do not know why the 10kΩ was included.. anyone know?

If you have a new version of BLTouch with serial number, you just need to cut the solder away between 2 solder pads, as shown here:

3-Pins for Servo

The 3 left over wires on the BLTouch are GND (brown), Red (5v) and Orange (control signal)

If you do not own a Duex expansions port and instead use the pins on the Duet Wifi, you connect as shown on this diagram:

You can use a different Heater-pin, just make the necessary adjustment in your configurations.

  • GND ( G, Brown) to pin 2 on Duet WiFi
  • 5v (5v, Red) to pin 1 on Duet WiFi
  • Orange (S, Control signal) to pin 31

Some info on the Duet Wiki where they use pin 8 instead of my 31. They are also using different colors than my BLTouch, so be sure to check on your own model!

Note on below wire colors: I did not have any brown (used black) or orange (used white) cables, so go by the labels near the connectors, or remember my choices.

The difference between Pin 8 and Pin 31, is how Pin8 is assigned Heater 3 and Pin31 is assigned Heater 7. I picked the last available, in case I later wanted to actually use Heater 3 as a heater. I’m never going to use 7 heaters, and Heater 7 connector also made for nicer wiring in my case 🙂

Note: It can be confusing how the numbering on PWM# and E# doesn’t follow each other. Reason for this is, how the Heater numbers (E) starts with E0 and E1 located on main Duet WiFi board, while the PWM ports are either starts with PWM1 or PWM0 is somewhere not known to me.

The above diagram is a small part I made out of the full diagram.

Firmware Configuration

It’s time to configure our firmware in order to use the BLTouch sensor we just connected. There is some good information on the Connecting a Z probe – BLTouch on the Duet3d wiki.

Disable heater

As shown in the warning in the above diagram, the PWM channels are shared with the heaters, so we need to disable the relevant heater.

We are using the PWM_5 connector, which is the 7th Heater.

We disable it using the M307 Gcode command and setting A, D and C to -1 in our Heaters section in Config.g file. Setting them to -1 means they are disabled.

M307 H7 A-1 C-1 D-1

Note: change H7 to whatever heater you need to disable according to how you choose to wire it up.

RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the A, C and D parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin.

Set Servo Position

Now we need to configure the position of our Servo Pin, which we do using the M280 Gcode command.

Deploy Probe

In order to do so, we put the following into our deployprobe.g file. If you do not have this file, you just hit New File in the System Editor where all the other config files are located and create it.

Insert the following into the file, where the P-number corresponds to our H-number above.

M280 P7 S10

S10 is the “angle” the PIN is put in to engage. You can read more and also see a table of most of the expansion pins. When dealing with BLTouch the engaged position is at angle 10.

Note: In the Duet wiki it is listed to include a Invert parameter: I1 at the end as well, but mine doesn’t work when used.

Retract Probe

Next we need to configure how we retract the Servo Pin in the BLTouch. These settings are configured in the retractprobe.g file. Create it the same way as before if you don’t have this file.

M280 P7 S90

Once again, the P-number corresponds to our H-number while S defines the “angle” to put the probe into. When dealing with BLTouch the retracted position is at angle 90.

Note: In the Duet wiki it is listed to include a Invert parameter: I1 at the end as well, but mine doesn’t work when used.

Configure Endstop Section

Set Z-Probe type

Now we need to setup the Probe Type to Type 5 in our Endstop section in the config.g file using the M558 command.

P5 (from RepRapFirmware 1.14) selects a switch (normally closed) for bed probing between In and Gnd pins of the Z-probe connector (Duet 0.8.5 and Duet WiFi).

Settings legend/explanation:

Overview of what the different parameters means and do:

  • P# = Mode/Type of probe – P5 is for bed probing between In and Gnd pins of the Z-probe connector.
  • XYZ# = 1 use probe for this axis. 0 do not use probe for this axis
  • H# = Dive Height of the Servo pin. 5mm is normal for BLTouch
  • F# = Feed Rate mm/min
  • T# = Travel speed to and between probe points (mm/min)

It all means that we insert the follow line for our new Z-Probe, defining the Type and usage settings.

M558 P5 X0 Y0 Z1 H5 F120 T6000 ; Set Z Probe to type Switch or Digital output where Z probe connector is used. Used for z only.;

  • Put it in the Endstop section in config.g file:

Set or Report Current Probe status

Next we need to setup how the Probe behaves, using the G31 command.

Settings legend/explanations

  • Z# = Trigger height. 1.5mm is normal for BlTouch
  • P# = Trigger value. 25-100. Lower it if nothing happens.
  • XY# = Placement of probe relative to your nozzle. Called offset. In mm.

It means we set trigger value to 50 (don’t worry if it means nothing to you), define where the probe is placed in realtion to our nozzle and the trigger height of the Probe Pin.

The Z value is the Z-offset. Used to tune the distance between trigger location and nozzle. Higher offset value and you get the nozzle closer to bed.

G31 P50 X-25 Y38 Z1.5; Set Z probe trigger value, offset and trigger height

  • This line is also placed in the Endstop section in the config.g file.
  • Just place it under the above M558 line.

G32: Probe Z and calculate Z plane

The G32 Gcode Command can be used to define 3 or more probe points. I am only using mine as a Z-min endstop with 1 point, so not going to use this feature for now.

Links

Relevant Gcode commands: