Posted on

RPi Zero Wireless – Video for Duet using MotionEYE OS

Prelude

Just the other day I wrote the post on setting up Video on the RPi Zero W to use on the Duet.

This post is ending up pretty much the same place, where we can access the video on our Duet Web Interface (and much more), but instead of using the full Raspbian install for it, we are going to use the much smaller and specialized MotionEYE OS.

For this project

For this project I’m going to use one of the tiny Raspberry Pi Zero Wireless controllers, 8GB SD card or larger and a Pi NoIR Camera V2. Using the NoIR as I wanted to try it out, and the NoIR makes it possible to record in the dark using IR lightning. I’ve found it’s also pretty nice just in my average dim room.

You also need one of the camera cables for the Zeros, as they are tapered in one end compared to the normal ones. They come in 15cm and 30cm lengths.

Index

Download MotionEYE OS

Go the the download page for Motion EYE OS and download the one for motioneyeos-raspberrypi-. If you look at the filezie, it’s obvious how it’s very lightweight and specialized at 68MB for complete OS  (225MB uncompressed) compared to the 4GB of our previous Rasbian installation!

Prepare SD

To make sure there are no unmarked bad areas on the SD drive, I strongly recommend getting a proper SD formatting tool, like SD Formatter, and do a format.

Make sure to pick the right drive, give it a name, choose OverWrite in Options and hit Format.

Unpack and write image to SD

Unpack the file and write image to SD using Etcher. Run Etcher as administrator if you run into problems.

Be patient.. it takes a while.

When it goes from writing data to the SD to Validating, Windows might throw some errors at you, but that’s normal, so don’t worry.

Setup WiFi

As opposed to our previous Raspian venture, we need to make a small file for our USB drive containing the necessary information about our Wireless LAN.

On windows I’m using the standard Notepad to create this file. I’ll not recommend using Notepad++ or some such as they are often more smart than they should be.

update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="MyWiFiNetwork"
psk="password123"
}

Replace MyWiFiNetwork with the SSID (name) of your Wi-Fi network, and password123 with your password, making sure to keep the quotes, as above.

If you copy paste the above into a notepad document, make sure to make the correct line breaks.

Now save that file with the filename wpa_supplicant.conf on the root/start of the SD drive

Make sure that your file doesn’t have any extensions on the end of the filename like .txt, it should just be called wpa_supplicant.conf

Hint: Save the file using Save As..  and change filetype drop-down from .txt to All filetypes

Source: https://learn.pimoroni.com/tutorial/sandyj/motioneye-os-on-your-octocam

Attach Camera

Now lets dig out our RPi camera and the special RPi zero camera cable.

Loosen the tabs on both devices and insert the ribbon cable as shown.

Do not put the devices on top of the antistatic bag. It works the opposite of putting the devices inside it, so don’t do that! I know many people are doing this all over the internet, but you really, really do not want to do that.

First Boot

Now insert SD card into your RPi Zero Wireless and power it up.. sit down and wait 5 minutes.

Use Angry IP Scanner to find the device

Unless you have configured IP manually, or have a screen connected, you need to figure out the IP of your device.

There are several ways to go about doing this, but the easiest way is to download and run the Angry IP Scanner. Some antimalware programs pops up warnings on this program, but it is due to its functionality to scan ports and such, and not because it contains malicios code.

So, start it up and just hit Start. It’ll scan a while. Then sort the results by clicking on the column named Ping.

Mine showed up like this, where the standard client devices like computers and printers are going to have a blue icon on the left hand side, so it’s easy to spot. Same with the Web detect on the right hand side, which isn’t normal for standard devices.

So right-click it -> Open -> Web Browser

Webinterface – Setup

Depending on the browser size you are going to see a small image in the corner, or a fullscreen view.

Click the icon looking like a person in the upper left corner, and switch Username to admin and leave Password blank.

Enable Advanced Settings

Turn on Advanced Settings in the General Settings section, and click Apply

Enable Streaming

Make sure Video Device and Video Streaming is turned on.

You might want to turn on Motion Detection as well instead of just having it on always.

Resolution and frame rate

As our last basic setup we are turning up our resolution a bit. Go into Video Device and select the Video Resoluton and Frame Rate fitting your requirments.

Streaming URL

Easiest way to find the URL (address) we need to use in our Duet Web Interface is to go to Video Steraming and cick on the Streaming URL link

This opens a small popup with an address, which you copy and then paste into the Optional URL to an external Webcam in the Duet Web Interface.

Note: Your url is not going to be exactly like mine

Duet Webcam Integration

In order to integrate the videostream into the Duet Web Interface, we need the direct url for our videostream.

My url, as copied above, is http://meye-f4a4e5e9:8081

I insert this into the Optional URL to an external Webcam box in Settings -> User Interface – Webcam Integration

Check it by going to Print Status tab

How it looks in Duet Web Interface when camera is enabled

Posted on

Raspberry Pi Zero Wireless – Video for Duet

For this project I’m going to use one of the tiny Raspberry Pi Zero Wireless controllers and a Pi NoIR Camera V2. Using the NoIR as I wanted to try it out, and the NoIR makes it possible to record in the dark using IR lightning.

You also need one of the camera cables for the Zeros, as they are tapered in one end compared to the normal ones. They come in 15cm and 30cm lengths.

Index

Download Raspian or Noobs

Grab newest Raspbian version. I’m using the full version. Maybe Lite is enough for our purpose?
If you downloaded Raspbian and imaged it using Etcher rather than NOOBS, then you will boot directly to the desktop environment of Raspbian and won't need to wait.
I ended up having to download using Torrent which took 8 hours less than the regular download!

You can get the Noobs version (instead of the above Raspbian) – and look at this nice guide:
NOOBS is an easy operating system installer which contains Raspbian. It also provides a selection of alternative operating systems which are then downloaded from the internet and installed.

Prepare SD

To make the SD last longer, I strongly recommend getting a proper SD formatting tool, like SD Formatter, and do a format.

Make sure to pick the right drive, give it a name and hit Format.

Unpack and write image to SD

Write image to SD using Etcher – it can open .zip files without extracting it.

Or you can get Win 32 Disk Imager for more options.

Note: For some reason it didn’t want to work with my normal SD card-reader, so had to dig up a different one!

Be patient.. it takes a while.
I had some issues, as mentioned above, so ended up unpacking it manually, which is why the source filename is different in the two images here.

When it goes from writing data to the SD to Validating, Windows might throw some errors at you, but that’s normal, so don’t worry.

Remote Access using VNC

I used usb keyboard and mouse, which I had to switch back and forth, since I couldn’t find my USB-hub, to connect the RPI to my WiFi and to activate VNC.

Windows key to open the menu. Go figure 🙂

Here’s a guide.

Next up I need to get myself a VNC viewer for my PC to connect to the RPI from my PC.

  • Do not use it on your RPi to connect to the RPi!
  • Just press Got It, on the first welcome screen. It looks like options with the icons above, but they aren’t.

Enter the IP and then use the default username pi and password raspberry  to connect.

You want to change these at some point.

I now have access from my PC and am ready for our Camera.

Attach Camera

Now lets dig out our RPi camera and the special RPi zero camera cable.

Loosen the tabs on both devices and insert the ribbon cable as shown.

Do not put the devices on top of the antistatic bag. It works the opposite of putting the devices inside it, so don’t do that! I know many people are doing this all over the internet, but you really, really do not want to do that.

We do not need to activate the camera using commands, since we enabled the Camera further up top alongside VNC.

Update

Now we need to update before continuing setting up the Camera.

Enter the Console/Sli and type:

Sudo apt-get update
and then
Sudo apt-get dist-upgrade

If you are used to use sudo apt-get upgrade instead of the dist- you might want to read about the differences.

Test Camera

Lets see if it works, by issuing this command:
raspistill -v -o test.jpg
You can find the test.jpg file using the File Explorer, where the photo should be placed at your home directory.

There is a larger guide here.

Install Camera software

I had planned to install the software Motion, as I had read a nice guide, but it turned out it just didn’t want to work with my Noir V2 camera, so I decided to look elsewhere. I also learned the project is no longer in the hands of the original author and has not been updated for a while.

RPI-Cam-Web-Interface

I decided on using RPI-Cam-Web-Interface instead although it is a webinterface, which isn’t strictly what I want for my Duet WiFi purposes. But I hoped it would make the raw videostream available, which it turned out to do.

The interface options also makes it easier to setup the different options as I’m not much of a linux console kind of guy.

Installing it:

There is a nice wiki guide, which I’m pretty much just following.

Since we allready updated our RPI, we can skip to step 4 to install the actual software via the Console:
1 command pr line. Wait for each to finish.

git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh

Short explanation: First it downloads the program, change to the folder, makes all .sh files executable and then installs  it.

A window is going to pop-up after a while. I just used default settings under installations.

Accessing RPI Interface

Open you browser and type in the IP of your RPI. If using default settings, you will be presented with a directory listing, where you can click on html link before you see something like this:

All done as we don’t need to do anything here really, but you might want to go into Camera Settings to setup resolution

Duet Webcam Integration

In order to integrate the videostream into the Duet Web Interface, we need the direct url for our videostream.

Lets say the IP is 192.168.1.26 like mine, the address you need to insert into the Duet Web Integration box is:
http://192.168.1.26/html/cam_pic_new.php
You put this into the Optional URL to an external Webcam box in Settings -> User InterfaceWebcam Integration

Note: I’m not entirely sure what the checkboxes are meant to do. I can find no differences if I check the Embed Webcam Stream or not?

Posted on

Ultimaker 2 – Use 5v controlled fan to also get a 24v controlled fan.

As people might know, the Ultimaker 2/3 series machines are very sleek, minimalistic looking, with all wires, motors and electronics neatly hidden away.

This is nice from a visual perspective, but it does have some drawbacks in the form of overheating disaster waiting to happen.

This posts covers 2 seperate scenarioes which you can mix as you like:

  • Use the 5v controlled power for the small 25mm fan for the hotend heatsink to also controll a 24v radial fan to cool the electronics.
  • Use the 5v controlled power, as above, to controll a 24v fan for an E3D hotend and the same 24v radial fan as mentioned above.

Index

Goal

The Ulticontroller is getting rather hot when running, and it is enclosed in a tiny enclosure with no active ventilation. I wanted to rectify this.

Printable Coolboard Duct

My goal was to attach a controllable radial fan to blow into the electronics compartment. I found this nice Ultimaker 2 Coolboard Duct for Control Board Cooling on Youmagine, which you can download for free and print yourself. Seems they have started using my photos, but that’s ok 🙂

There are air ventilation holes in the end of the electronics compartment, which is perfect for our purpose.

Controllable fan

I did not want the fan to run at full speed whenever my printer was turned on though, due to the noise, so something had to be done to make it turn on and off automatically.

I thought about modifying the firmware, but I didn’t know the pin numbers on the controllerboard, or even if they were controllable. It would also be rather restrictive for many people, as they run original firmware.

This type of fan is called a radial fan, and is designed to push air through tight spaces.

How it works

I’m going to achieve my goals using a Mosfet control board (example, example), so we are not going to solder seperat small components together, but just wire things together combined with a few wire-connectors (Can do without if you absolutely have to).

Mosfets are the components turning your heaters and fans on and off, so we basically add an extra one to our machine.

I am using this model as I’ve had best general results with this.

We would normally control these functions using a seperat PIN and some code in firmware. As this option is not available to us, we are going to piggyback on the function allready setup for our 5v 25mm small fan blowing on the Hotend Heatsink. This one turns on and off at 40c, which suits our purpose superbly.

Bill Of Material

  • Radial Fan 50mm x 15mm
  • 1x DC control MOS FET switch control panel
  • 2x male and 1x female XH2.54 connector. Buy a box.
  • 2x female dupont connector + pins. You can use a male XH2.54 connector plug if you have to.
  • 8x male dupont pins. Can do without, but highly recommended.
  • Some heatshrink
  • Kapton tape or similar
  • 2x 35-40mm m3 screws if you use the printed Duct.

Prepare the wires

As you can see here, we are going to create 4x pieces of wires:

  1. Wire from Controller 5v connector to Mosfet control
    1. 5-6cm with male XH2.54 to 2x male dupont pins
  2. Wire from mosfet control to original 25mm fan Connector
    1. 10-11cm with female XH2.54 to 2x male dupont pins
  3. Wire from mosfet DC out to Radial fan connector
    1. 6-7cm with male XH2.54 to 2x male dupont pins
  4. Wire from Controller 24v power pins to Mosfet DC in
    1. 16-17cm with 2x female dupont connectors to 2x male dupont pins

Optional: Instead of #4 you can use the unused Controller FAN connector at the end of the controller.
8-10cm wire with male XH2.54 connector to 2x male dupont pins

Optional: Instead of the first 2 seperate wires you can create a combined Y wire, meaning 1 male XH2.54 connector to 1) 2x male dupont pins and 2) 1x male XH2.54 connector

Wire up

  1. Number 1 is the 5v connector on the Controller. This wire goes to the control in port on the Mosfet control board.
  2. Number 2 is the 24v output pin on the controller. Goes to DC in on the Mosfet Control board.

Here you can see the short wire from Mosfet Control board Control in to the original connector up to the 25mm fan. This just pass on the 5v.

I have an E3D on one of mine, and use a 24v fan for its’ heatsink. Just connect this short wire to the Mosfet Control board DC OUT insteaad, same as for the Radial fan.

I’ve used the printed parts from the E3D Ultimaker 2, 2+ Upgrade Conversion Kit for this E3D carriage.

Here you can see the wire from Mosfet Control board DC OUT to the Radial fan. It also shows the place we are going to stash the control board, but we need to prepare it a bit first.

Before putting the Mosfet Controller board into it’s hiding place, we must make sure there is no shorts going to happen. As you can see, I’ve simply wrapped Kapton tape around mine.

It’s not going to generate a lot of heat, so don’t worry about that.

Before wrapping Kapton around it, you should make sure the pins on the backside of the board doesn’t poke through. Use a small wirecutter to shorten them as much as you can.

Reinstall Controller shield

I’ve done this a lot, and thought I’d make a seperate section for it to make it easier to get it right the first time.

  1. First slide it gently down like photo 1. Make sure all cables are inside.
  2. When you have caught all wires inside it, you should tilt it like on photo 2 and make sure the “pin” next to the motor is correctly inserted into the hole in the frame.
  3. Now tilt the shield back and fix it in place.
Posted on

BLTouch on Duet Wifi & DuetRepRapFirmware

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 🙂

I would especially appreciate any additional informations regarding the end of my blog-post as I’m still a novice in BLTouch and would like some inputs from experienced users.

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! 🙂

This means we can’t just only use the Probe connector on the Duet WiFi on its own, but only use 2 of these pins in the Probe Connector, GND and IN, to register the actual signal 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.

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 more correctly as “PWM / Servos“.. all a bit confusing to be sure.

Before diving in, I thought i needed to use 3 pins on the Probe Connector and 2 pins on the Z-min connector!

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.

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 BLTouch (as I do), you need to either solder or crimp in a 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.

Anyone have inputs here?

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 connecter, 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 I1

s10 is microseconds to engage and I1 is inverting of the probe. You can read more and also see a table of most of the expansion pins.

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 I1

Once again, the P-number corresponds to our H-number and S and I defines the same settings as well.

I do not know why Retract S should be higher than deploy. Anyone know?

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.

Please review this definition: The Z value defines the distance between end of probe the end of your nozzle?

G31 P50 X30 Y10 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:

Posted on

Duex5 – Use build in 12v switching regulator on 24v system

Index

Use Duex5 to get 12v

As far as I know the Duex5 (also in Duex2) is the only Controller or Expansions -board for 3D Printers with build-in 12v switching regulator, which means you can easily get 12v even if you use a higher voltage to power your machine (VIN Power – opens Duet3d Glossary) without having to restort to various step-down modules lying around in or outside your printer creating potential for shorts and other errors.

Jumper Settings

In order to activate this 12v switching we need to:

  1. Put a jumper on the pins marked with nr. 1
  2. Check the FAN jumper nr. 2 is placed on the 12v position
  3. I’m going to use the FAN3 Connector marked with nr. 3 for my LEDs

In case you have difficulty seeing the colors as me, being colorblind, the + wire is to the right side of the 2-pin connector, and – wire on the left side.

Image is part of the original conenctions diagram on Duet3D wiki.

You can also see the full diagram here:

Configure LED in firmware

We really just need to open the Config.g file and insert a small line under the other fans in our FAN section, like this:

M106 P3 S1; Set fan 3 value for our LED to on.

It really just put FAN connector 3 on full power.

Further customization options

We can put the power to the LEDs on half (dimming it) by setting S to 0.5 instead of 1, or use the 0-255 range if that’s more to your liking.

It also means you can control it using Gcodes to do different things like turning LED on when a print starts and turn it off when a print job ends or what ever you like.

All done

Here you can see the new jumper on nr 1, set jumper on nr 2 and our LED connector on nr. 3

Posted on

BeTrue3D Printer build part 9 – LEDs – 12v from 24v Duex5

Finishing our LED installation

We previously installed front LEDs, including an on/off rocker.

Recap:

Back then, I only had 12v LED strips and as I use 24v on this system, I needed to get 12v from somewhere.

In order to test it worked, I used a small fixed 24v to 12v step-down buck-converter and used some double-sided tape to stick it in place below the Duex5 as shown here:

Index

Use Duex5 to get 12v

As far as I know the Duex5 (also in Duex2) is the only Controller or Expansions -board for 3D Printers with build-in 12v switching regulator, which means you can easily get 12v even if you use a higher voltage to power your machine (VIN Power – opens Duet3d Glossary)

In order to activate this 12v switching we need to:

  1. Put a jumper on the pins marked with nr. 1
  2. Check the FAN jumper nr. 2 is placed on the 12v position
  3. I’m going to use the FAN3 Connector marked with nr. 3 for my LEDs

In case you have difficulty seeing the colors, the + wire is to the right side of the 2-pin connector, and – wire on the left side.

Image is part of the original conenctions diagram on Duet3D wiki.

You can also see the full diagram here:

Configure LED in firmware

We really just need to open the Config.g file and insert a small line under the other fans in our FAN section, like this:

M106 P3 S1; Set fan 3 value for our LED to on.

It really just put FAN connector 3 on full power. We can put it on half power by setting S to 0.5 instead of 1, or use the 0-255 range if that’s more to your liking.

It also means you can control it using Gcodes to do different things like turning LED on when a print starts and turn it off when a print job ends or what ever you like.

All done

Here you can see the new jumper on nr 1, set jumper on nr 2 and our LED connector on nr. 3

Posted on

Lets build an Ultimaker 2+ Extended clone – Part 5 – Lets buy stuff 3 – DIY – Motors, LEDs and more

In our previous blog-post series, we focused on buying stuff premade.

This post will focus on getting the proper wires, connectors, leds and motors to put our own parts together, and hopefully save some money along the way 🙂

The big saving is going to show if you like to tinker with stuff, as you’ll have bought yourself a nice cache of spare-parts for this and other projects.

You need a soldering iron for this and some basic tools. It might be usefull to buy an actual crimping tool, but it’s not mandatory.

 Index

LEDs for front lightning

In the Ultimaker 2 printers we have LED strips on the inside of the front sides and top.

It’s basically just 3 strips of 24v bright white leds with wires attached between them, and a wire with a 2-pin Molex kk connector going down to the controller.

 

So, first we buy a roll of 24v bright white leds. They cost $5-10 depending on length

Links

Roll for wires

Next we need to get some wires. I rather like to buy 1m rolls of multicolored wires from RobotDigg. 1M doesn’t sound like much, but there are 30-40 wires of 1m each in a roll, and it’s very usefull to get thme like this.

Links

Price is from $1.8+ depending on how much you buy.

  • You need 1 roll of the black-red bundle.
  • If you like to make other projects, I recommend buying one or both of the 3-color and 5-color rolls as well.
  • We’ll look at wires for motors elsewhere on Aliexpress.

Connector(s)

We are going to buy a box of connectors. These will come in very handy for any number of projects.

Price at $3.40

Heatshrink

We need some heatshrink to put onto our parts, where we solder things together.

I can recommend buying both a set of black and one of red pieces, but 1 color is going to work fine.

If you want it just right, you need a white set as well, for the front LEDs, allthough you can’t see these when done.

Price $2.4-$5ish

Make it

I used 3x 30cm LED strips, but these lengths are determined by the LED roll you buy, as they can be split up in different lengths.

Measure strips and wires.

Solder and put on heatshrink

Remember to slide on heatshrink before you solder both ends of the short wires – speaking from experience, hehe.

Testing and installation

Test the wires using a 24v source.

You also MUST clean up the inner face of the front-panel using Acetone or the LED strips will come loose.

Price compare

If you bought pre-made it would cost you $10

If you bought the parts and made yourself, it would cost:

Leds 5m $5.84
Connectors 50 sets $2.4
Wires 40m $1.8
Heatshrink – much 2.4
DIY + spares $12.44

Motors

We need 3 motors for XY and Extruder + a motor with build in leadscrew for Z.

We need 67cm of wires on your motors and appropriate connectors.

Links and price

The leadscrew on Z-motor is around 36cm long. Do not buy a motor and loose leadscrew. You are loosing a lot of Z-height and it’s not as good. Especially if you use a flexible coupler.

I have only listed Robotdigg as they have cheaper motors and we are going to buy wires and stuff from them as well.

But remember to factor in the shipping costs when you decide on where to buy.

  • Buy 350mm linear stepper from Robotdigg at $34
  • XY and Extruder 42HS40-1704 at $6.40 each = $19.2
  • XYE Motors comes with 1m wires and correct plugs (not entirely sure of Z connector, but you are going to get one when buying endstops below)

Adjust motors axels

One draw-back is that you need to shorten up the axels of the motors or they are going to hit the rear and side respectively.

You need to twist the cable pairs. First  twist red/blue and black/green, and then twist the resulting 2 bundles.

Price compare

Premade set $99
DIY set $53,2

Endstops

We are going to need 3 endstops, also known as a Limit Switch for our X-min, Y-max and Z max.

The Z-max endstop has a short arm and the other two needs to have long arms.

They are all configured as NO (Normally Open) in original firmware. This means the wires is connected as shown on the photo.

Wire colors, blue, red and black are in place in order to know what’s what.

Remember the the lengths of the wires for our Extended is not the same as in the pdf files.

There is a single 2-pin HX2.54 connector on each endstop wire.

 

Links and Price

Expect to pay around $0.2-0.3 for each limit switch. Search around for prices if you like. You might want to find a set of 10 if you want to have some spares, or some for other projects.

Price compare

  • Premade $7-14 for a set
  • DIY set costs $3.63 and you’ll have a lot of spares.

Wireharness from controller to carriage

The Wireharness consists of the wires from carriage (carriage is the assembly for hotend and fans) to controller. Since the wires from Heater Cartridge and PT100 temperature sensor runs straight down to the controller on their own, the Wireharness is really only for the small Heatsink fan and the 2x cooler fans.

If you want the right colors you should buy 1 more roll of wires from Robotdigg. I’d replace the blue one with a white wire, as the blue wire isn’t included in any of the wire bundles.

Links and Price

  • Premade $10
  • 1 roll of 5 color wires (50m) at $1.8
  • Connectors from LEDs and Endstops.
  • Heatshrink from LEDs

The wireharness you buy has 3 wire-sets in it, buy one of these are not used. I do not know what was intended here. The red/brown pair is unused.

Phto above shows the one I made for this project.

The Green/Yellow is for the 12v fans. When put in series they each get 12v from our 24v system.

Total Price compare

I’ve picked the price in the middle of an eventual price-range.

Remember several of the pieces from LEDs are used for the other Items.

Item Premade DIY
LEDs  $10  $12,44
Motors  $95  $53,2
Endstops  $10,5  $3,63
Wireharness  $10  $1,8
Total $125,5  71,07

You save $53,93 on just this project by doing a bit of DIY!

Savings on future projects are going to be bigger as you now have a cache of usefull items 🙂

Posted on

Lets build an Ultimaker 2+ Extended clone – Part 4 – Lets buy stuff 2 – Motors, LEDs and more…

This part is about buying all the cables, leds and connector stuff premade to use in our Ultimaker 2+ Extended clone build.

Intro

It’s been under way a bit longer than I would have liked, but as always, it is not as easy to decide what to include or not, and how to put it together. At first I had the Buy all and DIY part put together, but it seriously hampered ease of use and readability (confusing), so spent some extra time splitting the two things up. Hope you like it!

Index

LEDs for front lightning

In the Ultimaker 2 printers we have LED strips on the inside of the front sides and top.

It’s basically just 3 strips of 24v bright white leds with wires attached between them, and a wire with a 2-pin Molex kk connector going down to the controller.

Links and price

Expect to pay around $10

Motors or long wires with connectors

You can either buy a package of motors from Aliexpress or maybe you have some motors and just need the motor with 35-40cm lead-screw on it.

You need 67cm of wires on your motors.

This can be solved in 2 ways depending on your motors:

  1. Buy the motors with appropriate length of wires and connectors (note: link is to non-extended pdf. Wires must be 67cm and 57cm respectively)
  2. Buy wires to use on your existing/other motors.

Links and price

The leadscrew on Z-motor is around 36cm long.

Do not buy a motor and loose leadscrew. You are loosing a lot of Z-height and it’s not as good. Especially if you use a flexible coupler.

Expect to pay $90-100 if you buy the motors as a bundle on Aliexpress.

I have listed Robotdigg as they have cheaper motors and lots of other nice items. But remember to factor in the shipping costs!

If you buy or use other motors

If you allready have or buy other motors for XY you must check these requirments:

  • Holding torque 4kg-cm or more
  • Motor length 40mm or it can’t fit behind the motor covers
  • Inductance MAX 4mH. Under 3mH is better. Higher = slower reaction.
  • Max 2amp. If you get higher amp you can’t take advantage of it’s specifications.

The above motor would be fine for Extruder as well.

The extruder motor can be 48mm deep/long if you have one of these. The additional power should not be needed as we use Titan Extruder

I’m using 17HS4401N motors for all my XY and extruders on all printers as I bought a bunch of them a few years ago. Was lucky and got some nice motors.

Endstops

We are going to need 3 endstops, also known as a Limit Switch for our X-min, Y-max and Z max.

The Z-max endstop has a short arm and the other two needs to have long arms.

They are all configured as NO (Normally Open) in original firmware.

Wire colors, blue, red and black are in place in order to know what’s what. Remember the the lengths of the wires for our Extended is not the same as in the pdf files. XY wires should be 65cm and Z around 15cm

There is a single 2-pin HX2.54 connector on each endstop wire.

Links and Price

Expect to pay $7-14 for a set

Wireharness from controller to carriage

The Wireharness consists of the wires from carriage (carriage is the assembly for hotend and fans) to controller.

Since the wires from Heater Cartridge and PT100 temperature sensor runs straight down to the controller on their own, the Wireharness is really only for the small Heatsink fan and the 2x cooler fans.

The wireharness you buy has 3 wire-sets in it, buy one of these are not used. I do not know what was intended here. The red/brown pair is unused.

Photo above shows the one I made for this project, which does not have the last unused pair in it

The Green/Yellow is for the 12v fans. When put in series they each get 12v from our 24v system.

Links and Price

Expect to pay $10

Posted on

Spot bent 8mm rod in Ultimaker 2

Spotted irregular movement of my back slider, in my newly build Ultimaker 2+ Extended and thought I’d share how to check your rods.

How to check if your rods are straight.

They look straight and feel straight, but when mounted it is easy to see they if they are not.

Simply place the slider in the middle of the rod you want to check. Move the carriage back and forth.
The slider should be still. No movement at all.
As you can see, this slider moves up and down as I move the carriage back and forth, so it needs to be discarded.

If you can’t see how the slider moves up and down, then try focusing on the belts connecting to the slider.

Posted on

Motion Configuration on Ramps 1.4 With Marlin Firmware

Motion Configuration on Ramps 1.4 With Marlin Firmware @section Machine

This is going to be a, hopefully, complete tutorial on configuring Motion Control on 3D printers build on Ramps 1.4 using Marlin firmware. Not having Delta, or CoreXY printers included.

I am going to use Pronterface/Printrun host program to connect to my printer and issue Terminal commands (G-codes). That sounded very hairy, but it is just a simple program with a graphical interface.

Even though I’m going to use Ramps 1.4 and Marlin firmware 1.0.2, this tutorial will most likely be usefull for most setups. We are going to use the newest Arduino IDE to edit the Marlin firmware.

What we cover in this Instructables:

  1. Stepper Direction
    1. Homing Direction
  2. Software Endstops
  3. Some final tweaks
    1. Quick Home
    2. Babystepping
    3. All set

Small change since last:

My last instructable was made using Release Candidate 2 of the Marlin firwmware. Due to some incompatibilities I had to change to the latest stable firwmare, so the layout is a bit changed from the images in the previous Instructables. It means I made brand new images for this one 🙂

Requirments

  1. It is required/necessary that you have setup your endstops before beginning on this Instructable.
  2. You need to have defined you steps for your steppers. You can find calculators here:
    1. http://prusaprinters.org/calculator/
    2. http://reprap.org/wiki/Triffid_Hunter’s_Calibration_Guide
    3. http://lmgtfy.com/?q=reprap+calculate+steps+per+mm

Step 1: Stepper Directions @section Machine

move_homeing_direction.jpg

Place your Carriage (hotend assembly) in the middle of your X and Y axes, and connect to your printer using Pronterface/Printrun. Also power it up.

Check Endstop Status

Start by sending M119 to the printer to check endstop status. They should all show Open before continuing.

Pronterface – Check Stepper Directions

Now use the directional arrows in Pronterface to gently move the axes, using 1mm and 10mm. You might only be able to move an axis using the + for that axes.

The main thing here is to write down wheter an axis is moving the right direction or not.

Pro-tip: You might want to keep you finger near the on/off switch on your printer.

Firmware – Stepper Direction

Find INVERT_X_DIR in your Marlin firmware in the Configuration.h tab. If you use a Release Candidate of the firmware, it will be located in the @section Machine.

#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

For any axis which moves the wrong way, you change the true to false or vice versa.

Firmware – Homing direction

Next we setup homing direction.

For most printers we want to home it to our front left corner, which we define as our X and Y minimum endstops. We also want our hotend to be close to our bed, which is Z min as well.

These XYZ minimum endstops are also referred to as our Origin and will normally be 0 on their respective axes.

Find X_HOME_DIR in Configuration.h file, and set HOME_DIR for X, Y and Z to -1. – as shown in below code-block.

This tells our axes to home to the minimum endstops.

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

Some printers use different topologies, so you might need to change this. Ultimaker 2 homes to X min, Y max and Z max.

Verify our changes

Disconnect Pronterface, Upload firwmare and check if the axes move in the right directions. Make changes if neccessary.

Homing

When everything moves as it should , you test the homing function. You can test using the icons with a “house (home)” on it for each axis, or use the G28 command followed by the axis you want to home.

If you just type G28; you home all axes.

You can also type G28 X or G28 XY or some other combination.

Step 2: Software Endstops – @section Machine

max-pos.jpgBefore starting on this section we need to make a change in the Configuration_adv.h sketch.

Locate and make sure ENDSTOPS_ONLY_FOR_HOMING is commented out, like so:

// #define ENDSTOPS_ONLY_FOR_HOMING

We need to complete this step in order to get readings from any max-endstops we might have in place.

If you do not have any max-endstops, you can ignore thisstep.

G28 – Start by homing

  1. Home all axes using G28 (1)
  2. Use M114 (2) to verify that your printer is actually considering itself at 0 n all axes.
  3. Protip: The M84 (3) I send (shown in image) is to turn off motors, as they buzz while I type.

Software endstop – Travel limits after homing

In Configuration.h find max and min_software_endstops, and make sure they are set to true

#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.

Below is the default settings for software endstops.

For our purpose it is usefull if you change them to something more than your actuall axes lengths in order to move our axes as far as we need to find the max area for the printer.

Pro-tip: If you have your homing endstop at a MAX_POS, you will need to use negative values to indicate how far back it can go in order to reach the MIN_POS

// Travel limits after homing
#define X_MAX_POS 205
#define X_MIN_POS 0
#define Y_MAX_POS 205
#define Y_MIN_POS 0
#define Z_MAX_POS 200
#define Z_MIN_POS 0

Axes MAX positions

Below points are shown in the image numbered blue 1-4

  1. If you havn’t done so allready, you start by homing all axes, using G28 (1)
  2. Issue M114 command to make sure all axes are at 0.
  3. Now move all AXES as far towards MAX as you can. Either untill you hit a MAX endstop, if you have any such, or just as far as you can move it and stay within you bed – you do not have to Count!
    1. If you have Max endstops you can read the position in the terminal window.
  4. Issue M114 to get a read out on posistions. You can see it rounded up.

Update your firmware

Now go update your firmware according to your system. Notice how I substracted some 11mm due to a clip on my heated bed. You might have similar considerations.

Pro-tip: Note how I place // after the mm input and then write notes. This is a good way to keep tabs on what you did for what reason.

// Travel limits after homing
#define X_MAX_POS 227 // 227.81 MAX
#define X_MIN_POS 0
#define Y_MAX_POS 180 // 190.96 MAX - 11 for clip
#define Y_MIN_POS 0
#define Z_MAX_POS 190
#define Z_MIN_POS 0

Step 3: Final Tweaks and Famous Last Words

babystepping.jpg

Some final tweaks

We might want to undo the setting we made to ENDSTOPS_ONLY_FOR_HOMING. Meaning we enable it again, in the Configuration_adv.h file.

I’m enabling it again as I want to be able to use Z-offset to tweak nozzle distance from the bed, which would be impossible with this setting enabled – I’ll see if I can’t make a simpler guide than the one I linked to. If you have no such plans, then keep it disabled as it is an extra safety measure. I’ve used it up untill now and liked it.
Notice I made a comment above the line. It’s to make it easier for me to find it.

// MDN Endstops only for homing
#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing

Quick Home

I do not like waiting for the X and Y axes hóming seperately. Luckily we can make them home at the same time by ennabling (uncommenting) QUICK_HOME in the Configuration_adv.h

// MDN Quick home
#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.

Babystepping

You can also enable BABYSTEPPING, which I do below here – it Means you can use your LCD knob to move the axes in tiny increments to tweak the printer after it has started printing. Very usefull to tweak Z-axis if it is a bit off. There is also a setting to define feedrates when using an ULTIPANEL (lcd).

Pro-tip: If you aren’t aware of it, you can bring up the search box by using CTRL+F og from Edit -> Find…

Pay attention to the warning about this functions ignores Z-min, so you can “crash” the bed against the nozzle.

In reality you have to turn the knob a lot to make the bed move.. like an entire turn to even notice the bed moving, so you have to have very quick fingers to do any harm. I know I’ve played a lot with it and took a while to even figure out that it wasindeed moving.

The Babystepping is only gong to show up in the display after you have startet printing.

// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
// it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops!
// MDN Babystepping
#define BABYSTEPPING

All set

Now your all set with all the basic movement settings configured 🙂
I’ll recommend you read through the Configuration.h and Configuration_adv.h files and see if you find anything interesting. Like X_HOME_RETRACT_MM which tells the printer how much to retract after hittingendstop, then slowlinggoing back.

Have fun and maybe even follow me here on Instructables.com 🙂