Using a 3D touch probe in MACH3

I finally got my 3D touch probe!
Now I can finally probe
  • the exact center of my 4th axis (left+ride side in Y and probed height minus radius at the Y=0 position)
  • probe the A=0 position on my 4th axis be turning it until chuck #0 makes contact at a known probe location in X,Y,Z
  • check the orientation of non-conductive blocks of materials and rotate my work coordinate-system accordingly
  • probe the height of the top-side of non-conductive materials
  • check that I inserted a cylinder into the 4th axis straight
This also means that I can pause a long running job (when my weekend in the hobby workshop ends),
switch everything off, come back the next weekend and  home everything within 0,01mm to resume.

I just soldered on the connector (same connector I use for the existing tool-height probe) and have yet to test it in the YOOCNC6040.
It is normally closed but luckily my normally open tool height probe is modified to be kept high with an extra +5V line and gets pulled to GND on contact with the spindle. (The actual plan was to isolate the frame of the CNC and pull that to +5V. Then any metal to metal contact of the spindle to the machine would be an automatic E-Stop but I didn't get that to work due to the stepper casings being at GND and having conductive contact with the frame.)



Adding homing-sensor to 4th axis on CNC


I have a 4th axis on (both) my CNC milling machine(s).
I want a home switch that indicates a perfect 0°.
So I can stop a job, switch off the machine and later home all 4 axis to their homing switches, jog to the last position and continue the program.

Later I'd like to do the same for a planned 5th axis.


Ordered the sensor. Not started doing it yet. Stay tuned... (this blog posting will be updated)

Hardware choices

This is my 4th axis. (50:1 harmonic drive gearbox with a K11-100mm 3 way chuck attached.)

M8 2mm sensing DC 5 V NPN LJ8A3-2-Z/BX-5V zylinder induktive näherungsschalter sensor arbeitsspannung 5VDC spezielle für MCU

This is the sensor "Finglei Electric LJ8A3-2-Z/BX-5V" (5V NPN induction sensor) I'd like to mount as a home switch.

Why inductive?

The sensor needs to not block the movement of the 4th axis past 360°.
For a simple, mechanical switch that can be solved by attaching a ramp to the disc.
However it also needs to allow movement in the opposite direction. That doesn't work well with mechanical switches.

Optical switches can get confused by dust and shavings.

So I have chosen an inductive sensor as the most reliable and simple option.


I have taken my information from this tutorial and this discussion.

  • connect blue to GND
  • connect brown to +5V supply voltage for the sensor (I could have used a 48V sensor but I wanted to play it safe)
  • connect the remaining black wire to +5V via a 100KOhm pull-up resistor
  • and also connect the black wire to the input.
My PLCM-E3P CNC (used with the PLCM-B1 breakout board) provides me with 15 inputs to use here. They can work with 5V signals.

You can't use the +5V from the stepper-enable outputs to drive the sensor inputs.
(e.g. for a tool-height probe).
I had to add an extra 5V supply just for that existing tool-height probe.


My plan is to
3D print a mount for the sensor on the side of the gear box.
(Possibly using the slots that already mount the gear box to the table to not accidentally drill into the gears inside)

Then attach a modified wascher to one of the bolts securing the chuck to the plate to detect when it passes the sensor once every 360°

The sensor must have a gap of no more then 2mm to it's metal target.
Update: In  MK2 I forgot to leave clearance for the heads of the M6x30 machine bolts. So I had to change the design slightly for MK3.

Here is the 3d printable design of the sensor holder:


Multi Axis G-Code generation with CNC-Toolkit

Yes, CNC-tookit is ancient. But since Fusion 360 doesn't do the job...so well...
Here are my notes about how to get cnc-tookit running on a modern Windows 10 and create 4 and 5 axis toolpathes with it.

I may add screenshots to illustrate my notes at a later point.


I'm trying to figure out if and how to generate 4 and 5 axis G-Code in CNC-Toolkit to run on my heavily modified YooCNC 6040 machine.

Getting the software

  1. get GMax
  2. get CNC-Toolkit
  3. The registration website for the (always free) GMax software no longer exists... GMax registration workaround 
  4. I haven't looked at these yet  

Setting up Gmax

Before you start, you should select the system unit of meassurement in Gmax using Customize-Preferences... and then General-System Unit Scale.

Geometric assumptions

Some assumptions I do about the CNC machine:
  • We use a 4 axis machine with the A axis mounted on the bed of a carthesian CNC mill.
  • The A axis is running along the X axis (along Y it would be the B axis after all)
  • The center of rotation is at Y=0 Z=0
  • The stock starts at X=0 and ends at X>0
  • The stock is cylindrical. 
  • positive Z mean "up" from the center of rotation towards the spindle.
Further assumptions:
  • We use a ball nose cutter
  • We are only interested in FINISH-passes. (For roughing 3 axis milling of X+A+Z is enough)
  • STL-file and tool sizes and machine coordinates are in millimeter

From STL to G-Code 

I used this tutorial to make these notes.

  1. Make sure your object is already scaled to the right size.
  2. Orient your object along the Y axis.

Convert STL to 3DS

GMax doesn't seem to understand STL or the unual CAD file formats.
So we need a converter.

3D Exploration 1.5 can be found here : cnczone.com/forums/attachment.php?...
(Yes, you need a user account in the CNCZone forum.)
In Windows 10 you need to install this using compatiility settings.
It is discontinued but you should of cause still register it for 40.77 € +19% sales tax = 48.52 €.

If objects in the original file exceed the 64,000 faces per object limit for .3DS, it splits info face groups that you need to reunite inside Gmax using the Editable Mesh 'Attach' or 'Attach List function.

  1. Open "3D Exploration 1.5".
  2. Select your file on the right side.
  3. Select File-Save As... and the 3ds file format.

combine face groups

On the right side you have  a number of tabs,
  1. In the first tab, you can assign a name to your objects to identify them.
  2. In the "view" tab with the monitor icon, you can hide objects that clutter your view and render them as solid objects.
  3. In the tools tab, you can "attach" and "attach list" multiple face groups into a single mesh.

Load model

  1. File-Import your convertes mesh.
  2. Make sure it's oriented along the X axis due to limitations of cnc-toolkit.
  3. Note down the size of your stock.
  4. Select your object and in the top right panel, give it a name.

Run cnc-toolkit

  1. Run the "CNC-Toolkit-4.34b.ms" MaxScript file using the menu.

Next select your machine type.
  • XYZ is a 3 axis mill
  • XYZA has 
    • a 4th axis mounted on the work-surface that rotates around X
  • XYZAB has 
    • a 4th axis mounted on the work-surface that rotates around X and
    • an additional 5th axis "B" mounted on the Y gantry, rotating the spindle around Y
  • XYZABC has a trunnion arm mounted on the Y gantry
    • C mounted on the trunnion rotating around the vertical axis
    • B mounted on the C axis to rotate perpendular to to C
  • XYZAC has a 4th and 5th axis combination mounted on the work surface. 
    • A rotating the table and 
    • B rotating the part on the table surface
The offsets are the distance from center of rotation to the tip of the tool.
For an axis mounted to the work table,  as with XYZA and XYZAC I assume it's the distance from center of rotation to the origin point.

Create a cylinder of splines

  1. In the "parallel splines" section choose "helical" or "cylindrical"
  2. Enter apropriate X, Y and Radio -dimensions for your stock.
  3. Click "Make parallel splines" and wait a second for them to apear.
  • "Stepover Distance" controls the distance of parallel toolpathes at the outher diameter.(Oviously the closer they are to the center, the closer they get. Keep that in mind for stock that can melt or catch fire.)
  • Despite the name "Stepover" is an absolute distance between tool passes and ignoring the tool diameter.
  • "Stepover" also ignores any changes in radius during the later projection. As the spline gets near the center of rotation during projection, the resulting toolpathes are much closer then the initial "Stepover" distance.

Project splines onto surface

  1. In the "project spline" section, click "object" and select your object.
  2. Select the spline.
  3. Click "project around X axis"
  4. Delete the unprojected spline using edit-delete (it's no longer needed and can be re-created with just 1 button)
It should now wrap the surface of your object.
  • Height offset is otherwise known as a skin depth and allows for roughing passes

Create tool vectors along projected spline

  1. Up in the "angle control" section, choose "Use Reference Surface".
  2. Then "Pick Reference Surface".
  3. Select your object and the button should not read "Ref Mesh = ". 
  4. Select the projected spline. (Not the original spline. You can delete that one.)
  5. In the "toolpath generator" section, choose "Toolpath from Shape".
You may have to wait for a few seconds.

Generate g-code and show animation

Now you can use the "Tool Control" and "Postprocessor Options" sections to export your g-code to the "Script listener window" to copy and paste it.
(The other options here work in 3D Studio MAX but not in GMAX)

You can find that windows with F11 or in "MaxScript"- "MAXScript Listener..." .

After postprocessing, you can use "/" or the play-button in the lower right to see an animation of the milling process.


I have not yet fully understood how to compensate for the tool shape.
The tangent mode seems to use the entered tool diameter and offset it along the surface normal.
This simple method would of cause be problematic in pockets narrower then  1.0x the tool diameter that can not be milled with a tool of this size. However an infinitely small tool will try and the applied offset will cut widen the pocket beyond the intended geometry.

As an alternative I should test importing an existing 3 axis toolpath and having cnc-toolkit perform the too-orientation only. Aparently toolpathes from CamBam (trial versions) can be exported as DXF and imported into GMAX. I don't think that works for gcode -toolpathes of my favorite 3 axis CAM software.

I have also not understood yet how to use your own geometry to represent your machine for better visualision and for collision detection. Aparently you can "link" your own geometry to follow the path of the generated stand-ins and then hide the stand-ins.


Multi Axis G-Code generation with Fusion 360


I'm trying to figure out if and how to generate 4 and 5 axis G-Code in Fusion 360 (Hobbyist version = ultimate features) to run in MACH3 on my modified YOOCNC 6040 machine.
Because even the new "5 axis operations" in Fusion 360 don't work for organic shapes without contours. Any I only ever need/want 4 and 5 axis milling for organic shapes to get perfect surface finish on curved surfaces.


This is a WORK IN PROGRESS and I'm using this blog posting to collect the links and bits and pieces I found so far.

Machine compatibility

I could not yet determine if the machine control program (in my case MACH3) is required to support TCP (tool center point) compensation.
This means that X+Y+Z coordinates in G-Code refer to the center of the tip of the tool and A+B+C refer to the angle of attack.

During G-Code Generation Fusion 360 has absolutely no idea if a given orientation is mechanically impossible for the machine to perform and thus cannot aproximate it with a less then ideal angle of attack or a similar mitigation strategy.

It is clear that all calculations happen in the Machine Configuration.
To get there you already need to have a toolpath. It's in "postprocess"->Open Config.
"Tip: Ask your reseller about customization of the setup sheets and post proces" is not very helpful if you build the machine yourself and therefore ARE the "reseller".

Milling Strategies 

There is no German documentation yet.

Trying OpenBuilds linear actuators with end stops

I'm trying out expensive but (up to this step) well done OpenBuilds kits combined with cheap 20x20 I-Type aluminium profiles for a machine I'm building.

However uppon installing the OpenBuilds End-Stop kits I just got a big WTF moment....
(Images directly from the OpenBuilds Part Store website. So nobody can claim the photographer got it wrong...)

1) How the *** am I supposed to attach a micro switch to an aluminium plate like this? There is no thread for the screw to fasten to. It's just 2 oversized holes in the mounting plate. Inserting the screws liks shown just means to loosely stick them in there and want for them to simply fall out on their own.

No you can't insert them the other way around because these are not sink hole screws with tappered holes in the aluminium plate. So you don't get a flush surface to mount this crap to the aluminium profile rail.

2) Why is +Open Builds requiring a different tool-size (1mm hex) for "Micro Limit Switch Kit with Mounting Plate" then the 3 different tool sizes they already need for the "V-Slot™ Linear Actuator Bundle" (1.5mm, 2mm and a tiny one for the stepper)?

3) Why no use a smaller screw that fits THROUGH the holes in the micro switch instead of eating their own thread into the plastic.


Lenovo and UPS completely FAIL to deliver my new Laptop

On 30.8.2016 I ordered my new Lenovo P70.
A 4400eur workhorse of a workstation-laptop that was supposed to accompany me for the next 5 years to come.

On 3.09.2016 my payment was acknowledged.
...so far so good.
Somehow on the same day I was asked to register within 30 days for my 5 year extended waranty. Despite obviously not having a laptop for weeks to come. However after a quick email I was told that I only needed to register after actually receiving the laptop.

On 10.9.2016 I got a strange notification that I was shipped???? a 5 year waranty. However that is physically possible.

On 14.9.2016 I was informed that my laptop was delayed and would be shipped on 27/09/2016 (+1 week).

On 22.9.2016 I was informed that my laptop was delayed and would be shipped on 20/10/2016 (+1 month).
However 2 days later I was already informed that my hardware had been shipped. However
  • with an empty tracking number
  • no mention what shipping service was used
  • login data for a broken shop system that doesn't allow me to see or do anything at all despite look at the same error code in Firefox, Chrome and Safari on MacOS, Windows and Android.
On 27.9.2016 I finally got an answer that of all the possible shipping companies, Lenovo in their infinite wisdom had chosen UPS. ...and a tracking number.  ...that's when the "fun" starts.
I never ever choose UPS for anything. It's not a regular parcel service. It's a business 2 business curier and as such ONLY works for delivering to businesses that have offices that are open every weekday 9-5. They are completely incapable of delivering to a private address of anyone who works during the day. They don't have offices, robotic parcel-pickup stations or a way of deliverting to dropoff points or other neibours. They never invested in any of that because business 2 business couriers don't need that.

I don't work in the same city Mo-Fr where I live Sa+So. The city where I work changes frequently.

UPS answered that
  • I can not pick up my order on a Saturday because they are closed.
  • I can not reroute my package while it is still in Cologne (there it was scanned again and again for 4 days straight. 4-5 times a day. Without going anywhere.)
  • Lenovo has explicitely forbidden them from rerouting the package to my workplace and that was only possible after the first delivery-attempty anyway-.
  • They are incapable of routing the laptop to the only UPS partner shop for pickup.
  • They never invested in their own Packstation -network.
  • They are incapable of drop-shipping into my shed behind a code lock.
Lenovo answered that
  • They can not change the delivery address after it was shipped. (Not understanding that this wasn't what I asked. I asked Lenovo to simply allow UPS to change the address.)

On 6.10.2016 I just received a message that I have registred for my 5 year waranty....despite never having done that because I never received a laptop yet.
I have moved heaven and earth to find a way to stop work very, very early and take 3 trains, 1 taxi and 1 car ride to get to the depot 30min before it closes (according to the website).... only to be informed on telephone that the depot has changed it's opening hours and will close way before I have any chance of getting there.

So on 7.10.2016 my laptop will  be automatically returned to China.
...Levono said they would refund all of it. (I hope that covers the paid for exended warranty.)


Multicam editing in DaVinci Resolve 12.5

One of the great new features of Davinci Resolve 12 is multicam editing including synchronizing cameras via their sound track.
Something I have done extensively in Final Cut Pro X and now want to do directly in Resolve, so save the extra step of colour graded, intermediate files rendered from Resolve and edited in FCPX.

Since nobody seems to write about actually using this feature, I use this blog posting to document my findings.


If you don't want to read all of it:
  • you can't add a camera angle to an existing muticam clip with automatic syncing
  • syncing by soundtrack doesn't work at all (either crashes even in trivial cases or doesn't sync) 
  • there are serious bugs and even crashes related to multicam clips.
  • file creation dates can not be used as a criteria to get at least a starting point
  • identifying what clips are from the same camera doesn't work (ignored Camera ID metadata field)


Davinci Resolve 12.5 Studio with hardware dongle on MacOS.

This is a stage show. Not scenic film. Not a documentary.
Together with sports events this is probably the most common occurence of a multicam edit of more then 3 cameras. (Interview typically max out at 3 cameras.)

Material to work with:
  • No clapperboard (the audience wouldn't be pleased) 
  • No time code synced via cable (hald the cameras don't support it, TC-generators cost a fortune and we aren't allowed to put cables all across the emergency exit routes)
  • Nothing can ever be re-shot. There is one chance and one chance only to record it.
  • 1 Zoom H6 doing a continous audio recording (including -6dB backup) including pause times.
  • 2 Blackmagic Pocket cameras in ProRes with Atomos Samurai Blade HDD recorders
  • 2 GH4 with Atomos Shogun SDD recorders
  • 1 Blackmagic Production Camera 4K recording RAW (for dark scenes for easier denoising) and ProRes (for bright scenes to save SSD space due to limited number of SSD we could rent)
  • 1 GH4 with internal MPEG recording
  • some 3rd party footage will come in later
  • cameras record 3 acts of 4 scenes per act but not the pause times

Problems identified

Problems in Ingestion

  • Resolve doesn't import any camera name/id from any camera except the Blackmagic Production Camera 4K in RAW (but NOT in ProRes) => WTF?
  • Individual dropped frames in RAW recordings (it's a 3+h show. Such things happen) have to be manually added via shell-script for Resolve to even acknowledge that there IS a recoding in that directory and not a million image files. => not exactly robust software for a production environment

Problems in automatic syncing

Due to the 2GB limit, the audio track is broken up into 3 files.
  • syncing even a single clip to a compound clip of the 3 arranged audio files crashes resolve every single time => Bug ticket with Blackmagic Design [Support #BAX-398-79379]
  • syncing to the 3 individual wave files lets everything start at 0, even the 3 audio files with file creation timestamps indicating their correct positio (*hint* *hint*)
  • Same for any atempt to sync 2 video clips with 95% identical audio 
  • "detect clips from same camera using: Metadata Camera #" completely ignores any manually entered value into the "Camera ID" metadata field => BROKEN
  • There is no way to define a track as the master track for every other track to sync against
  • There is no user interface to ADD an additional camera/clip to an existing multicam clip with automatic syncing.
  • There is no user interface to re-sync a single or multiple, selected clips inside a multicam clip.
  • There is no user interface to even create a new multicam clip from clips that are in different bins (e.g. because you like to organize clips by camera to make colour grading them easier)
Result: syncing via audio track IS BROKEN and the feature is HIGHLY INCOMPLETE.

No software should EVER crash (at worst it should display an error message) and this feature plain doesn't work even under ideal real-world conditions. Maybe it would work if the cameras had identical audio tracks instead of recording the same audio independently using their own microphones but that's not a realistic scenario nor a useful feature.
Without the ability to add tracks later, the implemantation of this feature can not be considered to be "complete" in any sense of the word. 

Problems in manual syncing

  • Draging a new video clip into the audio area of a multicam adds only the audio.
  • The selection of what should be visible and non-silent when doing sync-work in the multicam clip directly affects what video and audio angles are exported for use in timelines that make use of this multicam clip. Anything you hide/mute will not be offered as a choice later or display as black/silent.
  • There is no way to scale the waveform display without adjusting the audio levels, so that you can clearly see all you need to see for manual syncing via audio waveforms.
  • There is no visual display of the border between individual frames whe zoomed in far enough in manual syncing. You only notice how far you have zoomed in when trying to move the clip around.

Problems in workflow

  • Clicking or double clicking a multicam clip or timeline does not open it in the timeline editor...it simply does nothing at all. 
  • When doing picture-in-picture and multicam clip that makes up the smaller picture has no clip for the selected angle at the current time, not only does the scaled-down area where the PiP would apear go black but the ENTIRE frame goes black. => Bug ticket with Blackmagic Design [Support #BSX-823-55972]
  • The manual refers to keyboard shortcuts as they are on an English keyboard. There doesn't seem to be a German manual explaining the German keyboard shortcuts. (Something like "Option-Shift-[" or "Option-Shift-\" would break your fingers as "[" and "\" are Option-combinations of digit keys and not first order keys here.)
This blog posting is constantly being updated while I am editing my multicam project.



Getting started with the Raspberry Pi 3 OctoPrint Bundle

After upgrading to the low friction spool holder,
I just got myself the Raspberry Pi 3 OctoPrint Bundle from Watterott.
It shall be the center component of my Ultimate Filament sensor.

Since it doesn't come with any instructions, here is what you need to do:


Don't plug it in yet!
Insert the SD card into a regular computer and edit the file octopi-network.txt .

Then insert the 2 transparent elements into the 2 holes near the micro USB socket.
(Yes, there are 2 plugs for 4 holes and no instructions.)

Now insert the Raspberry Pi and then insert the SD card.
The contacts should face upwards.
(It is near impossible to the the cards out again.)

After switching it on, you can connect to it via http://octopi.local .


You can also access the raspberry via SSH
ssh pi@octopi.local
The default password is "raspberry.
The SD card is mounted as /boot
The OctoPrint config file is at "/home/pi/.octoprint/config.yaml"
You can restart the server via "sudo /etc/init.d/octoprint restart"

If your Wifi access point via
sudo sudo iwlist wlan0 scanning | grep ESSID
can't be seen by Linux, run
sudo raspi-config 
and select "5 internationalization options" -> "I4 select Wifi locale"
to enable the Raspberry to see all Wifi channels that are legal in your country.

The Raspian I got was very old. I had to provide Internet via Ethernet and do
sudo apt-get update
sudo apt-get dist-upgrade
then it was able to see Wifi networks on Channel 40 (5GHz) and 12+13 (2.4GHz).

GPIO fun 

While at the shell, you can have fun with the GPIO pins in Bash.
Sadly you can't set the pull-up resistors from the shell.
However my image came with WiringPi already installed.
It doesn't have a "--help" or a man page on the Pi itself, so here are the basics:
  • gpio readall
  • gpio mode (pin) in/out
  • gpio mode (pin) up/down/tri         (set pull up resistors)
  • gpio read (pin)
  • gpio write (pin) 0/1
  • gpio wfi (pin) rising/falling/both    (non-busy waiting for a state change)
  • (more)
  • (reading multiple gpios )
  • ...including timeout via read -t (seconds) || echo "timeout detected"  ...still in bash ;) 


Sorry, there is no hole for the Raspberry Pi camera. The best place to cut one is probably on the side (so you don't damage the cool logo), above the camera connector.

This longer cable (Reichelt) may be helpful.

Cura slicing

Luckily the Bundle comes with thje CuraEngine plugin preinstalled. So slicing it not much of a problem.You can imort your existing 15.x profiles (but not 2.1.1 profiles) in Settings->Plugins->CuraEngine->import profile.

BTW, there are "send to Octoprint" plugins for Cura on the desktop!

Ultimaker II setup

The Ultimaker series is not supported out of the box.

Settings->printer profile:

Profile  (UM2 extended)

  • Color: default
  • (X) Rectangular 
  • Origin: lower left
  • X: 223mm
  • Y: 223mm
  • Z: 315mm
  • (X) heated bed

Profile  (UM2 go)

  • Color: default
  • (X) Rectangular 
  • Origin: lower left
  • X: 120mm
  • Y: 120mm
  • Z: 115mm
  • (X) heated bed

Profile  (UM2)

  • Color: default
  • (X) Rectangular 
  • Origin: lower left
  • X: 223mm
  • Y: 223mm
  • Z: 205mm
  • (X) heated bed


After "after abort of a print job" enter:
;fans off
;extruder heater off
M104 S0
;heated bed heater off (if you have it)
M140 S0
;metric values
;absolute positioning
;move Z and X/Y to min endstops
G28 Z0 X0 Y0
;relative positioning
;retract the filament
G1 E-5 F300
;steppers off
;absolute positioning

Cura 15

in Cura set: GCode Type = RepRap (Marlin/Sprinter)
start.gcode (first line must be blank)

;Sliced at: {day} {date} {time}
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line
;M109 S{print_temperature} ;Uncomment to add your own temperature line
G21        ;metric values
G90        ;absolute positioning
M82        ;set extruder to absolute mode
M107       ;start with the fan off
G28 X0 Y0  ;move X/Y to min endstops
G28 Z0     ;move Z to min endstops
G0 X20 Y20 F{travel_speed} ;bring extruder to the front
G1 Z25.0 F{travel_speed} ;move the platform down 25mm
G92 E0                  ;zero the extruded length
G1 F200 E25              ;extrude 25mm of feed stock
G92 E0                  ;zero the extruded length again
G1 F{travel_speed}
;Put printing message on LCD screen
M117 Printing...
end.gcode (first line must be blank)
;End GCode
M107 ;fans off
M104 S0                     ;extruder heater off
M140 S0                     ;heated bed heater off (if you have it)
G21 ;metric values
G90 ;absolute positioning
G28 Z0 X0 Y0 ;move Z and  X/Y to min endstops
G91                                    ;relative positioning
G1 E-15 F300 ;retract the filament
M84                         ;steppers off
G90                         ;absolute positioning

Cura 2.1

The documentation should be here However that's not the whole picture incomplete.
You need an Ultimaker2extended, Ultimaker2Go or Ultimaker2 profile with the reprap g-code flavor to have start and end added to your gcode files including material temperatures, homing and shutdown. Like this one.
To avoid adding files to Cura itself (and keeping them after updating Cura),
you can put your .json files for a new machine definition here:
  • Cura 2.1 (Linux) ~/.local/share/cura/machines
  • Cura 2.2 (Linux) ~/.local/share/cura/definitions 
  • Cura 2.1 (OSX) ~/.cura/machines for 2.1 or ~/Library/Application Support/cura/definitions
  • Cura 2.1 (Windows) ~/AppData/Local/cura/machines
  • Cura 2.2 (Windows) ~/AppData/Local/cura/definitions for 2.2 
Due to bug #850, you need to copy the fdmprinter.json, Ultimaker2.json and other files you inherit from into the same directory.

You can also add additional materials (use the existing materials in Cura 2.1.2.app/Contents/Resources/cura/resources/profiles/materials as a reference) to
~/.cura/profiles/materials (OSX)
but be careful, the file structure is identical to the MATERIALS.txt that the firmware imports from an SD card but the property and section names inside are different. Strange design decision.

Ultimaker II attachment


It looks like self adhesive Velcro is the best option to attach the box to the back of your Ultimaker II.


Having a Raspberry Pi permanently connected to your printer, that has ample 5V and 12V, it is kind of silly to power it via a separate wall wart. So we should see about powering it from the Ultimaker.


g-code for "after pause"
G91 ;relative positioning
G1 E-25 F200 ;retract the filament before lifting the nozzle, to release some of the pressure
G1 Z20 F15000 ;move the platform down 20mm
G90 ;absolute positioning
G0 X20 Y20 ;bring extruder to the front
g-code for "resume after pause":
G91 ;relative positioning
G92 E0 ;zero the extruded length
G1 F200 E55 ;extrude 55mm of feed stock
G92 E0 ;zero the extruded length again
G1 Z-20 F15000 ;move the platform up 20mm again
G90  ;back to absolute positioning
G1 F600 ; set travel speed