Monday, 2 September 2013

Calibrating is hard. Let's do math.

Wanted to calibrate the speed of the motors, since the ReplicatorG setting had a much larger speed than we seemed to support. So I made a nice little state machine that first moved a bit away, then moved to the min endstop, then a larger bit away, then back and forth with increasing speed. I tested it during development with the X stage, improving it over a couple iterations until I noticed I was reading from the wrong endstop. Fixing that, everything stopped moving. No response whatsover from any of the motors regardless of program. I still hear back from the Arduino, but no reaction otherwise. Odd, but time to go now.

Monday, 26 August 2013

Trim a toe and hack a heel...

I took the extruder block home and sliced a piece off the rear end, so now it doesn't hit the base of the Z stage any more. But when testing that, it turned out that at a specific X stage position, a screw in the Y stage would hit the extruder holder. 'Tis but plexiglas, I can take a wirecutter to it and snip off a corner. Works.

The lower Z endstop is not calibrated for the current height at all. Need to add a better-than-cardboard piece. Unfortunately, it's in a very tight spot -- that's one of the issues with this design: While the printing surface is nice and accessible, the L- and U-shaped aluminium pieces and the multiple layers of plexiglas makes it difficult to get in and adjust things.

Finally after some fiddling got it bolted on - though a broken-off corner on the teflon runner foot -- only in that corner, of course -- made the endstop plate bend forward, so I had to bend it back. Fiddly.

The endstops don't work the way I'd hoped to. At the moment, they seem to be floating, though the bottom Z LED registers nicely, and the bottom X LED registers weakly.

Oh. I had old pin settings on them. After fixing that, it turns out the two Z endstops and the two loose ones are fine, but the X and Y endstops are floating. I wonder if it's a problem with the mounting? Will take one off and try it on its own. Yes, definitely the case for the X endstop. I guess the bits of wire on the back side were enough to dig through the paint and short it. Adding a piece of cardboard helped quite a bit.

I'm also getting a bit concerned about the X and Y stage rail pressors. The X stage wobbles sideways quite a bit, and the Y stage jumps easily up and down. Not easy to fix, particularly the Y stage, due to the construction.

Trying the ReplicatorG calibration block. It seems to expect much higher speeds than I have given in the firmware settings. I should re-measure the speed and put in realistic rates. 4mm/sec is kinda low.

Here's some of the bits I chipped off today and the precision tool I used for it:


Monday, 5 August 2013

Crashing the Teacup

Wired the Arduino back up after last time's oscilloscope adventures. Testing first with G1 [XYZE]nn commands, only X works. With homebrew firmware, the extruder works as well.

Giving G1 E10, the extruder motor starts chopping angrily. Setting a search speed (despite the lack of real "search" capability) it moved nicely for a bit, then went back to angry chopping. Trying to adjust the potentiometer does nothing. Odd. Adjusting the potentiometer while it's running a simple back-and-forth doesn't change anything, have to turn it off and on. After adjusting, it now runs stably from Teacup, though slowly and noisily.

D'oh. Simple but consistent miswiring. Green is step (go), yellow is dir (change). Not sure why the Teacup movement is so slow. Using the G0 commands it goes zippy-fast, actually too fast for Y and Z. Setting the max feedrate for all down to 226 from 500 helped the Z, but Y is still unhappy. E is now doing fine.

M104 S100 sets the target temperature to 100ºC. M105 shows that the temperature is going up! It went 5º over before it stopped cooling. Excellent!

Crashed the Z head into the bearing holding the rod. Annoyingly, the extruder house also hits the bearing and supports, after I carefully filed parts of the underlying plate. Need to slice 4cm x 3mm off that, too. Not tonight.

The crashed head:



Monday, 22 July 2013

Calling down the oscilloscope

Having seen no reaction from the extruder motor, I decided to use the oscilloscope in FabLab to see if the correct signals were being sent. This turned out to be a more difficult task than expected, mainly because I don't have the first clue about oscilloscopes. I and a few other FabLab members fiddled for a while with the knobs and dials without seeing any output. The calibration output showed a nice signal, but nothing from the Arduino.

It wasn't until a 70-year-old electrical engineer offered his advice that we figured out what was going on: The signal was so weak that it didn't trigger at the voltage we expected. Even though the signal is supposed to be 5V, a capacitor somewhere in the circuit cut it down so quickly that we needed to go down into 1/100ths of a volt to see the signal. Must be something in the Arduino.

With this new knowledge, I ran raw GCode commands against the Teacup firmware. Trying the various extruder-specific commands didn't do anything, but just using G1 Enn to tell the extruder to move gave the expected signal. So it does work, if you just ask it the right way. I wonder if ReplicatorG doesn't do that. Looking at the generated GCode, it does indeed use the G1 commands, maybe it's just the manual control panel that doesn't.

Tuesday, 16 July 2013

Homework

Finding out what's up with the temperature does not require the full Monster. I took the Arduino home, and am using a simple potentiometer to emulate a thermistor.

Adding a printf (sersendf_P(PSTR("RAW TEMP[%d]:"), temp), to be exact) and it shows that the raw read is correct. The temperature table however always gives 0. I'm thinking something is read out of bounds.

Problem solved: The temptable is actually a list of lists of pairs of temperatures, but I only defined the list of pairs. Adding an extra pair of brackets helped immensely.

Oh, joy, new version of Arduino wants to change my filename extensions. Including those in the teacup firmware. I don't think so...

Moving on to why the extruder doesn't work... testing the voltage of the Z axis dir pin shows it changes between 0 and 5 depending on direction, while the step pin goes up a bit when told to move, regardless of direction. The step pin only goes up slightly because it's sending timed pulses. On the extruder pins (using the ReplicatorG control panel) - nothing.

Trying to figure out which GCode to use to run the extruder. M108 and M113 both give Bad M-Code. System info (M115) says there's an extruder. Turning the extruder forward/reverse (M101/M102) shows nothing on either pin. G0/G1 commands give no reaction either.

Some fiddling with G1 and M114 shows that repositioning indeed takes place. The default feedrate was 50, slow enough that it was hard to measure. At a feed rate of 1000, it's clear that there's stepping going on.

The E position is odd, but that's probably just me not understanding how a circular position is represented. It's definitely doing something, but only in one direction.

I'm not entirely convinced that Teacup thinks of the extruder as a stepper motor rather than a PWM. Must investigate later.

Monday, 8 July 2013

Fiddling with GCode

Repeatably, I see the temp sensor and extruder motor working with hand-crafted Arduino code but not with Teacup firmware through the ReplicatorG manual control panel. To fix this, I took the GCode in the ReplicatorG model I'd created long ago and trimmed it down to just heating and reporting temperature. When I tried to run it, I got a number of safety check warnings. First: Recreate GCode with the new firmware - the GCode was created for other firmware setup. Didn't change much. Found out how to cut ReplicatorG out of the equation: By running the firmware in the Arduino app, opening the serial monitor, setting baud to 115200 and line ending to newline, I can run commands directly to the GCode interpreter. And, indeed, it just returns 0.0 for temperature. Maybe there's a problem with the thermistor table.

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:
config.h:
ThermistorTable.h:
machines/reprap.xml: