Page 1 of 1

Better cooling and remote power up

Posted: Fri Jan 08, 2016 9:32 pm
by kazolar
I found that even with the new stepper drivers, the printer can't go faster than 60 mm/s without the drivers overheating. So I created a mounting for an 80mm fan with a built in grate. The fan is wired in series with the current 12v fan blowing across the rumba. It positions the fan right over the rumba, keeps it really nice and cool -- so I'm printing with no issues at 90mm/sec. Quality is phenomenal, and fast.
My other mod is a bit more involved, but it really takes advantage of the features of octoprint.
1. I added triggers to octoprint to email me when a print is started and when it ends. It sends me a picture at start and end, and tells me how long it took.
2. I added actions to octoprint which show up as a drop down in the upper right hand corner. Turn Printer On, Turn Printer Off, and Clear Turn Off Flag. The turn off flag is set when a print completes, and a script is kicked off -- it waits for 20 minutes and in 20 minutes it will turn the printer off unless a new print is started or the clear turn off flag is triggered.
3. So to allow the printer to get turned off I switched the wiring by adding a 5V power supply (I took one apart to make it compact) and ran it to power the beaglebone and the usb hub. Then I added a sainsmart relay which powers the main PSU. Then a script sends appropriate commands to turn the printer on or off.
This way the beaglebone is always on -- and I can remote power the printer from my office, start heating the bed, extruder, upload the file I want to print. Then go to basement to the maker space and use a table to start the print.
I use the same setup with my other printer -- only I added a raspberry pi 2 to that for octoprint and set that up from scratch.

If anyone is interested in these mods, reply here and I'll post my scripts and details

Re: Better cooling and remote power up

Posted: Mon Jan 11, 2016 11:56 pm
by realloser
This sounds very cool.. Do you also have some pictures of the cooling and the setup with the 5v Power Supply. I also was wondering whether there is a way to turn on and of the printer from Octoprint. Now I got the answer :).

The power on of would for sure be a nice plugin for Octoprint :).

Re: Better cooling and remote power up

Posted: Thu Jan 14, 2016 1:23 pm
by kazolar
Here is the picture of the fan. I relocated the heated bed cable -- it should really be on the left side anyway since that's where it comes off the bed.

The Remote power is a bit more involved. I ran into a really odd thing. Why is the Series1 firmware baud rate set to 230400? There is no logical reason to have that high. The rumba -- which is an Arduino Mega with some extra stuff on it doesn't really talk that fast over serial, and that serial is not a reliable where you need to connect/disconnect. I had issues re-connecting to the rumba when I powered the rumba down and left the BBB on. I reflashed the firmware with a more common 115200 baud rate, and it's been working like a champ since. I'll post pictures of the inside with the 5V power supply.

It goes like this. I bought a few connectors like those used in the Series1 to make my mod reversible. I run the hot line from the power input into the 5V power supply. Share neutral with the PSU, disconnect the hot from the switch at front from the hot on the PSU. Split the hot off to the relay common. Then take relay NO into the hot on the PSU. That now means the relay is now the switch for the PSU. Then it's connecting the lines from the BBB to the relay, which is very simple. BBB has a ton of GPIO pins, so I took the 4 on the right set of pins. I take the 5V and ground from the left.

Then you need to make octoprint user be able to do sudo, as only root can write to the GPIO pins ( at least I haven't found a workaround for that). Then I create a few scripts which do different things -- i.e bring the pin low to turn the PSU on, and bring the pin high to turn it off. The sainsmart relay board expects the input to be pulled down for on.

Re: Better cooling and remote power up

Posted: Tue Jan 19, 2016 11:26 am
by Matthew
Hi Kazolar,

Nice work here! I have a question about your 80mm fans. Is that one blowing into the e-tray case or out? Do you still ahve the stock 80mm fan blowing into the e-tray from below on the front?

I am also curious about some of your BBB scripting.


Re: Better cooling and remote power up

Posted: Tue Jan 19, 2016 11:57 am
by kazolar
So I have the fan blowing out. I'm not entirely sure it's the right thing, I will probably rotate it when I open it to take some pics as the air coming out is very cool, and only gets warm at about 8-9 hours into a print. I still have the stock fan, so there are 2 fans. I made a connector which accepts the existing fan and connects into the 12v connection on the RUMBA so fans are in parallel. Still pretty quiet as 80 mm fans are not noisy. Plus it's in my basement, and my other printer is much noisier, it's power supply alone is noisier than all of eries1 fans put together, and it's bed moves on the y axis, so it's loud.

here is my script which turns the printer on.
it's called

if [ ! -d /sys/class/gpio/gpio67 ]; then
echo 67 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio67/direction
echo 0 > /sys/class/gpio/gpio67/value

here is the script which turns the printer off

it's called

if [ ! -d /sys/class/gpio/gpio67 ]; then
echo 67 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio67/direction
echo 1 > /sys/class/gpio/gpio67/value
echo 67 > /sys/class/gpio/unexport

as you can see I have the relay connected on gpio67.

All other things are just basic wrappers added to octoprint -- edit config file

in octoprint after appearance section add this:

enabled: true
- command: /usr/bin/ {file}
event: PrintStarted
type: system
- command: /usr/bin/ {file} {time}
event: PrintDone
type: system

for some reason time is not working -- I have to check that -- its supposed to be number of seconds it took the print to do.

then after the server section add the following

- action: printer on
command: /usr/bin/
confirm: You are about to turn on the printer.
name: Turn on printer
- action: printer off
command: /usr/bin/
confirm: You are about to turn off the printer.
name: Turn off the printer
- action: clear flag
command: /usr/bin/
confirm: Do you want to clear shutdown flag.
name: Clear Turnoff flag

now can't do the above directly as the above must be done in sudo, so the above as I said put in and, so simply calls sudo -- this is done since octoprint doesn't support sudo as part of the command.

then in

rm -f /home/octoprint/.octoprint/turnoff > /dev/null
curl -o /tmp/printStarted.jpg "http://localhost:8080/?action=snapshot" 2> /dev/null && mpack -s "Series 1 Print of $1 started" /tmp/printStarted.jpg
rm -f /tmp/printStarted.jpg > /dev/null


i=`echo $2 | awk '{printf("%d\n",$1 + 0.5)}'`
((sec=i%60, i/=60, min=i%60, hrs=i/60))
timestamp=$(printf "%d:%02d:%02d" $hrs $min $sec)
curl -o /tmp/printDone.jpg "http://localhost:8080/?action=snapshot" 2> /dev/null && mpack -s "Series 1 Print of $1 finished in $timestamp" /tmp/printDone.jpg
rm -f /tmp/printDone.jpg 2> /dev/null
/usr/bin/ &

touch /home/octoprint/.octoprint/turnoff
sleep 1200
if [ -f /home/octoprint/.octoprint/turnoff ]; then
sudo /usr/bin/
echo "another job is printing"


rm -f /home/octoprint/.octoprint/turnoff > /dev/null

This accomplishes the trick of turning the printer off 20 minutes after a job is done unless you start another job, or clear the flag via the web UI.

You need to do a few things, get mpack working, I can't really provide steps for that, just install what you need and then get sendmail or some other bits working, also you need to get curl working -- all that is not installed on the BBB at the outset.

Since I have 2 printers, I have a different e-mail heading so I can tell them apart who is emailing be about which print :)

PS. I just got a BBB board, so I'm going to convert my other printer to BBB. BBB is significantly faster running octoprint than RPI2. I notice things like uploading a large GCode file (40mb+) is much faster on BBB.

Re: Better cooling and remote power up

Posted: Tue Apr 26, 2016 3:04 pm
by kazolar
IMG_20160325_120726494.jpg (1.47 MiB) Viewed 7413 times
-- View of the fan underneath
IMG_20160325_120720455.jpg (1.44 MiB) Viewed 7413 times
-- view of the relay inside the printer (sorry a bit blurry)

Re: Better cooling and remote power up

Posted: Wed Apr 27, 2016 10:47 pm
I put 180mm cooling to rumba.