Bukobot 3D Printer Forum

Software Installation & Setup => Firmware => Topic started by: NoiseReduction on February 19, 2013, 03:03:49 AM

Title: Z "Home" bug causing me problems
Post by: NoiseReduction on February 19, 2013, 03:03:49 AM
I'm not sure if there's another forum thread for this problem specifically, but here it goes -

After installing the single-extruder arduino firmware, everything seemed to be working perfectly.
5 minutes later, I noticed that pressing Z's "Home" or "Home All" in Repetier started pulling z up, not down.

I reset the board, power cycled the printer, and even restarted Repetier to no avail.

Update: Z behaves as if the minimum value was 200 or so. As long as I make it go up a little first (Z+), I can then do Z- the same number of steps (i.e., if I click +2, I can then do -2, but then it stops, acting like position ~=200 is somehow the minimum stop position).
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 19, 2013, 07:28:13 AM
I'm just guessing here, but..

(1) bug in host software?  Does it happen if you use pronterface instead?

(2) firmware bug on the Azteeg?  (Does reflashing help?)

(3) One motor coil driver not working or not connected?   This last problem is described here: http://bukobot.com/jitsbuild-failure-conditions#thing-not-moving-correctly (http://bukobot.com/jitsbuild-failure-conditions#thing-not-moving-correctly).  It can cause things to go in the wrong direction, usually randomly, but maybe you're just lucky.

Try this:  Manually move all 3 axes to the middle of their respective ranges.  Don't hit any home buttons during the following.

Remove all driver boards from the Azteeg, then plug the (current) X axis board into the  Z axis socket (maintain correct orientation!).  Unplug all motors, then plug the X axis motor into one of the Z connectors.  Then tell the Z axis to move 10 cm in one direction, then the other direction.  This should cause the X axis to move one direction, then the other.  Does it?
Title: Re: Z "Home" bug causing me problems
Post by: buildrob on February 19, 2013, 11:38:29 AM
Isn't the motor moving in the wrong direction normally caused by the motor connector being flipped over? [Not necessarily your fault as they apparently don't always wire up the motors the right way around in the factory.]

Edit: oh no ... you said it was working and then not working.
That is strange. Because its the Z axis it seems unlikely that both motors with be intermittent due to a wiring problem. Jit's advice of swapping the drivers around to try to isolate the problem is a good one.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 19, 2013, 07:25:13 PM
I'm just guessing here, but..
(1) bug in host software?  Does it happen if you use pronterface instead?

With Pronterface, the issue is the same. It did help me notice that it goes down, as long as I make it go up a little first (i.e., if I do +2 in Z, I can then do -2 in Z back - but then it stops, acting like position ~=200 is somehow the minimum stop position...

(2) firmware bug on the Azteeg?  (Does reflashing help?)

I can try to reflash and report back soon. Thanks

(3) One motor coil driver not working or not connected?   This last problem is described here: http://bukobot.com/jitsbuild-failure-conditions#thing-not-moving-correctly (http://bukobot.com/jitsbuild-failure-conditions#thing-not-moving-correctly).  It can cause things to go in the wrong direction, usually randomly, but maybe you're just lucky.

Seems unlikely, but I'll check it out, thanks!

Try this:  Manually move all 3 axes to the middle of their respective ranges.  Don't hit any home buttons during the following.

Remove all driver boards from the Azteeg, then plug the (current) X axis board into the  Z axis socket (maintain correct orientation!).  Unplug all motors, then plug the X axis motor into one of the Z connectors.  Then tell the Z axis to move 10 cm in one direction, then the other direction.  This should cause the X axis to move one direction, then the other.  Does it?

I'll try out that procedure and get you an answer - thanks a lot!
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 19, 2013, 07:29:05 PM
Isn't the motor moving in the wrong direction normally caused by the motor connector being flipped over? [Not necessarily your fault as they apparently don't always wire up the motors the right way around in the factory.]

Edit: oh no ... you said it was working and then not working.
That is strange. Because its the Z axis it seems unlikely that both motors with be intermittent due to a wiring problem. Jit's advice of swapping the drivers around to try to isolate the problem is a good one.

Yeah - I'll be trying it out, once I get home. Thanks guys!  :)
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 19, 2013, 10:25:59 PM
If a motor goes one direction for a bit and then backs up a bit, check your endstops.  This is the normal behavior that happens when the carriage hits an endstop.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 19, 2013, 10:35:22 PM
If a motor goes one direction for a bit and then backs up a bit, check your endstops.  This is the normal behavior that happens when the carriage hits an endstop.

Totally. It keeps stopping approx. 8 inches before hitting the endstop though... :) And I already tested them, they're all working.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 20, 2013, 03:26:28 AM
Try this:  Manually move all 3 axes to the middle of their respective ranges.  Don't hit any home buttons during the following.

Remove all driver boards from the Azteeg, then plug the (current) X axis board into the  Z axis socket (maintain correct orientation!).  Unplug all motors, then plug the X axis motor into one of the Z connectors.  Then tell the Z axis to move 10 cm in one direction, then the other direction.  This should cause the X axis to move one direction, then the other.  Does it?

I did as instructed.
Then I pressed Z -1. Nothing.
Then I pressed Z +1. X moved.
Then I pressed Z -1, X moved back again.
Then I pressed Z -1 again. Nothing.

Same behavior I was getting from the Z axis. It only moves in negative after moving in positive - then it stops. As if there's an invisible wall at "0". What can this mean?  :'(
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 20, 2013, 04:00:35 AM
I'm not an expert on the inner workings of the firmware, but it sounds to me like it thinks it's already sitting at the endstop.  (Somebody who knows the firmware better should jump in on this...)

In other words, when you power up the Azteeg, it apparently thinks it's already sitting at zero.  You press Z -1, but it won't go negative, so it sits there.  You press +1, it goes to 1.  You hit -1, it goes back to zero.  You hit -1, it won't go negative so it sits there.  Consistent with what you see.

But why is it convinced it's at zero when you power up?  It's not supposed to believe it's at zero until it hits an endstop.  Is that endstop switch stuck closed?  Or the leads shorted out somehow?
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 20, 2013, 04:16:01 AM
I'm not an expert on the inner workings of the firmware, but it sounds to me like it thinks it's already sitting at the endstop.  (Somebody who knows the firmware better should jump in on this...)

In other words, when you power up the Azteeg, it apparently thinks it's already sitting at zero.  You press Z -1, but it won't go negative, so it sits there.  You press +1, it goes to 1.  You hit -1, it goes back to zero.  You hit -1, it won't go negative so it sits there.  Consistent with what you see.

But why is it convinced it's at zero when you power up?  It's not supposed to believe it's at zero until it hits an endstop.  Is that endstop switch stuck closed?  Or the leads shorted out somehow?

Yeah I think Diego mentioned a firmware bug that could be related to this.

Isn't there a way to just recalibrate the damn machine?
What if I had hit the endstop by accident with something else white it was moving? Would it change the print area numbers in the software and get confused later? That would explain how Z homed to +200, hitting the top aluminum bar and then remaining stubborn and refusing to go down...

Seriously, there isn't any kind of "reset" for these situations?  ??? I guess I'll reflash the firmware or something.

Thanks for your help jit!

PS: I reflashed the firmware, and now Z doesn't move at all again. I'd really like to figure out if this is a hardware-originated problem, but for the time being, it seems purely like software. 
Hard to believe no one else ever had this problem... Anyone? Erratically behaving z axis? Maybe the reprap kit route wasn't such a good idea after all :/


PPS: Any alternative x3 firmwares or code tweaks I should be aware of? Should I try the hammer? Dip the azteeg in hot lava? Dry ice?
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 20, 2013, 07:24:36 AM
If you have an endstop problem, no amount of reflashing or recalibration will do you any good.  The system absolutely depends on having a properly working endstop on each axis.

Refer to this image from the Wires page:  http://bukobot.com/_media/wiki:jitsbuild:wiring-tamed5c.png (http://bukobot.com/_media/wiki:jitsbuild:wiring-tamed5c.png) (this shows the X3)  and also the Azteeg diagram linked here:  http://bukobot.com/bukobot-assembly-documentation (http://bukobot.com/bukobot-assembly-documentation)

In the picture, the endstop connectors are at the upper left.  The connectors are keyed, and should go on in only one orientation.  Each has three pins, but only two are wired.

Power down (and unplug from the wall) and wait for a bit, then pull the Z axis endstop connector up a little, not enough to break the connection with the Azteeg, just enough so that you can reach in with ohmmeter leads and touch the two pins that are wired.  (Check that the wires go to the correct pins!  The cable may have been miswired.)  With your third hand, click the Z axis endstop switch on and off.  The meter should go back and forth between zero and many ohms.  It should be many ohms when the switch is open, and zero when the switch is closed.  (It's supposed to be a normally open switch, but they're using SPDT switches, and the wires might be going to the wrong tabs on the switch, or the switch might be malfunctioning, or might be simply the wrong kind of switch.)

If it passes this test, then we might need more help from somebody who understands the system better.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 20, 2013, 07:36:06 AM
If you have an endstop problem, no amount of reflashing or recalibration will do you any good.  The system absolutely depends on having a properly working endstop on each axis.

Refer to this image from the Wires page:  http://bukobot.com/_media/wiki:jitsbuild:wiring-tamed5c.png (http://bukobot.com/_media/wiki:jitsbuild:wiring-tamed5c.png) (this shows the X3)  and also the Azteeg diagram linked here:  http://bukobot.com/bukobot-assembly-documentation (http://bukobot.com/bukobot-assembly-documentation)

In the picture, the endstop connectors are at the upper left.  The connectors are keyed, and should go on in only one orientation.  Each has three pins, but only two are wired.

Power down (and unplug from the wall) and wait for a bit, then pull the Z axis endstop connector up a little, not enough to break the connection with the Azteeg, just enough so that you can reach in with ohmmeter leads and touch the two pins that are wired.  (Check that the wires go to the correct pins!  The cable may have been miswired.)  With your third hand, click the Z axis endstop switch on and off.  The meter should go back and forth between zero and many ohms.  It should be many ohms when the switch is open, and zero when the switch is closed.  (It's supposed to be a normally open switch, but they're using SPDT switches, and the wires might be going to the wrong tabs on the switch, or the switch might be malfunctioning, or might be simply the wrong kind of switch.)

If it passes this test, then we might need more help from somebody who understands the system better.

Thanks.
Yeah I think I need help then. The endstops seem perfectly fine, I really doubt they're the culprit.
Can't be coincidence that the problem started a few minutes after switching from Duo firmware to Vanilla. I played around with the XYZs in the print panel for a couple minutes, Z went insane and has been since then.

Googling for "3d printer axis not moving" returns nothing helpful. I'm really stuck. Giving up until I bring it to Pasadena again.
Title: Re: Z "Home" bug causing me problems
Post by: whosawhatsis on February 20, 2013, 08:59:35 PM
The machine starts up thinking that it is at 0,0,0, because there's no other logical place to think that it is. It has soft limits that prevent moves other than homing from moving it in the negative direction beyond 0 (this is a safety feature), so when starting the machine you should always home first so that the machine will have the correct coordinate system. If your Z endstop is not functioning properly, that is an issue, but everything else mentioned here sounds like normal behavior.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 20, 2013, 09:02:43 PM
The machine starts up thinking that it is at 0,0,0, because there's no other logical place to think that it is. It has soft limits that prevent moves other than homing from moving it in the negative direction beyond 0 (this is a safety feature), so when starting the machine you should always home first so that the machine will have the correct coordinate system. If your Z endstop is not functioning properly, that is an issue, but everything else mentioned here sounds like normal behavior.

Interesting. So if I manually spin the motors so that Z is all the way down, hitting the end stop, and then start the printer up, the problem should be solved?

Thanks!
Title: Re: Z "Home" bug causing me problems
Post by: whosawhatsis on February 20, 2013, 09:22:57 PM
You still need a properly-functioning endstop. The Z endstop in particular is crucial.

To see if there's an issue with that endstop, you can move the axis up and switch Z endstop with another one. Put one finger on that endstop and the other on the reset button (to prevent the head from crashing if the enstop fails) and tell it to home the Z axis. Press the endstop that is wired to Z and see if it stops. Normal behavior is for it to back off a few mm from the endstop, and then go back toward it more slowly, so you'll want to tap the enstop twice.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 21, 2013, 12:10:43 AM
You still need a properly-functioning endstop. The Z endstop in particular is crucial.

To see if there's an issue with that endstop, you can move the axis up and switch Z endstop with another one. Put one finger on that endstop and the other on the reset button (to prevent the head from crashing if the enstop fails) and tell it to home the Z axis. Press the endstop that is wired to Z and see if it stops. Normal behavior is for it to back off a few mm from the endstop, and then go back toward it more slowly, so you'll want to tap the enstop twice.

OK I'll try and move the axis manually. Thanks!

Despite all the suggestions, I maintain my opinion that the endstops seems perfectly fine - because I switched them last night and the problem remained on the Z axis (only when switching motor and driver board, the problem was transfered to X, which points to it being an Azteeg firmware issue, and not something associated with hardware)...
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 24, 2013, 02:48:00 AM
Yeah, now even X and Y are not responding well in repetier. Sometimes it works, but sometimes I get "X commands waiting" in the host, and it stays there for a while.

It's possible my X3 might just be completely screwed. I have no other explanation for it. Maybe I should try an X1
Title: Re: Z "Home" bug causing me problems
Post by: whosawhatsis on February 24, 2013, 03:53:35 AM
I've seen that happen before, and I'm not entirely sure what caused it, but unplugging it (power and USB) and leaving long enough for all the capacitors to throughly discharge and all of the semiconductors to thoroughly cool cleared up the problem.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 24, 2013, 05:32:01 AM
I've seen that happen before, and I'm not entirely sure what caused it, but unplugging it (power and USB) and leaving long enough for all the capacitors to throughly discharge and all of the semiconductors to thoroughly cool cleared up the problem.

Interesting. It's been like that, for the last couple of days
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 24, 2013, 05:49:44 AM
I've seen that happen before, and I'm not entirely sure what caused it, but unplugging it (power and USB) and leaving long enough for all the capacitors to throughly discharge and all of the semiconductors to thoroughly cool cleared up the problem.

I too have observed weird behavior that disappeared after doing this.  (And if it only happens once, you'll never be sure what was going on...)

At this point, it couldn't hurt to try swapping everything you can think of.  Swapping out the Azteeg is not something you can try in the next five minutes, but how about these things, one at a time:

- try a different USB cable

- try a different computer (with a fresh install of the controller software), or at least try a different USB port on the computer

- try a different power supply for the Arduino electronics (in other words, move the Azteeg jumper that selects 12V vs. USB power)

And presumably you already checked the actual voltage from the 12V power supply, and don't have an undervoltage.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 24, 2013, 06:47:18 AM
I've seen that happen before, and I'm not entirely sure what caused it, but unplugging it (power and USB) and leaving long enough for all the capacitors to throughly discharge and all of the semiconductors to thoroughly cool cleared up the problem.

I too have observed weird behavior that disappeared after doing this.  (And if it only happens once, you'll never be sure what was going on...)

At this point, it couldn't hurt to try swapping everything you can think of.  Swapping out the Azteeg is not something you can try in the next five minutes, but how about these things, one at a time:

- try a different USB cable

- try a different computer (with a fresh install of the controller software), or at least try a different USB port on the computer

- try a different power supply for the Arduino electronics (in other words, move the Azteeg jumper that selects 12V vs. USB power)

And presumably you already checked the actual voltage from the 12V power supply, and don't have an undervoltage.

That's true, should have tried the PC too. I'll do that, thanks.

The arduino came powered by USB. I switched it to input and re-flashed the firmware. No change in behavior. Thanks for that reminder tho, I wanted it always powered by input.
Already bought a new USB cable, no noticeable change.
Measured 12.20 V at the power supply.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 24, 2013, 08:10:07 AM
Found the problem.    ;D

Replaced the stepper driver board from Z with the one in Ext 2 and now both stepper motors are cooperating.
I left Ext 2 slot empty, I only have 1 extruder anyway.

jit, you smartly suggested switching the driver boards - and I think that showed the problem was the board, so I don't know why I didn't think of this before  ::)
Title: Re: Z "Home" bug causing me problems
Post by: Tyson on February 25, 2013, 05:27:56 PM

I also had a bad stepper board, in this case it was my "X".   I also swapped with the 2nd extruder driver since mine is a single to get the system going.   My failure behavior was periodic no response.   It was working, stopped working so I swapped driver board and it worked.  Swapped back to check, and the bad stepper board was working again briefly but stopped soon after.  Swapped back to the extra and it has been fine ever since.

Title: Re: Z "Home" bug causing me problems
Post by: jit on February 25, 2013, 07:15:23 PM
The driver boards that came with the Azteeg X1 and X3 can fail.  That's why the wiki warns about never applying 12V power to the Azteeg when it's got any driver boards on it that don't have motors wired up to them  --  this can damage the driver.  (Not a new problem;  this style of driver board predates the Azteeg line and the Bukobots.)

And this is probably one of the reasons why Roy at Panucatt is making the 1.1 version Azteeg.  It comes with improved driver boards that are described as "more robust" (although the warning about applying voltage without motors wired in still applies).
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 25, 2013, 07:30:01 PM
The driver boards that came with the Azteeg X1 and X3 can fail.  That's why the wiki warns about never applying 12V power to the Azteeg when it's got any driver boards on it that don't have motors wired up to them  --  this can damage the driver.  (Not a new problem;  this style of driver board predates the Azteeg line and the Bukobots.)

And this is probably one of the reasons why Roy at Panucatt is making the 1.1 version Azteeg.  It comes with improved driver boards that are described as "more robust" (although the warning about applying voltage without motors wired in still applies).

Interesting! Also, scary  :o
Title: Re: Z "Home" bug causing me problems
Post by: jit on February 25, 2013, 10:02:30 PM
I think driver board failures on Bukobots are fairly rare (much less than 1% so far I think;  the Deezmaker guys have a better idea about this I'm sure).

These boards are not hard to find.  They are known as pololu boards and various places now make them  --  they are open source hardware.  They typically range from US$10 to $14 apiece.

For a long time they were based on the Allegro A4988 driver chip, but now new ones based on the TI DRV8825 are coming out.  These can handle higher voltages and higher currents, and can provide finer steps.  You can still destroy them if you fail to follow directions.

In some cases the new ones can be used as drop-in replacements for the old ones.  See documentation about this (for example http://www.pololu.com/catalog/product/2133 (http://www.pololu.com/catalog/product/2133), but note that Roy's design may be a bit different).  Not sure how compatibility works with the older Azteeg boards.

Basically, remember the warning about powering up with no motors.  And, take care if you use voltages much higher than 12V, or if you use bigger stepper motors, or if you increase the feed rates, as these things can increase power dissipation on the driver.  Air flow over the drivers will keep them cooler, and sometimes heatsinks might be needed.  But a standard off-the-shelf Bukobot with the recommended settings probably won't have problems with this.
Title: Re: Z "Home" bug causing me problems
Post by: Tyson on February 26, 2013, 03:51:19 AM

Is there a reference for the concern about powering up without a motor attached?
(More than just the warning on the Panucatt datasheet)

I would like to understand more.
Title: Re: Z "Home" bug causing me problems
Post by: whosawhatsis on February 27, 2013, 10:27:54 PM
The boards are usually fine if you power them without a motor attached. The real problem occurs if you plug or unplug a motor while the board is energized. I suppose a short circuit on the unconnected motor header is a risk that could fry the chip, though.

The DRV8825 chips are a bit more robust and better-designed in general, but connecting and disconnecting motors while they are energized is still a bad idea. Roy's DRV8825 drivers are compatible as drop-in replacements for the old ones, except that the default jumper setting gives you twice the microstepping ratio. Pololu's own DRV8825 drivers initially had some incompatibility, which is why their first revision is now on clearance. Their second revision behaves the same way that the Panucatt version does.
Title: Re: Z "Home" bug causing me problems
Post by: NoiseReduction on February 28, 2013, 12:43:40 AM
The boards are usually fine if you power them without a motor attached. The real problem occurs if you plug or unplug a motor while the board is energized. I suppose a short circuit on the unconnected motor header is a risk that could fry the chip, though.

The DRV8825 chips are a bit more robust and better-designed in general, but connecting and disconnecting motors while they are energized is still a bad idea. Roy's DRV8825 drivers are compatible as drop-in replacements for the old ones, except that the default jumper setting gives you twice the microstepping ratio. Pololu's own DRV8825 drivers initially had some incompatibility, which is why their first revision is now on clearance. Their second revision behaves the same way that the Panucatt version does.

That's fascinating - thanks whosa!

Once we adjust to realizing it's an arduino board, that in any other situation of retail product sale would be enclosed to avoid tampering with connections, it all makes sense. Now I'm just not sure if my driver board came messed up, or if I did it at some point while troubleshooting the Z axis issue  :-X

Nevertheless, I'm very happy that my bukobot is working and printing like a champ! (except last night, when I accidentally turned off the USB hub the printer was plugged to, halting the print job :P). Mental note: I wish there was a way for both the firmware and host software to recognize a USB disconnection, pausing the print, lifting the hot end (if possible) to allow cleanup of extruded plastic during pause, and then, once reconnected, allowing for a "resume job". One can dream...
Title: Re: Z "Home" bug causing me problems
Post by: whosawhatsis on January 20, 2014, 04:05:15 AM
Finally found the Z home bug. You can get a copy of the firmware with the just the bugfix here:
https://github.com/whosawhatsis/Marlin/tree/Bukobot_config

If you're feeling a bit more adventurous, you can instead install this updated branch (shipping on new Bukobots as of the beginning of the new year). This will require a bit of rewiring, but it now includes the bugfix as well as some updated features, and on a Bukobot v2, the motor connectors should now all be facing the same direction (smooth side on top). Note that as part of this update, we have switched to considering "Extruder 1" to be the RIGHT extruder (the one that comes with single-extruder models, and the one that is at the corner of the platform when homed). To use this you'll either have to flip your extruder motor connectors to keep your current extruder order or switch the heater, thermistor and motor wires for the two extruders (recommended). The updated Marlin can be downloaded here:
https://github.com/whosawhatsis/Marlin/tree/Bukobot_update