Welcome! Log In Create A New Profile

Advanced

I just got RAMPS and a thermocouple... now what?

Posted by keavon 
I just got RAMPS and a thermocouple... now what?
January 16, 2011 12:35AM
Hello.
I just got a whole RAMPS board, and I don't want to use a thermistor. I want to use a thermocouple, which I already have. Apparently the thermocouple makes voltage from heat, while thermistors change resistance.
I heard that I need to use the MAX6675 board (click here), but this wasn't done on RAMPS and I have no clue on how this works.
Do I plug the thermocouple into that board, which goes into where you normally plug the thermistor into in the RAMPS?
I would really appreciate some help, as this is my first build. I just completed most of the mechanical stuff today.
Thank you so much!
-Keavon

Edited 2 time(s). Last edit at 01/16/2011 12:53AM by keavon.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 06:27AM
The MAX chip has a precision amplifier to measure the thermocouple. Its output is a serial data stream that must then be interpreted by your controller. There is some code in the reprap firmware for reading the temp from the max chip (that is in fact what I use), but im not sure if the RAMPS compatible firmware supports it too. I have heard that the guys from the Melbourne (Australia) RUG were working on it, but they may have been using the AD595 thermocouple sensor chip.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 06:52AM
Unfortunately the guy who was working on it (Scorpia) has seemingly been AWOL for about a month now.

It is the season for holidays though, so it's possible he's just enjoying some time off.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 12:20PM
Okay, so is there possibly some kind of chip or board that will convert the output of a thermocouple into the output of what a thermistor would normally do?
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 12:32PM
Have you asked Ultimachine about this? Johnny keeps an eye on the ramps forum. If a moderator doesn't move the thread, you could ask over there.

I just use a thermistor with mine, but presumably you could hook it up to a set of serial communication pins and configure them in your firmware. I do not see built in thermocouple support for RAMPS, but if you take a look at PID.pde and how the existing thermocouple code works, it doesn't seem like a very big stretch to make it work with RAMPS. Add a few pin definitions, re-route a few function calls, and you could probably get it working. It might even be as simple as changing
#define USE_THERMISTOR
to
#define MAX6675_THERMOCOUPLE
Of course, you still need to define the pins.

You shouldn't need another converter chip as long as you use the appropriate arduino pins, but since the firmware doesn't appear to have it built in you will have to do some firmware modifications.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 01:02PM
You can use the breakout board, however you will need to wire it up to D50 to D53 on the Arduino Mega, as those are the pins that are addressed for in the SPI library.

I am currently in development of having a native MAX6675 on the RAMPS board.

Was working on it a bit more this morning, and it is nearly ready to go out for fab.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 06:22PM
FWIW: Scorpia had a prototype board that could be plugged into some of the spare digital outputs on the RAMPS board, and the idea was:

1. Drive one output high and use that as VCC for the MAX6675 board.
2. Drive one output low and use that as GND for the MAX6675 board.
3. Use the remaining pins for serial comms.

Note: The current draw of the proto board was apparently quite low, and using it in this config with a mega (by itself) is apparently fairly common.
Re: I just got RAMPS and a thermocouple... now what?
January 16, 2011 09:17PM
dazed.dnc,
I asked Johnny on the IRC, and he said he didn't know and hasn't had it done. This is my first RepRap and it is on a slight deadline (the end of the month - working - but I do have everything else but the extruder done) and I actually don't know what file to edit that code in with. Is that the firmware on the board or the driver on the computer? Is it Python? I am not very good at programming outside of HTML/CSS and JavaScript in Unity. I have a book on Python, but never got through it.
Thank you for your input and suggestions. I will check out Ulitmachine's forums.
smiling smiley

Edited 1 time(s). Last edit at 01/16/2011 09:18PM by keavon.
Re: I just got RAMPS and a thermocouple... now what?
January 17, 2011 05:52PM
The firmware is written in C (or C++? I was never very knowledgeable on the differences). With the exception of the acceleration/stepper driver code, it is relatively simple. I don't see a whole lot of advanced trickery going on. Since you have done some programming before, it might not be as overwhelming as you would think.

To edit the firmware, the simplest thing to do would be to get the Arduino IDE. The IDE seems to have an unusual method of handling class objects. It can take some getting used to if you are familiar with Java classes. If you have never heard of a class, it might make no sense at all. Otherwise, the Arduino environment is very easy to learn.

Within the source code, you'll see several different *.pde files. One of them will contain what is essentially the main function. When you have opened the correct one, you will get all of the source code to open at once. If you are editing a different firmware, it may be called something different. For me, this file is called "FiveD_GCode_Interpreter.pde". It is important to note that this file and the rest of the source code must reside in a folder called "FiveD_GCode_Interpreter". I think this goes for any arduino program. The main pde file has to be in a folder that goes by the same name. IE: C:\my_custom_pde\my_custom_pde.pde

When you get everything opened, one obvious point of interest is in the tab titled "pid". The file type is obscured in the tab title for some reason, but this is actually coming from the file "pid.pde". Look below where it says "#ifdef MAX6675_THERMOCOUPLE". This is code for reading the thermocouple and storing the value in memory. Use ctrl+f to search in other files to find out which ones are using the different variable names you see here or are calling this function. You should be able to step forwards or backwards along the program to see how it would ordinarily work. Compare this to the code for reading a thermistor and maybe you'll be able to piece it together so RAMPS uses the thermocouple instead of the thermistor.

Edited 1 time(s). Last edit at 01/17/2011 05:56PM by dazed.dnc.
Re: I just got RAMPS and a thermocouple... now what?
January 18, 2011 10:43AM
O.o...
Wow, that looks pretty complicated, but I might be able to handle it.
My first question is where do I get the source? Do I download it (if so please give me a link) or do I rip it off the RAMPS?
Also, does it all go on the Arduino and nothing on the shield?
My main concern is that since to read a thermistor, the RAMPS put out voltage and read how much is coming back in. On the other hand, a thermocouple (esp. when amplified by the MAX board) is taking in nothing and putting out something (generating current from the heat). Wouldn't this break the board? Also, I would have to tell it to stop putting out current. Is this all able to be reloaded to the original if I fail? How easy and how do I upload the firmware when I'm done, or to revert back to original?
Thank you for your ideas, I hope to make this work (though I'll probably just get a thermistor...)!
-Keavon
Re: I just got RAMPS and a thermocouple... now what?
January 18, 2011 10:51AM
You can build the Thermocouple Sensor 1.0.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Sorry, only registered users may post in this forum.

Click here to login