Tuesday, 18 June 2013

Finishing the hardware, now for the software.

After a two-week hiatus, I'm back to adjust a few things:

  • I moved the Y stepper motor driver cooler to give better access to its potentiometer, since it was overheating. Also applied thermal paste for superior heat transfer to the frame. I notice now that the power supply gives a nice breeze of air, I should point that at the drivers:)
  • Took off the Z stage and tightened the mount.
  • Mounted X and Z stage opto endstops.
  • Found some thin metal plates to trigger the endstops.
  • Ran some stress tests on the stages. The Y stage has a disconcerting tendency to just randomly refuse to move. Maybe more oil is needed.
  • The extruder driver is not currently overheating, a step forward.
  • I can get the extruder to heat using ReplicatorG, but the thermistor readings still look digital.
  • Mounted X and Z minimum opto endstops.
  • Used some scrap metal straps from the new CNC to make the endstop triggers.

These are the relevant config files, for debugging the thermistor problems:

Monday, 3 June 2013

A new Arduino, and a major success!

Rather than spending unknown amounts of time trying to shave bits off code I don't know, I eventually got a more modern Arduino, an Arduino UNO R3. It comes in a card-deck box:) More importantly, it has 32K memory, enough to run Teacup comfortably. I was able to upload the Teacup firmware I had configured last time. Using ReplicatorG with the Teacup pre-programmed machine, I could connect and at least talk to it, even if it thought I was homing the wrong way and obviously miscalculated the duration of a simple print.

Some updates to the firmware:

  • Makefile - changed to MCU_TARGET=atmega328p (though mine is atmega328, according to the specs)
  • config.monster.h - tried changing to USB_SERIAL, but then it failed to upload. Setting it back didn't help. Setting the MCU_TARGET back to atmega168 didn't help either, suddenly I can't upload the firmware any more:(
After scanning this thread I realized it was ReplicatorG interfering. When that was off, it works nicely with MCU_TARGET=atmega328 and with USB_SERIAL.

I made a new ReplicatorG machine in reprap.xml with these settings:

Monster w/Teacup (115200 Baud)


At first, I have changed only the parts I know of (size, speed, heat options) but nothing in the driver. Since this one seems to talk serial, I switched the config.monster.h back to serial and re-uploaded.

Using ReplicatorG, I can connect to the Arduino. Disconnecting doesn't seem to work, just puts it in a funny state. But I can use the control panel to move the motors! X and Y moves nicely, except that X occasionally stalls for no apparent reason. Maybe I need to adjust the potentiometer. Z doesn't move at all, nor does the extruder. Heat is totally whacky, says it's 2240ÂșC. And the extruder driver still overheats. Maybe I should use the little Fritzing one I got at Make Munich instead.

Update: The Z motor only doesn't move because I tried to move it upwards first. It doesn't allow me going below zero. That may make it tricky to use the controller to move them back. Not even uploading a config that has all dirs reversed changes that.

Fixed the X motor problems (apparently) by adjusting the potentiometer to give a little more power.

The temperature reading is perplexing. Running the bare-bones measurement shows 0 for a while, then it goes to 3840, almost as if... it's digital!  No, not even that, it doesn't drop again.

Reading through the temp.h file of the Teacup firmware, I notice that the thermistor analog read is done with the temp sensor number rather than the pin number. Changing to use analog pin 0. Didn't help.

Setting the Teacup min less than 0 allowed me to use the controller to move negatively, getting to a proper zero position. Also changed max speed and experimented with what the motors will take. Adjusting the potentiometer allowed me to find a fast setting that still doesn't overheat on idle. Got the X axis to 400 mm/s. Y axis potentiometer is harder to access. Z axis doesn't have to be all that fast. Extruder axis (once it works) will need a setting that depends on how fast I need the extrusion to be.

Next time: Find out what's up with the thermistor, why the PWM doesn't react to anything I do, and why the extruder stepper motor doesn't react either. I expect the latter is because it expects the target temperature to be set first, but maybe not.

All in all: "This was a triumph./I making a note here:/huge success!"