prusa3d / MM-control-01

MMU 3-axis stepper control
GNU General Public License v3.0
92 stars 103 forks source link

MMU Boots without doing anything #50

Open AbeFM opened 6 years ago

AbeFM commented 6 years ago

Rebooting the MMU can cause it to go down the menu - flashing LED5, flashing LED4, then they all light up green for a bit, then just LED1. No movement.

Then nothing mechanical moves, buttons don't do anything except move lights around. I can reboot it over and over, and just get all green lights.

Motors stay cold and quiet.

I'm on the "new" firmware which lets you calibrate bowden tube length per channel. I've had hard to define problems since upgrading to it.

KarlZeilhofer commented 6 years ago

Could it be, that Finda is activated? Is a filament such in the tubes anywhere?

AbeFM commented 6 years ago

I had the selector off, the ball bearing out, and it was still behaving that way?

This time I reboot it maybe 10 times. The first 9 it didn't move any motors (though I suspect the common shaft moved when "loading", but the drum and selector were utterly unpowered.

The 10th time, it came right back.

I tried booting into "secret menu" mode some of those times, I think the final time it was. Anyway, at a certain point (just as I was about the reflash it) it just started behaving again.

Printer: 3.4.1-1356 MMU 1.0.0-106

KarlZeilhofer commented 6 years ago

Today I also had a very strange behaviour, as described in #47. But that with the stock 0.9.0 version.

EDIT: as i moved the selector to the very right by hand, I generated some energy, which temporarily powered the LCD up.

AbeFM commented 6 years ago

I'm clearly not able to explain the behavior well.

https://photos.app.goo.gl/4xMaW47o2RxUFnkNA

And

https://photos.app.goo.gl/2fxoYbG1njg7Qiih7

These are each a short video showing how it behaves. The drum only moves like, when it remembers. The same for the selector. It will move it some, but then stop. Something is BAD WRONG here and I'm more than a little frustrated.

I tried to "unlock" the reset, and reset, and another time I entered the "secret menu" and then exited it. Neither of these worked any better than any combination of resetting printer then MMU then printer then MMU. In the past few days the only thing to work consistently is reset over and over and over and over and over and over and try not to miss it the one time it works. And if it fails during a print, same deal.

I can get more videos if there is something to try. None of the hardware is obviously dead. A button could be always down and I don't know it, but it's hard to tell.

Mk3 Printer: 3.4.1-1356 MMU2.0: 1.0.0-106

AbeFM commented 6 years ago

I've flashed 1.0.1-117 and it only homes maybe a third of the time.

Often if will home like normal, but then the selector will stop arbitrarily, maybe at position 3.5 or so. Everything appears to work except for the random positions of all the motors.

Firmware verified ok on upload, it has homed correctly a couple of times, I was nearly able to get through calibrating all the filament lengths. Resetting the printer makes it more likely to come back, but at this point I just want something with a >20% chance of turning on and working.

AbeFM commented 6 years ago

I guess it's time to dig into the code. The device starts up, homes the selector, doesn't move the drum, then leaves the selector somewhere between the 3rd and in the home (far right) position, and sits there as if it did its entire boot up sequence.

//! RG | RG | RG | RG | RG | meaning //! -- | -- | -- | -- | -- | ------------------------ //! 00 | 00 | 00 | 00 | 0b | Shift register initialized //! 00 | 00 | 00 | 0b | 00 | uart initialized //! 00 | 00 | 0b | 00 | 00 | spi initialized //! 00 | 0b | 00 | 00 | 00 | tmc2130 initialized //! 0b | 00 | 00 | 00 | 00 | A/D converter initialized //! b0 | b0 | b0 | b0 | b0 | Error, filament detected, still present //! 0b | 0b | 0b | 0b | 0b | Error, filament detected, no longer present, continue by right button click //! //! @n R - Red LED //! @n G - Green LED //! @n 1 - active //! @n 0 - inactive //! @n b - blinking

I see the 5th green on then off, then 4th light turn on then off, then all five green lights give one good flash - does that mean it thinks it recovered from seeing the filament sensor?

It could be the pull up on the filament sensor isn't enabled or something, so the first read is off. Pressing a button in the state it finished in seems to try to load filament?

AbeFM commented 6 years ago

I wanted to see if there were any serial port messages to help me debug - the first time I reset the MMU with the serial port plugged in it behaved, and has behaved since.

I've no idea why that is. I didn't even see anything on the serial port. Now even with the cable unplugged, it's working.

AbeFM commented 6 years ago

That was short lived. I thought 4 reboots in a row was a good sign, told it to print something and it hung again - now won't boot up right anymore.

Maybe there's something in my g-code breaking the MMU? I reset the EEPROM (secret menu/option 2/option3) and got all the lights to flash once, I assume to acknowledge the reset.

Still not blinking the 3rd light on startup, still not homing the drum (which is done later in the code).

AbeFM commented 6 years ago

I am trying to debug this...

`int8_t tmc2130_init(uint8_t homing) { led_blink(4);//abe led_blink(1);//abe

DDRC |= 0x40;
DDRD |= 0x80;
DDRB |= 0x80;

led_blink(4);//abe led_blink(2);//abe

PORTC |= 0x40;
PORTD |= 0x80;
PORTB |= 0x80;   

led_blink(4);//abe led_blink(3);//abe

DDRD |= 0x10;
DDRB |= 0x10;
DDRD |= 0x40;
PORTD &= ~0x10;
PORTB &= ~0x10;
PORTD &= ~0x40;

led_blink(4);//abe led_blink(4);//abe

int8_t ret = 0;
ret += tmc2130_init_axis(0, homing)?-1:0;
ret += tmc2130_init_axis(1,homing)?-2:0;
ret += tmc2130_init_axis(2,homing)?-4:0;

led_blink(4);//abe led_blink(5);//abe

return ret;

} ` from tmc2130.c

When I compile, it complains: sketch/tmc2130.c:260: undefined reference to `led_blink'

for every place I added it. I'm trying to be proactive here, but my printer doesn't work at all and I want to make it work again.

AbeFM commented 6 years ago

I'm out of my depth here a bit, this is what I wrote. It complies....

`void Abe_led_blink(int _no) { shr16_set_led(1 << 2 _no); delay(40); shr16_set_led(0x000); delay(20); shr16_set_led(1 << 2 _no); delay(40);

shr16_set_led(0x000); delay(10); } `

I just added that in right above int8_t tmc2130_init(uint8_t homing)

Now when it boots it just goes 5-4-3-2-1 really quickly, all greenflashes, then sits on 1. I feel this is where a programmer - or someone familiar with the code - might be helpful.

AbeFM commented 6 years ago

I can define the function and everything works, but when I use it in the init sequence, it acts as described above.

So it's not helping me to debug, all I can do is break it.

If the developers (or kindly others) would tell me how to watch the serial port, or get meaningful feedback, I would love to help. As it is all I can do it keep posting and I don't feel it is helping anyone without some learned interpretations.

KarlZeilhofer commented 6 years ago

Perhaps there is a bug with the reset/startup sequence with the Trinamic chips...

Do you have some sort of USB to UART adapter? Could also be an Arduino board. When connecting that to the MMU via some jumper wires, you should be able to read debug messages. You could even try to flash a debugging FW onto the printer, then the cabling is fine allready.

AbeFM commented 6 years ago

...I saw references to messages sent on the UART - but my guess is y ou need to do something to turn on the serial over usb - "debug" flag I set before I compile.

Can someone point me the right way on this?

AbeFM commented 6 years ago

I should note I am using the printer firmware: prusa3d_fw_MK3_3_4_1.hex (848,642 bytes) ..which came in prusa3d_fw_3_4_1_mk3.zip

There is also a: prusa3d_fw_MK3_3_4_1.hex (848,642 bytes) ..which came in prusa3d_fw_3_4_1_mk3MMU2.zip

The files are the same size, but given that my machine has been changing speeds, rebooting randomly, sometimes forgetting the MMU is there altogether with the associated menu items gone..... Could I have the wrong file?

Is there a way to test printer-MMU communication?