Monday, 9 September 2013

Where did all my movement go? ... Wheeee!

Starting again from the cliffhanger last time: Why, suddenly, does nothing move? What bone-headed mistake did I do this time?

Unplugged all but the Extruder stage from the Arduino (that one can't hit an endstop). When connecting ground to the correct pins, it stutters, when not connected to ground it does nothing.

The stepper output shows a regular 90 mV on the stepper pin and the direction pin switching between 0 and 5 V. The 90mV may just be the meter sampling a rapidly changing value, since the stepper pin goes up for each step, then down.

Wasn't the high speed I had set it to (unless I have burned out the motor). It just blinks once when getting power, then the stepper lights go out.

Main power looks good -- slightly low on 12V, only 11,3V.

Tried on the Y stage. Putting ground on pins 8, 9, 10 does nothing, but pin 2 works. Re-checking the diagram, yes indeed, pins 8-10 are reserved, not ground. Which means I probably need to remake my shield. I bet they printed them just now:)

That means I need to have a common ground bar rather than chaining them like I'd been doing (I don't know why that worked, obviously it doesn't now). X and Z agree. The extruder is a different beastie, so I shall leave it alone for now and do speed tests on X, Y, and Z.

Noticed that the speed variable was highlighted like a keyword, so I renamed that, no effect. Comparing with a working program, I noticed the setCurrentPosition being called in init. Remove that -- and it works. Testing Y speed now. Speed 100 is quite slow. Changing initial speed to 300, then 800.

Y stage is happy up to 1400 mm/minute == 23 mm/second. For safety, let's say 20 mm/second.
X stage goes all the way up to 1950 mm/minute == 32 mm/second. For safety, let's say 30 mm/second.
Z stage goes to 1800 mm/minute == 30 mm/second. Calling that 25 mm/second.
Ex also works no, up to an amazing 2350 mm/minue == 39 mm/second. Call that 35 mm/second.

They also all run together, very good. Temperature test also works once it's been all wired up. Now for the real firmware setup.

Seems to ignore my changes, giving an error on Z_MAX_PIN even after I comment it out. Turns out the Arduino software doesn't reload from symlinks when the base file is changed. Restarting it helped.

When generating GCode, I set feedrate and travel feedrate to 20 mm/s.

Trying to build still gives me errors, though:
  • Homing in the wrong direction for selected machine: 'G162 X Y F2500 (home XY axes maximum'
  • Homing in the wrong direction for selected machine: 'G162 X Y F2500'
  • You're moving too fast! G1 X-0.0 Y-8.9 Z1.7 F1080.0 E146.57 turns at least one axis faster than it's max speed.
  • You're moving too fast! G1 X-0.0 Y-8.9 Z10.88 F1200.0 E790.555 turns at least one axis faster than it's max speed.
  • You're moving too fast! G1 X-0.0 Y-8.9 Z11.42 F1200.0 E887.258 turns at least one axis faster than it's max speed.
    ... and many more 
This is curious. G162 doesn't even exist in several of the GCode specs, and the feed rates for G1 should be well within the limits. Trying with 15 mm/s feedrate. Crawl, crawl, crawl... even that is too fast. Trying with 9 (i.e. 540 mm/minute), which is below the search feed rate. I have the Teacup set to the following: 

/// used for G0 rapid moves and as a cap for all other feedrates
#define MAXIMUM_FEEDRATE_X 1800 // 226
#define MAXIMUM_FEEDRATE_Y 1200 // 226
#define MAXIMUM_FEEDRATE_Z 1500 // 226
#define MAXIMUM_FEEDRATE_E 2100

/// used when searching endstops and as default feedrate
#define SEARCH_FEEDRATE_X 600
#define SEARCH_FEEDRATE_Y 600
#define SEARCH_FEEDRATE_Z 600
// no SEARCH_FEEDRATE_E, as E can't be searched

But the real culprit is the ReplicatorG machine definition in /Applications/ReplicatorG.app/Contents/Resources/machines/reprap.xml, which set a max feedrate of 500. Just below what I stopped at:)

With this fixed, the only errors I get are
  • Homing in the wrong direction for selected machine: 'G162 X Y F2500 (home XY axes maximum'
  • Homing in the wrong direction for selected machine: 'G162 X Y F2500'
  • You're moving too fast! G1 X105.0 Y-70.0 Z10.0 F3300.0 (move to waiting position) turns at least one axis faster than it's max speed.
  • You're moving too fast! G162 X Y F2500 (home XY axes maximum turns at least one axis faster than it's max speed.
  • You're moving too fast! G162 X Y F2500 turns at least one axis faster than it's max speed. 
Fixed these instructions in the generated GCode (except for homing in the wrong direction, which I'm not sure of). Running it sounded like a helicopter warming up! After apparent attempts at homing the Z axis with no effect, the X and Y axis moved at steadily increasing speeds -- Y towards 0, X away from 0. Y crashed into the endstop, while I stopped X before it could get away. Not a perfect success, but it's the first semblance of control from ReplicatorG, so it's a success after all.

From the control panel, I see all stages turning, and the heater heating and being measured. So it's all good.

No comments:

Post a Comment