-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
adxl345.cfg
153 lines (119 loc) · 4.12 KB
/
adxl345.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# █▀ █▄█ █▀▀ █░█ █▀▀ █░█
# ▄█ ░█░ █▄▄ █▀█ ██▄ ▀▄▀
#
# Author: <Anton Sychev> (anton at sychev dot xyz)
# host_display_menu.cfg (c) 2023
# Created: 2023-07-15 02:06:08
# Desc: Accelerometer adxl345
# Git: https://github.com/klich3/klipper---adxl345-skr-mini-e3-v3.0
# Docs:
# - https://www.klipper3d.org/Measuring_Resonances.html
# - https://www.engineersgarage.com/adxl345-accelerometer-raspberry-pi-i2c/
# - https://www.klipper3d.org/Measuring_Resonances.html
# - https://www.youtube.com/watch?v=kg_jYL7ksEc&list=WL&index=108
# - https://www.obico.io/blog/klipper-input-shaping-ender-3/
# - https://os.ratrig.com/assets/files/skr-mini-e3-30-wiring-5ed9982d5a1c62e9f30c37b29a2e5571.svg
# - https://os.ratrig.com/docs/boards/btt/skr-mini-e3-30/
# - connectar todos pero sin vcc y gnd una vez se resetea se vulve a conectar
# 1) command MEASURE_AXES_NOISE Should be somewhere in the range of ~1-100
# 2) TEST_RESONANCES AXIS=X
# 3) TEST_RESONANCES AXIS=Y
# 4) ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
# ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png
#------------------
#i2c
#command for detect device
#sudo i2cdetect -y 1
#/dev/i2c-1
#pins rpi zero 1.1
# 1 - vcc 3v3 | 2 -
# 3 - sda gpio2 | 4 -
# 5 - scl gpio3 | 6 - gnd
#Correct result
# 0 1 2 3 4 5 6 7 8 9 a b c d e f
#00: -- -- -- -- -- -- -- --
#10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --
#60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#70: -- -- -- -- -- -- -- --
#------------------
#RPI zero
#[mcu rpi]
#serial: /tmp/klipper_host_mcu #default
#[adxl345]
#cs_pin: rpi:None
#cs_pin: arduino_nano_adxl:PB2
#----
#arduino
#[mcu arduino_nano_adxl]
#serial: /dev/ttyUSB0
#serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
# Be sure to change serial address below as per output of 'ls /dev/serial/by-id/*'
#----
#I/O Port
# vcc + gnd connect to SPI1 3.3v
# · | · | · | · | ·
# PD0 | PD2 | PD3 | PD4 | PD5
# cs | scl | sda | sd0 | x
# NSS | CLK | MOSI| MISO| x
[adxl345]
cs_pin: PD0
spi_software_miso_pin: PD4
spi_software_sclk_pin: PD2
spi_software_mosi_pin: PD3
# ------
#SPI1 port
#Direct on board
#SRK mini v3.1 spi 1
# 1 - | 2 -
# 3 - NSS | 4 - CLK
# 5 - MOSI | 6 - MISO
# 7 - 3.3v vcc | 8 - GND
#SRK mini v3.1 i/o SPI2
#[adxl345]
#cs_pin: PD9
#spi_bus: spi1
[resonance_tester]
accel_chip: adxl345
#accel_per_hz: 50
min_freq: 5
max_freq: 68
#max_smoothing: 0.25
probe_points: 85,105,2 #125,125,20 # center of yor printer
[gcode_macro ADXL_NOISE]
gcode:
MEASURE_AXES_NOISE
[gcode_macro ADXL_RES_Y]
gcode:
TEST_RESONANCES AXIS=Y
[gcode_macro ADXL_RES_X]
gcode:
TEST_RESONANCES AXIS=X
#------------------
# Some extra variable documentation:
# The SPI enable pin for the sensor. This parameter must be provided.
#spi_speed: 5000000
# The SPI speed (in hz) to use when communicating with the chip.
# The default is 5000000.
#spi_bus:ardu:
#spi_software_sclk_pin:ardu:PB5
#spi_software_mosi_pin:ardu:PB3
#spi_software_miso_pin:ardu:PB4
# See the "common SPI settings" section for a description of the
# above parameters.
#axes_map: x,y,z
# The accelerometer axis for each of the printer's x, y, and z axes.
# This may be useful if the accelerometer is mounted in an
# orientation that does not match the printer orientation. For
# example, one could set this to "y,x,z" to swap the x and y axes.
# It is also possible to negate an axis if the accelerometer
# direction is reversed (eg, "x,z,-y"). The default is "x,y,z".
#rate: 3200
# Output data rate for ADXL345. ADXL345 supports the following data
# rates: 3200, 1600, 800, 400, 200, 100, 50, and 25. Note that it is
# not recommended to change this rate from the default 3200, and
# rates below 800 will considerably affect the quality of resonance
# measurements.