Saturday, 25 May 2013

The Rainbow Machine and its firmware

For the lack of a daughterboard, I used some nice male-male wires that were in the electronics drawer in FabLab. That's one of the nice things about being in a makerspace, you're likely to find the pieces you didn't know you needed. I'll put them back as soon as I have my nice Fritzing board.

Plugging black to GND, green to Step, yellow to Dir, red to Opto-Endstop, blue to temperature, and orange to heat, I now have a nice rainbow-colored setup. It's a bird's nest of wires, so I hope I don't have to change too much around. Swapped out the poorly-soldered thermistor wires with more of the ready-made ones. I should get some of my own for at home.



Having tested all motors, heating, and temperature sensor, it's time to try some GCode interpretation. My options are ReplicatorG and a plain GCode interpreter like XXX.

ReplicatorG comes with a RepRap 3G driver, which is made for integrated motherboards that use a special communications protocal, and a serial pass-through driver which just sends the GCode. For the latter, I would need a GCode interpreter anyway. So, plain GCode interpreter for Arduino it is.

The obvious start is the interpreter on RepRap.org. Several links claim to have an updated version, but mostly lead to the GCode spec page. Ignore them.

But Ha! It's not so simple to get some GCode firmware, the RepRap solutions are with fancy interfaces and ... don't run on Mac. The most basic thing seems to be the 5D GCode on github, but even that requires C++ compilation. I could try the PronterfaceX Mac build, except my corp laptop's security restrictions forbid running this.

Back to RepRap. There's a simple-looking set of instructions that don't require extra software, but... it's been obsoleted and the file is now gone, superseded by Mendel. Only .hex files are left.

At long last! The teacup firmware appears to just need the Arduino software that I already have, and has a config that's just a bare Arduino with pin settings.

Made the following changes:

  • Copied config.default.h to config.monster.h and made config.h an alias of that
  • Made Makefile an alias of Makefile-AVR
  • In Makefile-AVR:
    • Changed MCU_TARGET to atmega168
    • Changed TOOLCHAIN to /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/
    • Might have problems with the -P flag since the USB port changes every time I plug it in.
  • In config.monster.h:
    • Changed STEPS_PER_M_{X,Y,Z} to 266666 (fits my previous measurement)
    • Changed MAXIMUM_FEEDRATE_{X,Y,Z} to 226 after measuring max AccelSteperr speed
    • Changed X_MAX to 140, Y_MAX to 80, Z_MAX to 55
    • Changed to ACCELERATION_REPRAP
    • Changed pinouts to: 
      • X_STEP_PIN DI04, X_DIR_PIN DI05, X_MIN_PIN AI05
      • Y_STEP_PIN DI06, Y_DIR_PIN DI07, Y_MIN_PIN AI04
      • Z_STEP_PIN DI08, Z_DIR_PIN DI08, Z_MIN_PIN AI03
      • E_STEP_PIN DI02, E_DIR_PIN DI03
      • What is PS_ON_PIN for?
    • Set pin in DEFINE_TEMP_SENSOR(extruder) to AI01
    • Set DEFINE_HEATER(extruder) to port PB3 (==DI011) and pwm 0. 
  • Copied ThermistorTable.single.h to ThermistorTable.monster.h and linked ThermistorTable.h to it.
  • Updated ThermistorTable.monster.h to values that should correspond to my thermistor (100K plus 1K resistor to measure against. Command line: ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=1000 --beta=4066 --max-adc=1023. The use of a smaller counterresistor appears to give me a better resolution at high temperatures.
Well guess what: MacOS "aliases" are not softlinks, they are binary chunks of what-not. Looks unhappy when the Arduino IDE tries to compile them. Replaced with softlinks.

Fails to compile usb_init(). I guess the ATMega168 isn't USB-enabled, even though the Arduino is. Changed to non-USB, and it compiles... but is too big: 17,512 bytes (of a 14,336 byte maximum). Posted to RepRap.org forum asking if this is fixable. Otherwise, I might (gasp!) have to get a larger Arduino.

TODO:

I will need to mount the opto endstops for the X and Y minimums properly, right now they're just using taped-on cardboard mounts.

So my maximum volume with this machine is 14x8x5.5 cm. Important to know when designing, and small compared to the 20x20x20 of the Ultimaker, not to mention the 40x40x40 of the big machine some of the other FabLabbers is making (it's outer dimensions are 65x65x75, while mine is 50x60x65 - my machine is wasting a lot of space). The big machine has 20% working volume, while mine has 0.3%! Of course, mine is a more open design, so it doesn't fill a whole cube, but still... I may have to go for the 60 times more volume next time.


No comments:

Post a Comment