onsdag den 20. november 2013

RepRap: Testing your temperature sensors, without a secondary thermometer

So I was hanging around the IRC channel #reprap, and a guy had an issue with his hotends burning up. I decided that I would do a blogpost, on how one would go about testing whether or not your thermistors actually show an accurate temperature, without any secondary thermometer to validate your results.

Know temperatures

The method we will use to test whether or not your thermistors read correctly, is by testing the reading agains some known values, and seeing if they are correct. I will start with two known temperatures that won't require a thermometer, and move on to some that will only require some pretty standard ambient air temperatures.

Body temperature

The first know temperature that we have, is our body temperature. If you are not burning up with a fever, and you are nice and healthy, your body temperature should be close to 37°C. The best place to measure this, would be *cough*up yours*cough*, butt I'm pretty sure that you wouldn't want to have to go there. Another place that you can get a reading very close to body temperature, would be under your tounge, as it is a humid, closed area, and there are some big blood vessels under your tounge. This means that if you stick the thermistor under your tounge, you should get a reading of 37°C
!!!--I am not responsible for any damage or accidents caused by following this blogpost--!!!
So as you are sticking wires in your mouth, this should be really safe, tho if there is 12v on it, it might tingle a bit. That said, there really shouldn't be 12v on the thermistor. To make this as safe as possible, only have your electronics powered by USB if you can.

Ice bath

Another easy know temperature reference would be an ice bath. For this test, fill up a bowl half/half with ice, and let it stand until the water has reached 0°C The theory behind this, is that water at one atmosphere pressure freezes/melts at 0°C and therefore the water will not go any colder than 0°C. To take this messurement, you might need to go into your configuration.h and change the min-temp to -1, then you stick the thermistor into the water, and the read temperature should read ~0°C

Boiling water

A third know temperature, is the temperature of boiling water. Boiling water will, at one atmosphere pressure, be at 100°C. fill a pot with some water, heat it till i boils, and then stick the thermister in there. Again it should read 100°C

Thermometer dependent methods

Okay, so you might not want to change your firmware to messure the icebath, and you might not want to boil some water, so what can you do then? You could check your room temperature. Most people will have a house thermometer, so take that to the room of your messurements, and the two readings should show close to the same. Say the room temperature was 20°C your reprap should read the same.

Now if you have a roast thermometer, you should be able to heat your hotend to say, 60°C with the thermistor in the hotend. During the heatup, leave the roast thermometer on the hotend, and see if it actually stops at 60. If it stops a little higher, there's some messurement error, but the important thing is, your roast thermometer probably won't survive too high temperatures, so remove it before that becomes a danger.

The most important thing about this, is that the more messurements, you get, the better.

tirsdag den 19. november 2013

ATX power supply for repraps

I was lucky that when my school decided they wanted two repraps, they heard that I had experience with these new marvels of cheap home 3D printers, so I along with a friend was asked to assemble, calibrate and commission  the single frame i3 printer kits that they had bought.

This blogpost will talk about what I think is the optimal way of using an ATX PSU for powering your reprap, what I did, and what you could do differently

How is an ATX power supply different from a single 12v power supply?

Well first of all, the ATX power supply is meant for use with computers, and as such follows a strict standard, The ATX standard that is, and therefore every ATX power supply will have the same things that I will mention in this post. An ATX powersupply will have a 12V rail and on any newer PSU this will most likely be the most powerfull rail in the PSU, as all the other, lower voltage rails are generated off of this rail. This is due to the high demand of 12v PC's usually use, to run power hungry graphics cards and CPU's.
Other than this powerful 12V rail, the ATX will also have a 3.3V rail, a 5V rail and a -12V rail. The ATX standard also calls for some more specialized rails, the ones we care about are PS_ON, and 5Vsb, potentially Power_OK. These rails may be named differently depending on the PSU, but here's what they do:

  • PS_ON: The PS_ON cable is the green cable present in the biggest 20 or 24 pin connector, if this cable is not connected to anything else than ground, or not connected to anything, the power supply will be in standby mode, where only the 5Vsb line will be powered up.
  • 5Vsb: 5Vsb stands for 5 Volts standby. This is because this rail is on while the powersupply is in standby mode, and is to be used for powering the part of your electronics that handle turning on the power supply. In our case this will power our reprap electronics, (in this case RAMPS 1.4) so that we can turn on the 12v rail with the command M80 in Sprinter and Marlin. (Used in other firmwares too) The ATX standard calls for atleast 500mA available on this rail, but it's often a lot higher. In our case 2.5A so five times as high.
  • Power_OK: Is a signal line, that the powersupply turns on when it's done with it's self diagnostics. This usually takes a couple of seconds after the PS_ON pin is driven low, A.K.A the power supply is turned on. This will not be used in this guide, but could be used to ensure good power is reaching your electronics before starting up.
This is what sets the ATX power supply apart from a single rail 12V power supply, often called an LED powersupply.

These are very useful features, and while the ATX power supply will be more expensive than a 12v LED power supply of the same wattage, I think it worth the money.

The two wires we will be using is the purple 5Vsb rail, and the green PS_ON cable, but first a nice and default disclaimer...
DISCLAIMER-------------
Following this guide puts you at risk of electric shocks that are potentially lethal. Following this guide will also most likely void the warranty of your product, and in case of a catastrophic failure of the product, might cause damage to your property, that isn't cover by your insurance!
I AM IN NO WAY RESPONSIBLE FOR THE CONSEQUENCES THAT YOU FACE BY FOLLOWING THIS GUIDE.
-----------------------------

Now when were done with that, don't be too afraid. Getting shocked is the first danger, to avoid this, disconnect the power supply from power, and make Damn sure to either discharge any energy storing device in the PSU, or not touch anything dangerous in the power supply.

As for the damage to other property, if you PSU catches fire, and burns down your house, I have no idea whether or not your insurance covers that, as the power supplies safety certificates probably won't be valid anymore.

As for the warranty, no way around that :/

The fun stuff

Okay, this is what you actually came here for, but I like to blabber so sorry about that :P

First of all, you want to make sure your power supply works. The best way to do this is to use a power supply tester if you have one, but another simpler way, is to simply test if the gray Power_OK goes high if you turn on the power supply by shorting the green PS_ON cable to a black ground cable. If the power supply is bad, you haven't cut anything, and you and you can return it under warranty.

It works! good. Let's cut it up >:D

The first thing to do is check which connectors your electronics use for power. The very popular RAMPS 1.4 uses a nice unpluggable connector. In most cases, the power is fed to the board through a variation of a screw terminal or crimp terminal, but if your board uses any of the standard ATX plugs, you should not cut these off.
In out case, we are using a RAMPS 1.4, and will therefore cut off every single connector.

 Picture time:

The cables that I kept, was the power good signal, the 5Vsb, and then 5 Yellow 12V cables for RAMPS. 3 for the 11A rail, and 2 for the 5A rail. and 1 extra 12V cable that I hooked up to a salvaged Molex connector, to use for other 12V parts, such as fans, as the RAMPS doesn't provide any 12V rails.
The PS_ON and 5Vsb cables are extended with some thinner cable, and then I soldered on a 3 pin female, 2.54mm header. The middle pin of the 3 pin header is left empty, and the two cables are inserted in the outermost slots (this is for the header on RAMPS 1.4)
Inside the power supply, I decided to cut the Power_OK signal, as I wasn't going to use this.
Every ATX connector type cut off, and excess 5v 12v and GND cables saved for later expansions 
Ends of each rail heat-shrunk to avoid shorts.

Look at the pictures, they be fancy

Now that I have spammed you with pictures, let me explain a little bit more.
In our case this power supply is prepared for RAMPS 1.4, and therefore the PS_ON and 5Vsb is soldered into a female 2.54mm spacing header. This is to go on the 3 pin header on the ramps, near the power connecter. The PS_ON cable needs to go to the PS_ON on the ramps, and the 5Vsb rail goes to the VCC rail on the ramps NOT the 5V rail, as this seems to be something else, and won't power the Arduino.

If you are not using ramps, and your electronics have available I/O pins, but no dedicated PS_ON pins, You would attach the PS_ON pin to an available I/O, and the 5Vsb to the 5v rail that powers your electronics.

Firmware

Now it's time to setup the firmware. You might not even need to do this, but as marlin ships default, you powersupply will turn on, when the electronics boot up, and you might not want this.
To change this, I recently contributed a very simple change to the firmware, with help from the IRC channel #reprap (I was quckly pointed to the lines in the code, so I wouldn't have to find them myself :) )

In your configuration.h in marlin, search for "define PS_DEFAULT_OFF and remove the // in front of this line. Right above should be a setting called "define POWER_SUPPLY 0" This should be set to 1 to specify ATX PSU.

If you are not running ramps, and your electronics doesn't have any dedicated PS_ON pin, you will have to edit your pins.h file. You will have to find
You will have to locate the section dedicated to your motherboard / electronics, and then change the value to the I/O pin that you connected it to.

Slicer

From now on, you will have to rely on your gcode starting with M80, as that will turn on the 12v rail, used to power your electronics. and optionally you can have it send M81 when the print is done, to ensure that your 20A+ rail isn't on to cause bad stuff. And I will follow up with that.

mandag den 7. oktober 2013

Starting up the blog

So this is where this blog begins. Why did I start this blog huh? Well I found myself writing long mails, and helping people with the same issues when it comes to 3D printers, so I thought "Well why not have somewhere where I can write everything out once?" So that's this blog. 
I will also be posting about random projects I might do, so if that tickles your fancy welcome :)