Saturday, May 15, 2010
Quick hot bed temperature controller...
I received some aluminum plates (one for my rapman and other for my mendel) and some 50W resistors (still waiting for the 100W ones) tied it all together and it worked just like Chris shown on his super cool blog :), anyhow using the max power (~12A ~500W) I can push to the bed it can overshoot the max temperature those resistors are specified to handle so I needed some way to control it. Initially I used the simple thermal switch (like you can see in TA oven) but as I want to be able to change the temperature from the motherboard I decided to replace it with small electronics.
I do not have a SSR lying around but I have bunch of "no name / no marking" 25A 600V triac's that are perfect for the job, I used the MOC3043 (optocoupler with triak output and zero crossing detection) to separate the electronics from the AC going in to heat bed (I'm using 41VAC), the microchip PIC16F819 is used to drive the LCD, read NTC and work as I2C slave. NTC is connected with 10K resistor to maximize reading range between 20 and 180C. NTC used is same one from BFB hot end's (GT-204).

I do not have a SSR lying around but I have bunch of "no name / no marking" 25A 600V triac's that are perfect for the job, I used the MOC3043 (optocoupler with triak output and zero crossing detection) to separate the electronics from the AC going in to heat bed (I'm using 41VAC), the microchip PIC16F819 is used to drive the LCD, read NTC and work as I2C slave. NTC is connected with 10K resistor to maximize reading range between 20 and 180C. NTC used is same one from BFB hot end's (GT-204).
"firmware" is written in PICC C, it takes ~70% ROM and ~40% RAM so there's room for more functionality if needed. I2C slave address is 0xAB but it can be changed, first 2 addresses (0 and 1) are read/write and contain target temperature for the heat bed while second 2 (2 and 3) are read only and here you can read current temperature of the heat bed. To avoid float math, the temperature is stored as *100 value. When turned on - the controller reads last stored temperature from the EEPROM (locatio 0 and 1), when both key's are pressed the current target temperature is stored in EEPROM. You can both change the target temp via i2c or using key's (whatever happens last).
Source (PICC C file) is available here.
Source (PICC C file) is available here.
Labels: controller, heated bed, I2C, Mendel, PIC, RapMan
Friday, June 13, 2008
PIC file release
I've just done release v1.2 of the PIC firmware. Get it here.
There are three files in this release:
reprap-firmware-fullstep-all-20080613.zip
reprap-firmware-halfstep-all-20080613.zip
reprap-firmware-halfstepXY-fullstepZ-20080613.zip
These do as they say - you can either half-step or full-step the
motors. Half stepping is more precise, but slower; full the opposite.
There is a problem with integer overflow for tall objects (> ~50mm) if
you half-step the Z motors. The third file allows precise XY, and
also allows Z to go to about 100 mm. Precision is not needed for Z as
it uses a screw drive anyway.
This version of the firmware will drive a solenoid valve in addition
to the heater, extruder motor and cooling fan.
THE FAN NOW WORKS OFF RB6, not the spare channel of the L298. That
channel is used to drive the solenoid.
To drive the fan, wire in a TIP110 to ALT 2 (or ALT 1), connect in the
end of the 220 ohm resistor that goes to the base of that transistor,
but connect the other end to hole 4 on the 7-hole connector by the
Max/Empty connector. This goes to RB6. It's probably a good idea to
wire a diode across connector P7 so that it's reverse biased (stripe
to the +12v line, in other words); that'll take care of any back EMF
from the fan motor.
The code is now compatible with the Arduino, and the latest Java host
software is set up to drive it too.
As we are now switching to the Arduino, this is probably the last PIC file release that we will do.
There are three files in this release:
reprap-firmware-fullstep-all-20080613.zip
reprap-firmware-halfstep-all-20080613.zip
reprap-firmware-halfstepXY-fullstepZ-20080613.zip
These do as they say - you can either half-step or full-step the
motors. Half stepping is more precise, but slower; full the opposite.
There is a problem with integer overflow for tall objects (> ~50mm) if
you half-step the Z motors. The third file allows precise XY, and
also allows Z to go to about 100 mm. Precision is not needed for Z as
it uses a screw drive anyway.
This version of the firmware will drive a solenoid valve in addition
to the heater, extruder motor and cooling fan.
THE FAN NOW WORKS OFF RB6, not the spare channel of the L298. That
channel is used to drive the solenoid.
To drive the fan, wire in a TIP110 to ALT 2 (or ALT 1), connect in the
end of the 220 ohm resistor that goes to the base of that transistor,
but connect the other end to hole 4 on the 7-hole connector by the
Max/Empty connector. This goes to RB6. It's probably a good idea to
wire a diode across connector P7 so that it's reverse biased (stripe
to the +12v line, in other words); that'll take care of any back EMF
from the fan motor.
The code is now compatible with the Arduino, and the latest Java host
software is set up to drive it too.
As we are now switching to the Arduino, this is probably the last PIC file release that we will do.
Labels: file release, microcontroller, PIC
Saturday, March 29, 2008
Arduino chosen for next stage of RepRap development

We have chosen the open-source Arduino microcontroller for the next stage of RepRap development. Zach has been working on this for a while, and it gives a number of advantages:
- Direct USB connection to the host computer, hence no significant communications delays
- Easy-to-use platform-independent software development environment
- Faster
- More memory
We shall do a release of the entire RepRap system (hardware, firmware, and software) shortly that will be a stable platform from which people can take the current PIC microcontrollers forward if they wish.
We will then do a subsequent release with identical host software, but with the Arduino electronics and firmware. This will form the basis of our next set of developments.
Labels: arduino, microcontroller, PIC
Wednesday, December 19, 2007
Experimental firmware working
I have now imported Andreas's improvements and corrections to the PIC firmware into Simon's experimental autoconf version of the code for the PIC16F648A. It all compiles, and - when put in a RepRap machine - works (at least it did for me...).
If you want to download it it's at
https://reprap.svn.sourceforge.net/svnroot/reprap/branches/autoconf-firmware
You should probably also look at Simon's instructions on the forum at:
http://forums.reprap.org/read.php?2,3861,3862
We need to do a bit more testing. Then if this all pans out OK this'll become the Subversion trunk version and we'll do a release.
The compiled .hex files (remember they're for a PIC16F648 or PIC16F648A, not a PIC16F628) can be downloaded from here. Unless you have more than one extruder on your RepRap, you can ignore the file extruder_1_.hex.
By putting this:
#define TESTLEN 53
static byte testArray[TESTLEN];
void init2()
{
testArray[TESTLEN-1] = 1;
...
in stepmotor2.c and increasing TESTLEN until the linker barfs I deduce that we have a whole 53 extra bytes to play with in the stepper code now!
If you want to download it it's at
https://reprap.svn.sourceforge.net/svnroot/reprap/branches/autoconf-firmware
You should probably also look at Simon's instructions on the forum at:
http://forums.reprap.org/read.php?2,3861,3862
We need to do a bit more testing. Then if this all pans out OK this'll become the Subversion trunk version and we'll do a release.
The compiled .hex files (remember they're for a PIC16F648 or PIC16F648A, not a PIC16F628) can be downloaded from here. Unless you have more than one extruder on your RepRap, you can ignore the file extruder_1_.hex.
By putting this:
#define TESTLEN 53
static byte testArray[TESTLEN];
void init2()
{
testArray[TESTLEN-1] = 1;
...
in stepmotor2.c and increasing TESTLEN until the linker barfs I deduce that we have a whole 53 extra bytes to play with in the stepper code now!