Basic Information:
Printer Model:
MCU / Printerboard:
Host / SBC
klippy.log
logs-20251113-112216.zip (257.6 KB)
Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there
Describe your issue:
…Hi guys, I’m having trouble running TEST_RESONANCES using an MPU6050 connected to a Raspberry Pi 3B with Klipper installed. The MPU6050 is correctly connected and working. When I run the test command:
ACCELEROMETER_QUERY
I get:
accelerometer values (x, y, z): 7493.851196, 5645.527515,
which indicates that the sensor is correctly connected and working. THE PROBLEM is that when I run the test command, for example:
TEST_RESONANCES AXIS=Y, I get the error “MCU ‘rpi’ shutdown: I2C NACK”, but the sensor continues the test. In the MainSail console, I can see that the sensor is still working and continuing the test; the coordinates captured by the sensor are visible.
I checked the klippy.log file and noticed that the problems are related to the synchronization of the stepper movements, according to these lines:
b’stepcompress o=8 i=0 c=17 a=0: Invalid sequence’
b"Error in syncemitter ‘stepper_y’ step generation".
That only means there is a connection issue with the sensor.
Check that the connection is robust and dupons cannot come loose.
(Soldered is generally better, but it is possible to make the pins tighter with tweezers.)
I was successfully running a 1-meter-long I2C line, so for long lines, I2C pull-ups are crucial.
Probably on the ready-to-use modules, there are 10k pull-ups, which are okay, but you can struggle with lines above maybe 30-40 cm.
Also, it can help to decrease I2C speed if possible, but IIRC it can be complicated with the Linux host.
That is mostly it.
Just notice, a correctly configured accelerometer sensor should show something like:
accelerometer values (x, y, z): -296.082377, 229.828649, -9178.553681
So, Z would represent g-force - Wikipedia ~9800 mm/s^2.
Hope that helps.
Hi, I’ve already checked the wiring. Currently, I’m using wires about 15 centimeters long, and they’re soldered. I also connected the sensor to 5V, since I saw in the documentation that the GY-521 models are recommended to be connected to 5V because the regulator significantly reduces the voltage when connected to 3.3V.
DOCUMENTATION:
GY-521 This sensor board has a voltage regulator. When using 3.3V to the VCC, the resulting voltage (after the onboard voltage regulator) might be too low for a good working I2C bus. It is preferable to apply 5V to the VCC pin of the sensor board.
I didn’t mention this, but before connecting it to the Raspberry Pi, I connected it to an RPi Pico, which is connected to the RPi Pi 3B via UART. I use this to control servos and filament sensors. When I tested the sensor on the RPi Pico with the ACCELEROMETER_QUERY command, the sensor worked, displaying:
accelerometer values (x, y, z): 7493.851196, 5645.527515, 4034.229797,
but after homing, it gave the error “Klipper state: Shutdown”. Something strange: before homing, it worked, but after homing, it gave the error.