How to set up Marlin to use a heated chamber?
I have an infrared lamp I'd like to use to heat my chamber. Right now I don't have plans to install a cooling fan, but I will if I need to. This question pertains to Marlin (2.0, preferably) in combination with an MKS Gen L v1.0 board.
In the documentation for the thermal settings it specifies you can set a heater pin to be used to heat up the chamber. It says this variable is called the
CHAMBER_HEATER_PIN
but in Marlin 2.0's Configuration_adv.h file there is something called aHEATER_CHAMBER_PIN
that has been commented out.Secondly the
Configuration.h
file: there is something called anAUTO_POWER_CHAMBER_FAN
. Is this meant for a fan used for cooling, or a fan used for cleaning out the chamber of particles? In either case, I probably don't want to have this fan always on, but only use it to cool the temperature the heater has been on too long.So really there should be only 2-3 changes I need to make right:
- I need to specify an already present digital pin for
- the chamber heater
- the chamber cooler (fan)
- Turn thermal runway active.
- It needs to use the Marlin Chamber feature so that the readout temperature appears as "C:" in the arduino logs. This allows compatibility with octoprint
- Lastly I need to set an analog pin for the chamber thermistor
These are the things I can't fully figure out on my own.
A detailed set of instructions or code snippets for a similar setup would be helpfulMKS Gen V1.0. I would prefer Marlin 2.0 actually. I am going to update the question actually to specify that firmware. I would prefer to use the X-MAX or Y-MAX endstop as the heated chamber digital pin. And the thermistor can be the second extruder thermistor
a MKS Gen L 1.0? The board is relevent because you need to have some pins free, using the unused endstops could be an option, if the board can be retaught to do so.
Yes I agree that there are a lot of other pins free on the Gen L. I want to use the max endstops though because they have a 3 wire slotted connection and won't come off the board when connected. They also have everything you need to activate a relay (5V, GND, D2). Im comfortable with activating new pins, it's just using the "Chamber" feature of Marlin that I specifically want to use because it is compatible with Octoprint. There doesn't seem to be any documentation on the web for it, except perhaps the answer to this question.
I tried to rework the question for easier readability.
- I need to specify an already present digital pin for
Here is what I found to be the easiest solution. Please use this image for reference. I recommend doing these instructions once from source, since a lot of things can go wrong, then once everything works, go back and integrate them into your existing Marlin codebase.
Get some 5V relays to run the infrared lamps. These relays take in a 5V digital signal from an arduino pin. When the arduino activates these pins, the lamps will turn on. Get a cardboard box, line it with aluminum foil, and attach a lamp to the top of it using a lamp switch. One wire for the lightbulb goes to
NO
on the relay, the other goes toD-
. One wire from 120V power goes toCOM
, the other also goes toD-
. The yellow "jumper" on the relay boards I posted goes between HIGH and the middle pin. These are pins on the relay, not the MKS GEN board.On the MKS GEN board, we will be using the
X-MAX
endstop as the digital pin to run the chamber. Wire the5V
pin onX-MAX
to theD+
of the relay. Wire theGND
pin toD-
of the relay with the two other wires there. Wire pinD2
on the MKS GEN Board toIN
on the relay. Bold means the pin is on the MKS GEN board.Clone the Marlin-2.0 repo:
git clone -b bugfix-2.0.x https://github.com/MarlinFirmware/Marlin.git
In Configuration.h, change TEMP_SENSOR_CHAMBER to 1 or 11 (depends on your thermistor, might be other values.) Since we will be using the board's second extruder thermistor as the thermistor in this example, change TEMP_SENSOR_1 to 0 for now.
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0
#define TEMP_SENSOR_BED 1
#define TEMP_SENSOR_CHAMBER 1In the file src/pins/ramps/pins_RAMPS.h, add this line:
#define TEMP_CHAMBER_PIN 15
. Note that this is the thermistor
slot usually used for a second extruder. If you're already using
this thermistor for the second extruder and want to use a different
analog pin, see this question. You'll need some resistors.Also, around line 95 in pins_RAMPS.h, change
X_MAX_PIN
to use an unused pin. The number4
is good. If you don't do this, your Chamber's digital Pin will be always "on" by default. You want it off by default, then activated by the Marlin code.In Configuration_adv.h, change
//#define HEATED_CHAMBER_PIN 44
to#define HEATER_CHAMBER_PIN 2
to use theX_MAX
endstop's digital pin.Upload...
Go into OctoPrint settings. Click Axes and Volume. Next to a checkbox for heated bed, there is a checkbox for heated chamber! Click that, and your chamber is active.
If some part is wrong (e.g. lamp doesn't go on because wire came loose on relay), debug that and keep working. Check the octoprint log to make sure the C value is shown.
Once everything works, generalize these solutions to your set-up (e.g. using multiple extruders).
License under CC-BY-SA with attribution
Content dated before 7/24/2021 11:53 AM
Trish 2 years ago
what board is this using?