MCDELTAT / MK4_Accelerometer

Documentation and Designs for Accelerometers on the Prusa MK4 Printer
34 stars 0 forks source link

MK3.5 xbuddy 0.3.7 success report (with workaround) #1

Open m-kozlowski opened 4 months ago

m-kozlowski commented 4 months ago

PA10 (accelCS) pin is used in MK3.5 firmware as print fan tacho in, so I initially thought that the lack of communication was simply due to the CS pin not being mapped. However, it turned out that the MK3.5 has special handling in the PrusaAccelerometer constructor. Connecting the logic analyzer to the cables, still without the accelerometer connected, I observed the correct pin state change after issuing gcode M959. Unfortunately, after connecting the accelerometer (Adafruit), the CS remained high all the time, as if xbuddy could not sink enough current to drive pin low. Perhaps version 0.3.7 includes some change to handle the fan signal on this pin? I didn't bother to disassemble the board to check this, instead I "helped" the pin reach a low state by soldering a 2K2 resistor in the accelerometer between GND and CS. After this modification, the M959 works flawlessly.

JuanPuchol commented 4 months ago

Thank you very much for your solution, I have been testing the same (high) value on CS pin but I didn't know where to put the resistor (and what value) exactly

MCDELTAT commented 4 months ago

@m-kozlowski Thanks for your feedback, extremely helpful as I have a 0.2.7 board. I've added the resistor to my PCB design which I'll be uploading shortly.

thedave42 commented 4 months ago

Has anyone else had success with the 0.3.7 board by adding the 2K2 resistor? I have the MK4 upgrade and it came with the 0.3.7 board. I just tried this out, but issuing the M959 command causes the printer to crash.

I'm using the Adafruit Accelerometer.

Checked the soldering and the pin connections a couple of times with a multimeter. ![Image](https://github.com/MCDELTAT/MK4_Accelerometer/assets/50186003/581c7d23-8af5-41f2-8133-8de5fb683f55)

Octoprint's serial.log file didn't have much:

2024-05-25 15:09:41,612 - Send: M959 X F40.0 G60.0 N10
2024-05-25 15:09:41,620 - Recv: Error:accelerometer communication
2024-05-25 15:09:41,621 - Changing monitoring state from "Operational" to "Error"
2024-05-25 15:09:41,622 - Send: M112
2024-05-25 15:09:41,626 - Send: N2 M112*35
2024-05-25 15:09:41,627 - Send: N3 M104 T0 S0*34
2024-05-25 15:09:41,628 - Send: N4 M140 S0*97
2024-05-25 15:09:41,741 - Changing monitoring state from "Error" to "Offline after error"
2024-05-25 15:09:41,742 - Connection closed, closing down monitor

I don't have an LA to do any additional analysis...

JuanPuchol commented 4 months ago

Hello,

M959 is working on my Enhanced MK4 (xBuddy 0.3.7). I have done a divider circuit (you need two equal resistors serial solder, in my case two 1K resistors) one end goes to GND the other end goes to CS cable pin, and the resistors join goes to CS Adafruit pin). In this way you send 1.53v instead 3.3v. Please try it! Divider circuit

m-kozlowski commented 4 months ago

Or maybe simply get rid of R8 and replace D2 with a jumper? Haven't tried it yet, but if I'm guessing right, CS is currently pulled up on both ends.

https://learn.adafruit.com/assets/28587

niedz., 26 maj 2024 o 08:50 JuanPuchol @.***> napisał(a):

Hello,

M959 is working on my Enhanced MK4. I have done a divider circuit (you need two equal resistors serial soldier, in my case two 1K resistors) one end goes to GND the other end goes to CS cable pin, and the resistors join goes to CS Adafruit pin). In this way you send 1.53v instead 3.3v. Please try it! Divider.circuit.jpg (view on web) https://github.com/MCDELTAT/MK4_Accelerometer/assets/47700064/e2756e03-e225-4bbd-9cbc-67527a5ffe3c

— Reply to this email directly, view it on GitHub https://github.com/MCDELTAT/MK4_Accelerometer/issues/1#issuecomment-2132091983, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQFTDY7BYOJLJS4BBM5VYTZEGAZPAVCNFSM6AAAAABIELCYBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZSGA4TCOJYGM . You are receiving this because you were mentioned.Message ID: @.***>

thedave42 commented 4 months ago

I have done a divider circuit (you need two equal resistors serial soldier, in my case two 1K resistors) one end goes to GND the other end goes to CS cable pin, and the resistors join goes to CS Adafruit pin). In this way you send 1.53v instead 3.3v. Please try it!

@JuanPuchol this worked! Thank you very much!

jimwsmith commented 4 months ago

Hello,

M959 is working on my Enhanced MK4 (xBuddy 0.3.7). I have done a divider circuit (you need two equal resistors serial solder, in my case two 1K resistors) one end goes to GND the other end goes to CS cable pin, and the resistors join goes to CS Adafruit pin). In this way you send 1.53v instead 3.3v. Please try it! Divider circuit

This worked for me too (simple 2K resistor didn't work)