Add files via upload

This commit is contained in:
clehn8ok
2021-06-27 12:28:30 +02:00
committed by GitHub
parent 0ff1f38595
commit da19000b30
5 changed files with 1565 additions and 0 deletions
+208
View File
@@ -0,0 +1,208 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# Connector_Generic_Conn_01x03
#
DEF Connector_Generic_Conn_01x03 J 0 40 Y N 1 F N
F0 "J" 0 200 50 H V C CNN
F1 "Connector_Generic_Conn_01x03" 0 -200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 50 -150 1 1 10 f
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 -200 0 150 R 50 50 1 1 P
X Pin_3 3 -200 -100 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_01x04
#
DEF Connector_Generic_Conn_01x04 J 0 40 Y N 1 F N
F0 "J" 0 200 50 H V C CNN
F1 "Connector_Generic_Conn_01x04" 0 -300 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 50 -250 1 1 10 f
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 -200 0 150 R 50 50 1 1 P
X Pin_3 3 -200 -100 150 R 50 50 1 1 P
X Pin_4 4 -200 -200 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_CP
#
DEF Device_CP C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "Device_CP" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
CP_*
$ENDFPLIST
DRAW
S -90 20 90 40 0 1 0 N
S 90 -20 -90 -40 0 1 0 F
P 2 0 1 0 -70 90 -30 90 N
P 2 0 1 0 -50 110 -50 70 N
X ~ 1 0 150 110 D 50 50 1 1 P
X ~ 2 0 -150 110 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_R
#
DEF Device_R R 0 0 N Y 1 F N
F0 "R" 80 0 50 V V C CNN
F1 "Device_R" 0 0 50 V V C CNN
F2 "" -70 0 50 V I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
R_*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# ESP32_ESP32-DEVKITC-32D
#
DEF ESP32_ESP32-DEVKITC-32D U 0 40 Y Y 1 L N
F0 "U" -601 1026 50 H V L BNN
F1 "ESP32_ESP32-DEVKITC-32D" -601 -1101 50 H V L BNN
F2 "MODULE_ESP32-DEVKITC-32D" 0 0 50 H I L BNN
F3 "" 0 0 50 H I L BNN
F4 "Espressif Systems" 0 0 50 H I L BNN "MANUFACTURER"
F5 "4" 0 0 50 H I L BNN "PARTREV"
DRAW
S -600 -1000 600 1000 0 0 10 f
X 3V3 1 -800 900 200 R 40 40 0 0 W
X IO26 10 -800 0 200 R 40 40 0 0 B
X IO27 11 -800 -100 200 R 40 40 0 0 B
X IO14 12 -800 -200 200 R 40 40 0 0 B
X IO12 13 -800 -300 200 R 40 40 0 0 B
X GND1 14 -800 -400 200 R 40 40 0 0 W
X IO13 15 -800 -500 200 R 40 40 0 0 B
X SD2 16 -800 -600 200 R 40 40 0 0 B
X SD3 17 -800 -700 200 R 40 40 0 0 B
X CMD 18 -800 -800 200 R 40 40 0 0 B
X EXT_5V 19 -800 -900 200 R 40 40 0 0 W
X EN 2 -800 800 200 R 40 40 0 0 I
X GND3 20 800 900 200 L 40 40 0 0 W
X IO23 21 800 800 200 L 40 40 0 0 B
X IO22 22 800 700 200 L 40 40 0 0 B
X TXD0 23 800 600 200 L 40 40 0 0 O
X RXD0 24 800 500 200 L 40 40 0 0 I
X IO21 25 800 400 200 L 40 40 0 0 B
X GND2 26 800 300 200 L 40 40 0 0 W
X IO19 27 800 200 200 L 40 40 0 0 B
X IO18 28 800 100 200 L 40 40 0 0 B
X IO5 29 800 0 200 L 40 40 0 0 B
X SENSOR_VP 3 -800 700 200 R 40 40 0 0 I
X IO17 30 800 -100 200 L 40 40 0 0 B
X IO16 31 800 -200 200 L 40 40 0 0 B
X IO4 32 800 -300 200 L 40 40 0 0 B
X IO0 33 800 -400 200 L 40 40 0 0 B
X IO2 34 800 -500 200 L 40 40 0 0 B
X IO15 35 800 -600 200 L 40 40 0 0 B
X SD1 36 800 -700 200 L 40 40 0 0 B
X SD0 37 800 -800 200 L 40 40 0 0 B
X CLK 38 800 -900 200 L 40 40 0 0 I C
X SENSOR_VN 4 -800 600 200 R 40 40 0 0 I
X IO34 5 -800 500 200 R 40 40 0 0 B
X IO35 6 -800 400 200 R 40 40 0 0 B
X IO32 7 -800 300 200 R 40 40 0 0 B
X IO33 8 -800 200 200 R 40 40 0 0 B
X IO25 9 -800 100 200 R 40 40 0 0 B
ENDDRAW
ENDDEF
#
# power_+12V
#
DEF power_+12V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+12V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +12V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_+5V
#
DEF power_+5V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+5V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +5V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_GND
#
DEF power_GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -250 50 H I C CNN
F1 "power_GND" 0 -150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# tmc2208_TMC2208
#
DEF tmc2208_TMC2208 U 0 40 Y Y 1 F N
F0 "U" -200 -200 50 H V C CNN
F1 "tmc2208_TMC2208" -50 -550 50 H V C CNN
F2 "" -200 -200 50 H I C CNN
F3 "" -200 -200 50 H I C CNN
DRAW
S 300 -600 -350 300 0 1 0 N
X EN 1 -450 200 100 R 50 50 1 1 I
X GND 10 400 100 100 L 50 50 1 1 I
X OA2 11 400 0 100 L 50 50 1 1 I
X OA1 12 400 -100 100 L 50 50 1 1 I
X OB1 13 400 -200 100 L 50 50 1 1 I
X OB2 14 400 -300 100 L 50 50 1 1 I
X VIO 15 400 -400 100 L 50 50 1 1 I
X GND 16 400 -500 100 L 50 50 1 1 I
X MS1 2 -450 100 100 R 50 50 1 1 I
X MS2 3 -450 0 100 R 50 50 1 1 I
X UART 4 -450 -100 100 R 50 50 1 1 I
X PDN 5 -450 -200 100 R 50 50 1 1 I
X CLK 6 -450 -300 100 R 50 50 1 1 I
X STEP 7 -450 -400 100 R 50 50 1 1 I
X DIR 8 -450 -500 100 R 50 50 1 1 I
X VM 9 400 200 100 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
#End Library
+537
View File
@@ -0,0 +1,537 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date ""
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L ESP32:ESP32-DEVKITC-32D U1
U 1 1 609A418F
P 5150 1850
F 0 "U1" H 5150 3017 50 0000 C CNN
F 1 "ESP32-DEVKITC-32D" H 5150 2926 50 0000 C CNN
F 2 "ESP32:MODULE_ESP32-DEVKITC-32D" H 5150 1850 50 0001 L BNN
F 3 "" H 5150 1850 50 0001 L BNN
F 4 "Espressif Systems" H 5150 1850 50 0001 L BNN "MANUFACTURER"
F 5 "4" H 5150 1850 50 0001 L BNN "PARTREV"
1 5150 1850
1 0 0 -1
$EndComp
$Comp
L tmc2208:TMC2208 U4
U 1 1 609B3CFA
P 8600 3400
F 0 "U4" H 8450 2735 50 0000 C CNN
F 1 "TMC2208" H 8450 2826 50 0000 C CNN
F 2 "tmc2208footprint:TMC2208" H 8600 3400 50 0001 C CNN
F 3 "" H 8600 3400 50 0001 C CNN
1 8600 3400
1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x04 J1
U 1 1 609B7F2A
P 10650 1250
F 0 "J1" H 10730 1242 50 0000 L CNN
F 1 "Conn_01x04" H 10730 1151 50 0000 L CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 10650 1250 50 0001 C CNN
F 3 "~" H 10650 1250 50 0001 C CNN
1 10650 1250
1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x04 J2
U 1 1 609BABBD
P 10700 2400
F 0 "J2" H 10780 2392 50 0000 L CNN
F 1 "Conn_01x04" H 10780 2301 50 0000 L CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 10700 2400 50 0001 C CNN
F 3 "~" H 10700 2400 50 0001 C CNN
1 10700 2400
1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x04 J3
U 1 1 609BDA3D
P 10700 3500
F 0 "J3" H 10780 3492 50 0000 L CNN
F 1 "Conn_01x04" H 10780 3401 50 0000 L CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 10700 3500 50 0001 C CNN
F 3 "~" H 10700 3500 50 0001 C CNN
1 10700 3500
1 0 0 -1
$EndComp
Wire Wire Line
10500 3400 9000 3400
Wire Wire Line
10500 3600 9000 3600
Wire Wire Line
7800 950 7800 2100
Wire Wire Line
7800 2100 8150 2100
Wire Wire Line
7800 2100 7800 3200
Wire Wire Line
7800 3200 8150 3200
Connection ~ 7800 2100
Wire Wire Line
7650 2200 8150 2200
Wire Wire Line
7650 2200 7650 3300
Wire Wire Line
7650 3300 8150 3300
Connection ~ 7650 2200
Wire Wire Line
8150 3400 7550 3400
Wire Wire Line
7550 3400 7550 2300
Wire Wire Line
7550 2300 8150 2300
Wire Wire Line
7550 2300 7550 1150
Connection ~ 7550 2300
$Comp
L power:+12V #PWR0101
U 1 1 609C6843
P 9700 600
F 0 "#PWR0101" H 9700 450 50 0001 C CNN
F 1 "+12V" H 9715 773 50 0000 C CNN
F 2 "" H 9700 600 50 0001 C CNN
F 3 "" H 9700 600 50 0001 C CNN
1 9700 600
1 0 0 -1
$EndComp
Wire Wire Line
9300 1050 9300 1650
Wire Wire Line
9300 2200 9000 2200
Wire Wire Line
9300 3300 9300 2800
Connection ~ 9300 2200
Connection ~ 9300 2800
Wire Wire Line
9300 2800 9300 2200
Wire Wire Line
9300 3900 9300 3300
Connection ~ 9300 3300
Connection ~ 9300 1650
Wire Wire Line
9300 1650 9300 2200
$Comp
L Device:CP C100uF1
U 1 1 609CDEF3
P 9550 1050
F 0 "C100uF1" V 9295 1050 50 0000 C CNN
F 1 "CP" V 9386 1050 50 0000 C CNN
F 2 "Capacitor_THT:CP_Radial_D5.0mm_P2.50mm" H 9588 900 50 0001 C CNN
F 3 "~" H 9550 1050 50 0001 C CNN
1 9550 1050
0 1 1 0
$EndComp
$Comp
L Device:CP C100uF2
U 1 1 609D3AA8
P 9550 2200
F 0 "C100uF2" V 9295 2200 50 0000 C CNN
F 1 "CP" V 9386 2200 50 0000 C CNN
F 2 "Capacitor_THT:CP_Radial_D5.0mm_P2.50mm" H 9588 2050 50 0001 C CNN
F 3 "~" H 9550 2200 50 0001 C CNN
1 9550 2200
0 1 1 0
$EndComp
$Comp
L Device:CP C100uF3
U 1 1 609D4D23
P 9550 3300
F 0 "C100uF3" V 9295 3300 50 0000 C CNN
F 1 "CP" V 9386 3300 50 0000 C CNN
F 2 "Capacitor_THT:CP_Radial_D5.0mm_P2.50mm" H 9588 3150 50 0001 C CNN
F 3 "~" H 9550 3300 50 0001 C CNN
1 9550 3300
0 1 1 0
$EndComp
Wire Wire Line
9700 1050 9700 950
Wire Wire Line
9300 2200 9400 2200
Wire Wire Line
9300 3300 9400 3300
Wire Wire Line
9700 3300 9700 3200
Connection ~ 9700 1050
Connection ~ 9700 2200
Connection ~ 9700 950
Wire Wire Line
9700 1050 9700 2100
Connection ~ 9700 2100
Wire Wire Line
9700 2100 9700 2200
Connection ~ 9700 3200
Wire Wire Line
9700 3200 9700 2200
$Comp
L power:GND #PWR0102
U 1 1 609F0A2E
P 9300 4250
F 0 "#PWR0102" H 9300 4000 50 0001 C CNN
F 1 "GND" H 9305 4077 50 0000 C CNN
F 2 "" H 9300 4250 50 0001 C CNN
F 3 "" H 9300 4250 50 0001 C CNN
1 9300 4250
1 0 0 -1
$EndComp
Wire Wire Line
9300 3900 9300 4250
Connection ~ 9300 3900
Wire Wire Line
9150 3800 9150 2700
Wire Wire Line
9150 2700 9150 1550
Connection ~ 9150 2700
$Comp
L power:+5V #PWR0103
U 1 1 609F53EC
P 9150 700
F 0 "#PWR0103" H 9150 550 50 0001 C CNN
F 1 "+5V" H 9165 873 50 0000 C CNN
F 2 "" H 9150 700 50 0001 C CNN
F 3 "" H 9150 700 50 0001 C CNN
1 9150 700
1 0 0 -1
$EndComp
Wire Wire Line
9700 600 9700 950
Wire Wire Line
9150 700 9150 1550
Connection ~ 9150 1550
Wire Wire Line
9400 1050 9300 1050
Connection ~ 9300 1050
$Comp
L power:GND #PWR0104
U 1 1 60A02333
P 6150 950
F 0 "#PWR0104" H 6150 700 50 0001 C CNN
F 1 "GND" H 6155 777 50 0000 C CNN
F 2 "" H 6150 950 50 0001 C CNN
F 3 "" H 6150 950 50 0001 C CNN
1 6150 950
0 -1 -1 0
$EndComp
Wire Wire Line
7450 1550 7450 1050
Wire Wire Line
7450 1050 5950 1050
Wire Wire Line
5950 1150 7350 1150
Wire Wire Line
7350 1150 7350 1650
Wire Wire Line
7250 2700 8150 2700
Wire Wire Line
8150 2800 7150 2800
Wire Wire Line
5950 1450 7050 1450
Wire Wire Line
7050 1450 7050 3800
Wire Wire Line
7050 3800 8150 3800
Wire Wire Line
8150 3900 6950 3900
Wire Wire Line
6950 3900 6950 1650
Wire Wire Line
6950 1650 5950 1650
Wire Wire Line
5950 1750 6850 1750
Wire Wire Line
6850 1750 6850 2100
Wire Wire Line
6850 2100 7800 2100
Wire Wire Line
5950 1850 6750 1850
Wire Wire Line
6750 1850 6750 2200
Wire Wire Line
6750 2200 7650 2200
Wire Wire Line
5950 1950 6650 1950
Wire Wire Line
6650 1950 6650 2300
Wire Wire Line
6650 2300 7550 2300
Wire Wire Line
5950 950 6150 950
$Comp
L power:+5V #PWR0105
U 1 1 60A27EF6
P 4000 3050
F 0 "#PWR0105" H 4000 2900 50 0001 C CNN
F 1 "+5V" H 4015 3223 50 0000 C CNN
F 2 "" H 4000 3050 50 0001 C CNN
F 3 "" H 4000 3050 50 0001 C CNN
1 4000 3050
-1 0 0 1
$EndComp
Wire Wire Line
4350 2750 4000 2750
Wire Wire Line
4000 2750 4000 3050
$Comp
L Connector_Generic:Conn_01x03 SlideHall1
U 1 1 60A42F90
P 1350 950
F 0 "SlideHall1" H 1268 1267 50 0000 C CNN
F 1 "Conn_01x03" H 1268 1176 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical" H 1350 950 50 0001 C CNN
F 3 "~" H 1350 950 50 0001 C CNN
1 1350 950
-1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x03 PanHall1
U 1 1 60A47C14
P 1350 1800
F 0 "PanHall1" H 1268 2117 50 0000 C CNN
F 1 "Conn_01x03" H 1268 2026 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical" H 1350 1800 50 0001 C CNN
F 3 "~" H 1350 1800 50 0001 C CNN
1 1350 1800
-1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x03 TiltHall1
U 1 1 60A4A750
P 1350 2700
F 0 "TiltHall1" H 1268 3017 50 0000 C CNN
F 1 "Conn_01x03" H 1268 2926 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical" H 1350 2700 50 0001 C CNN
F 3 "~" H 1350 2700 50 0001 C CNN
1 1350 2700
-1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR0106
U 1 1 60A5CA10
P 1600 650
F 0 "#PWR0106" H 1600 500 50 0001 C CNN
F 1 "+5V" H 1615 823 50 0000 C CNN
F 2 "" H 1600 650 50 0001 C CNN
F 3 "" H 1600 650 50 0001 C CNN
1 1600 650
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR0107
U 1 1 60A5D4E1
P 1750 3000
F 0 "#PWR0107" H 1750 2750 50 0001 C CNN
F 1 "GND" H 1755 2827 50 0000 C CNN
F 2 "" H 1750 3000 50 0001 C CNN
F 3 "" H 1750 3000 50 0001 C CNN
1 1750 3000
1 0 0 -1
$EndComp
$Comp
L Device:R 10k1
U 1 1 60A967B3
P 2000 850
F 0 "10k1" V 1793 850 50 0000 C CNN
F 1 "R" V 1884 850 50 0000 C CNN
F 2 "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal" V 1930 850 50 0001 C CNN
F 3 "~" H 2000 850 50 0001 C CNN
1 2000 850
0 1 1 0
$EndComp
$Comp
L Device:R 10k2
U 1 1 60A987A9
P 2000 1700
F 0 "10k2" V 1793 1700 50 0000 C CNN
F 1 "R" V 1884 1700 50 0000 C CNN
F 2 "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal" V 1930 1700 50 0001 C CNN
F 3 "~" H 2000 1700 50 0001 C CNN
1 2000 1700
0 1 1 0
$EndComp
$Comp
L Device:R 10k3
U 1 1 60A9B535
P 2000 2600
F 0 "10k3" V 1793 2600 50 0000 C CNN
F 1 "R" V 1884 2600 50 0000 C CNN
F 2 "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal" V 1930 2600 50 0001 C CNN
F 3 "~" H 2000 2600 50 0001 C CNN
1 2000 2600
0 1 1 0
$EndComp
Wire Wire Line
1550 850 1600 850
Wire Wire Line
1600 650 1600 850
Connection ~ 1600 850
Wire Wire Line
1550 1700 1600 1700
Wire Wire Line
1600 2600 1600 1700
Connection ~ 1600 2600
Wire Wire Line
1600 2600 1550 2600
Connection ~ 1600 1700
Wire Wire Line
1600 1700 1600 850
Wire Wire Line
2300 1050 2300 1150
Wire Wire Line
2150 850 2300 850
Wire Wire Line
2300 850 2300 1050
Connection ~ 2300 1050
Wire Wire Line
2300 1900 2300 1700
Wire Wire Line
2400 1350 2400 2600
Wire Wire Line
2150 2600 2400 2600
Connection ~ 2400 2600
Wire Wire Line
2400 2600 2400 2800
Wire Wire Line
2150 1700 2300 1700
Connection ~ 2300 1700
Wire Wire Line
2300 1700 2300 1250
Wire Wire Line
1600 850 1850 850
Wire Wire Line
1550 1050 2300 1050
Wire Wire Line
1600 1700 1850 1700
Wire Wire Line
1550 1900 2300 1900
Wire Wire Line
2300 1150 4350 1150
Wire Wire Line
2300 1250 4350 1250
Wire Wire Line
4350 1350 2400 1350
Wire Wire Line
1600 2600 1850 2600
Wire Wire Line
1550 2800 2400 2800
Wire Wire Line
1550 950 1750 950
Wire Wire Line
1750 950 1750 1800
Wire Wire Line
1550 2700 1750 2700
Connection ~ 1750 2700
Wire Wire Line
1750 2700 1750 3000
Wire Wire Line
1550 1800 1750 1800
Connection ~ 1750 1800
Wire Wire Line
1750 1800 1750 2700
Wire Wire Line
9150 1550 8900 1550
Wire Wire Line
10450 1450 8900 1450
Wire Wire Line
10450 1150 8900 1150
Wire Wire Line
7650 1050 7650 2200
$Comp
L tmc2208:TMC2208 U2
U 1 1 609AFE1E
P 8500 1150
F 0 "U2" H 8350 485 50 0000 C CNN
F 1 "TMC2208" H 8350 576 50 0000 C CNN
F 2 "tmc2208footprint:TMC2208" H 8500 1150 50 0001 C CNN
F 3 "" H 8500 1150 50 0001 C CNN
1 8500 1150
1 0 0 -1
$EndComp
Wire Wire Line
7800 950 8050 950
Wire Wire Line
7650 1050 8050 1050
Wire Wire Line
8900 950 9700 950
Wire Wire Line
8900 1050 9300 1050
Wire Wire Line
8900 1250 10450 1250
Wire Wire Line
8900 1350 10450 1350
Wire Wire Line
8900 1650 9300 1650
Wire Wire Line
7550 1150 8050 1150
Wire Wire Line
7450 1550 8050 1550
Wire Wire Line
7350 1650 8050 1650
Wire Wire Line
9000 2100 9700 2100
Wire Wire Line
9000 3200 9700 3200
Wire Wire Line
9000 3300 9300 3300
Wire Wire Line
9000 3500 10500 3500
Wire Wire Line
9000 3700 10500 3700
Wire Wire Line
9000 3800 9150 3800
Wire Wire Line
9000 3900 9300 3900
Wire Wire Line
9150 2700 9000 2700
Wire Wire Line
9000 2800 9300 2800
Wire Wire Line
10500 2600 9000 2600
Wire Wire Line
9000 2500 10500 2500
Wire Wire Line
10500 2400 9000 2400
Wire Wire Line
10500 2300 9000 2300
$Comp
L tmc2208:TMC2208 U3
U 1 1 609B309C
P 8600 2300
F 0 "U3" H 8450 1635 50 0000 C CNN
F 1 "TMC2208" H 8450 1726 50 0000 C CNN
F 2 "tmc2208footprint:TMC2208" H 8600 2300 50 0001 C CNN
F 3 "" H 8600 2300 50 0001 C CNN
1 8600 2300
1 0 0 -1
$EndComp
Wire Wire Line
7250 2700 7250 2400
Wire Wire Line
7250 2400 6550 2400
Wire Wire Line
6550 2400 6550 2050
Wire Wire Line
6550 2050 5950 2050
Wire Wire Line
5950 2150 6450 2150
Wire Wire Line
6450 2150 6450 2500
Wire Wire Line
6450 2500 7150 2500
Wire Wire Line
7150 2500 7150 2800
$EndSCHEMATC
Binary file not shown.
+820
View File
@@ -0,0 +1,820 @@
#include <Arduino.h>
#include "FastAccelStepper.h"
#include "Ps3Controller.h"
#include "algorithm"
#define PAN_MOTOR_STEP_PIN 23
#define PAN_MOTOR_DIRECTION_PIN 22
#define TILT_MOTOR_STEP_PIN 16
#define TILT_MOTOR_DIRECTION_PIN 4
#define SLIDE_MOTOR_STEP_PIN 21
#define SLIDE_MOTOR_DIRECTION_PIN 19
#define MOTOR_EN_PIN 18
#define MOTOR_MS1_PIN 5
#define MOTOR_MS2_PIN 17
#define PAN_HALL_PIN 36
#define TILT_HALL_PIN 39
#define SLIDE_HALL_PIN 34
#define PAN_MAX_SPEED 2500
#define PAN_MAX_ACCELERATION 8000
#define TILT_MAX_SPEED 1250
#define TILT_MAX_ACCELERATION 8000
#define SLIDE_MAX_SPEED 3500
#define SLIDE_MAX_ACCELERATION 8000
#define KEYFRAME_ARRAY_LENGTH 10
#define SPEEDADJUSTMENTFACTOR 0.483
unsigned long previousMillis = 0;
const long debouncedelay = 100;
float speedfactor=1;
float accelerationfactor=1;
float panspeed_current=0;
float tiltspeed_current=0;
float slidespeed_current=0;
int keyframe_elements = 0;
int current_keyframe_index = -1;
int last_movedto_keyframe_index=-1;
int cntr_moves=0;
int cntr_moves_continous=0;
bool pan_is_moving=true;
bool tilt_is_moving=true;
bool slide_is_moving=true;
long pan_steps_to_move=0;
long tilt_steps_to_move=0;
long slide_steps_to_move=0;
long steps_to_move[3]={0,0,0};
double pan_time_motion_complete=0;
double tilt_time_motion_complete=0;
double slide_time_motion_complete=0;
int pan_speed_motion_complete=0;
int tilt_speed_motion_complete=0;
int slide_speed_motion_complete=0;
bool continous_mode=false;
int delay_continous_mode=0;
struct KeyframeElement {
long panStepCount = 0;
float panSpeed = 0;
long tiltStepCount = 0;
float tiltSpeed = 0;
long sliderStepCount = 0;
float sliderSpeed = 0;
int msDelay = 0;
};
KeyframeElement keyframe_array[KEYFRAME_ARRAY_LENGTH];
FastAccelStepperEngine engine = FastAccelStepperEngine();
FastAccelStepper *pan_stepper = NULL;
FastAccelStepper *tilt_stepper = NULL;
FastAccelStepper *slide_stepper = NULL;
class Stick {
private:
bool _state;
bool _2ndstate;
int _pin;
int _value;
public:
Stick(int pin) : _pin(pin) {}
int ps3stickread(int pin2read)
{
switch(pin2read)
{
case 0:
_value=Ps3.data.analog.stick.lx;
break;
case 1:
_value=Ps3.data.analog.stick.ly;
break;
case 2:
_value=Ps3.data.analog.stick.rx;
break;
case 3:
_value=Ps3.data.analog.stick.ry;
break;
}
if(_value<-1 || _value>1)
{
_2ndstate=true;
}
if(_value==0 || _value==-1 || _value==1)
{
_2ndstate=false;
}
return _2ndstate;
}
void begin()
{
_state = ps3stickread(_pin);
}
bool isPressed()
{
bool v = ps3stickread(_pin);
return v;
/*
bool v = ps3stickread(_pin);
if (v != _state) {
_state = v;
if (_state) {
return true;
}
}
return false;
*/
}
int getValue()
{
return _value;
}
};
class Button {
private:
bool _state;
bool _2ndstate;
int _pin;
int _value;
public:
Button(int pin) : _pin(pin) {}
bool ps3readpin(int pin2read)
{
switch(pin2read)
{
case 0:
_value=Ps3.data.analog.button.up;
break;
case 1:
_value=Ps3.data.analog.button.down;
break;
case 2:
_value=Ps3.data.analog.button.left;
break;
case 3:
_value=Ps3.data.analog.button.right;
break;
case 4:
_value=Ps3.data.analog.button.cross;
break;
case 5:
_value=Ps3.data.analog.button.square;
break;
case 6:
_value=Ps3.data.analog.button.triangle;
break;
case 7:
_value=Ps3.data.analog.button.circle;
break;
case 8:
_value=Ps3.data.analog.button.l1;
break;
case 9:
_value=Ps3.data.analog.button.r1;
break;
case 10:
_value=Ps3.data.button.l3;
break;
case 11:
_value=Ps3.data.button.r3;
break;
case 12:
_value=Ps3.data.button.select;
break;
case 13:
_value=Ps3.data.button.start;
break;
case 14:
_value=Ps3.data.button.l2;
break;
case 15:
_value=Ps3.data.button.r2;
break;
}
if(_value!=0)
{
_2ndstate=true;
}
if(_value==0)
{
_2ndstate=false;
}
return _2ndstate;
}
void begin()
{
_state = ps3readpin(_pin);
}
bool isReleased()
{
bool v = ps3readpin(_pin);
if (v != _state) {
_state = v;
if (_state) {
return true;
}
}
return false;
}
};
Button button_dPadUP(0);
Button button_dPadDOWN(1);
Button button_dPadLEFT(2);
Button button_dPadRIGHT(3);
Button button_CROSS(4);
Button button_SQUARE(5);
Button button_TRIANGLE(6);
Button button_CIRCLE(7);
Button button_L1(8);
Button button_R1(9);
Button button_L3(10);
Button button_R3(11);
Button button_SELCET(12);
Button button_START(13);
Button button_L2(14);
Button button_R2(15);
Stick stick_LX(0);
Stick stick_LY(1);
Stick stick_RX(2);
Stick stick_RY(3);
void onConnect()
{
Serial.println("Connected.");
}
int add_Position(void) {
if (keyframe_elements >= 0 && keyframe_elements < KEYFRAME_ARRAY_LENGTH) {
keyframe_array[keyframe_elements].panStepCount = pan_stepper->getCurrentPosition();
keyframe_array[keyframe_elements].tiltStepCount = tilt_stepper->getCurrentPosition();
keyframe_array[keyframe_elements].sliderStepCount = slide_stepper->getCurrentPosition();
keyframe_array[keyframe_elements].panSpeed = PAN_MAX_SPEED;
keyframe_array[keyframe_elements].tiltSpeed = TILT_MAX_SPEED;
keyframe_array[keyframe_elements].sliderSpeed = SLIDE_MAX_SPEED;
keyframe_array[keyframe_elements].msDelay = 0;
Serial.print("Pan: ");
Serial.println(keyframe_array[keyframe_elements].panStepCount);
Serial.print("Tilt: ");
Serial.println(keyframe_array[keyframe_elements].tiltStepCount);
Serial.print("Slide: ");
Serial.println(keyframe_array[keyframe_elements].sliderStepCount);
current_keyframe_index = keyframe_elements;
keyframe_elements++;
Serial.print("Added at index: ");
Serial.println(current_keyframe_index);
return 0;
}
else {
Serial.println("Max number of keyframes reached");
}
return -1;
}
void set_Speed(char _pts)
{
switch(_pts)
{
case 'p':
{
pan_time_motion_complete=double(steps_to_move[2])/double(PAN_MAX_SPEED);
Serial.print("time to complete pan movement: ");
Serial.println(pan_time_motion_complete,5);
pan_speed_motion_complete=PAN_MAX_SPEED;
tilt_speed_motion_complete=abs(tilt_steps_to_move)/pan_time_motion_complete;
Serial.print("tilt steps to move: ");
Serial.println(tilt_steps_to_move);
Serial.print("tilt speed according to pan: ");
Serial.println(tilt_speed_motion_complete);
slide_speed_motion_complete=abs(slide_steps_to_move)/pan_time_motion_complete;
Serial.print("slide steps to move: ");
Serial.println(slide_steps_to_move);
Serial.print("slide speed according to pan: ");
Serial.println(slide_speed_motion_complete);
break;
}
case 't':
{
tilt_time_motion_complete=double(steps_to_move[2])/double(TILT_MAX_SPEED);
Serial.print("time to complete tilt movement: ");
Serial.println(tilt_time_motion_complete,5);
tilt_speed_motion_complete=TILT_MAX_SPEED;
pan_speed_motion_complete=abs(pan_steps_to_move)/tilt_time_motion_complete;
Serial.print("pan steps to move: ");
Serial.println(pan_steps_to_move);
Serial.print("pan speed according to tilt: ");
Serial.println(pan_speed_motion_complete);
slide_speed_motion_complete=abs(slide_steps_to_move)/tilt_time_motion_complete;
Serial.print("slide steps to move: ");
Serial.println(slide_steps_to_move);
Serial.print("slide speed according to tilt: ");
Serial.println(slide_speed_motion_complete);
break;
}
case 's':
{
slide_time_motion_complete=double(steps_to_move[2])/double(SLIDE_MAX_SPEED);
Serial.print("time to complete slide movement: ");
Serial.println(slide_time_motion_complete,5);
slide_speed_motion_complete=SLIDE_MAX_SPEED;
pan_speed_motion_complete=abs(pan_steps_to_move)/slide_time_motion_complete;
Serial.print("pan steps to move: ");
Serial.println(pan_steps_to_move);
Serial.print("pan speed according to slide: ");
Serial.println(pan_speed_motion_complete);
tilt_speed_motion_complete=abs(tilt_steps_to_move)/slide_time_motion_complete;
Serial.print("tilt steps to move: ");
Serial.println(tilt_steps_to_move);
Serial.print("tilt speed according to slide: ");
Serial.println(tilt_speed_motion_complete);
break;
}
}
}
void move_toPosition(int index)
{
using namespace std;
if(index >= 0 && index<KEYFRAME_ARRAY_LENGTH)
{
pan_steps_to_move=pan_stepper->getCurrentPosition()-keyframe_array[index].panStepCount;
tilt_steps_to_move=tilt_stepper->getCurrentPosition()-keyframe_array[index].tiltStepCount;
slide_steps_to_move=slide_stepper->getCurrentPosition()-keyframe_array[index].sliderStepCount;
steps_to_move[0]=abs(pan_steps_to_move);
steps_to_move[1]=abs(tilt_steps_to_move);
steps_to_move[2]=abs(slide_steps_to_move);
sort(steps_to_move,steps_to_move+3);
if(steps_to_move[2]==abs(pan_steps_to_move))
{
Serial.println("most steps 2 move on pan axis");
set_Speed('p');
}
if(steps_to_move[2]==abs(tilt_steps_to_move))
{
Serial.println("most steps 2 move on tilt axis");
set_Speed('t');
}
if(steps_to_move[2]==abs(slide_steps_to_move))
{
Serial.println("most steps 2 move on slide axis");
set_Speed('s');
}
Serial.println(pan_speed_motion_complete*speedfactor);
Serial.println(tilt_speed_motion_complete*speedfactor);
Serial.println(slide_speed_motion_complete*speedfactor);
pan_stepper->setSpeedInHz(pan_speed_motion_complete*speedfactor);
tilt_stepper->setSpeedInHz(tilt_speed_motion_complete*speedfactor);
slide_stepper->setSpeedInHz(slide_speed_motion_complete*speedfactor);
pan_stepper->moveTo(keyframe_array[index].panStepCount);
tilt_stepper->moveTo(keyframe_array[index].tiltStepCount);
slide_stepper->moveTo(keyframe_array[index].sliderStepCount);
Serial.print("moving to target index:");
Serial.println(index);
current_keyframe_index = index;
}
else
{
Serial.println("cant move to invalid index");
}
}
void clearKeyframes(void)
{
keyframe_elements = 0;
current_keyframe_index = -1;
last_movedto_keyframe_index=-1;
Serial.println("Keyframes cleared");
}
void setup()
{
Serial.begin(112500);
button_dPadUP.begin();
button_dPadDOWN.begin();
button_dPadLEFT.begin();
button_dPadRIGHT.begin();
button_CROSS.begin();
button_SQUARE.begin();
button_TRIANGLE.begin();
button_CIRCLE.begin();
button_L1.begin();
button_R1.begin();
button_L3.begin();
button_R3.begin();
button_SELCET.begin();
button_START.begin();
button_L2.begin();
button_R2.begin();
stick_LX.begin();
stick_LY.begin();
stick_RX.begin();
stick_RY.begin();
Ps3.attachOnConnect(onConnect);
Ps3.begin("20:c9:d0:d5:92:3c");
Serial.println("Ready.");
engine.init();
pan_stepper = engine.stepperConnectToPin(PAN_MOTOR_STEP_PIN);
tilt_stepper = engine.stepperConnectToPin(TILT_MOTOR_STEP_PIN);
slide_stepper = engine.stepperConnectToPin(SLIDE_MOTOR_STEP_PIN);
if (pan_stepper)
{
pan_stepper->setDirectionPin(PAN_MOTOR_DIRECTION_PIN);
pan_stepper->setEnablePin(MOTOR_EN_PIN);
pan_stepper->setAutoEnable(true);
pan_stepper->setSpeedInHz(PAN_MAX_SPEED); // 500 steps/s
pan_stepper->setAcceleration(PAN_MAX_ACCELERATION); // 100 steps/s²
}
if (tilt_stepper)
{
tilt_stepper->setDirectionPin(TILT_MOTOR_DIRECTION_PIN);
tilt_stepper->setEnablePin(MOTOR_EN_PIN);
tilt_stepper->setAutoEnable(true);
tilt_stepper->setSpeedInHz(TILT_MAX_SPEED); // 500 steps/s
tilt_stepper->setAcceleration(TILT_MAX_ACCELERATION); // 100 steps/s²
}
if (slide_stepper)
{
slide_stepper->setDirectionPin(SLIDE_MOTOR_DIRECTION_PIN);
slide_stepper->setEnablePin(MOTOR_EN_PIN);
slide_stepper->setAutoEnable(true);
slide_stepper->setSpeedInHz(SLIDE_MAX_SPEED); // 500 steps/s
slide_stepper->setAcceleration(SLIDE_MAX_ACCELERATION); // 100 steps/s²
}
}
void loop()
{
// only runs code, if the controller is connected, otherwise everything stops
if(Ps3.isConnected())
{
if(continous_mode)
{
if(!(pan_stepper->isRunning()) && !(tilt_stepper->isRunning()) && !(slide_stepper->isRunning()) && keyframe_elements>1 )
{
delay(delay_continous_mode);
move_toPosition(cntr_moves_continous);
if(keyframe_elements>cntr_moves_continous+1)
{
cntr_moves_continous++;
}
else
{
cntr_moves_continous=0;
}
}
}
//debouncing of PS3 input
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= debouncedelay)
{
previousMillis = currentMillis;
//DPAD
if(button_dPadUP.isReleased())
{
Serial.println("pressed button_dPadUP");
if(delay_continous_mode<1000)
{
delay_continous_mode=delay_continous_mode+100;
}
Serial.print("increased delay to");
Serial.println(delay_continous_mode);
}
if(button_dPadDOWN.isReleased())
{
Serial.println("pressed button_dPadDOWN");
if(delay_continous_mode>=100)
{
delay_continous_mode=delay_continous_mode-100;
}
Serial.print("decreased delay to");
Serial.println(delay_continous_mode);
}
if(button_dPadLEFT.isReleased())
{
Serial.println("pressed button_dPadLEFT");
}
if(button_dPadRIGHT.isReleased())
{
Serial.println("pressed button_dPadRIGHT");
}
//Buttons
if(button_CROSS.isReleased())
{
Serial.println("pressed button_CROSS");
if(keyframe_elements!=0)
{
last_movedto_keyframe_index=cntr_moves;
move_toPosition(last_movedto_keyframe_index);
if(keyframe_elements>last_movedto_keyframe_index+1)
{
cntr_moves++;
}
else
{
cntr_moves=0;
}
}
}
if(button_SQUARE.isReleased())
{
Serial.println("pressed button_SQUARE");
add_Position();
last_movedto_keyframe_index=current_keyframe_index;
}
if(button_TRIANGLE.isReleased())
{
Serial.println("pressed button_TRIANGLE");
continous_mode=true;
}
if(button_CIRCLE.isReleased())
{
continous_mode=false;
pan_stepper->stopMove();
tilt_stepper->stopMove();
slide_stepper->stopMove();
Serial.println("pressed button_CIRCLE");
}
//shoulder Buttons
if(button_L1.isReleased())
{
Serial.println("pressed button_L1");
if(speedfactor>0.000691)
{
speedfactor=speedfactor*SPEEDADJUSTMENTFACTOR;
}
Serial.println(speedfactor,5);
/*
pan_stepper->setSpeedInMilliHz(pan_stepper->getSpeedInMilliHz()*speedfactor);
tilt_stepper->setSpeedInMilliHz(tilt_stepper->getSpeedInMilliHz()*speedfactor);
slide_stepper->setSpeedInMilliHz(slide_stepper->getSpeedInMilliHz()*speedfactor);
*/
}
if(button_R1.isReleased())
{
Serial.println("pressed button_R1");
if(speedfactor<1)
{
speedfactor=speedfactor/SPEEDADJUSTMENTFACTOR;
}
Serial.println(speedfactor,5);
/*
pan_stepper->setSpeedInMilliHz(pan_stepper->getSpeedInMilliHz()*speedfactor);
tilt_stepper->setSpeedInMilliHz(tilt_stepper->getSpeedInMilliHz()*speedfactor);
slide_stepper->setSpeedInMilliHz(slide_stepper->getSpeedInMilliHz()*speedfactor);
*/
}
if(button_L2.isReleased())
{
Serial.println("pressed stick_L2");
if(accelerationfactor>0.001)
{
accelerationfactor=accelerationfactor*0.5;
}
Serial.println(accelerationfactor);
pan_stepper->setAcceleration(PAN_MAX_ACCELERATION*accelerationfactor);
tilt_stepper->setAcceleration(TILT_MAX_ACCELERATION*accelerationfactor);
slide_stepper->setAcceleration(SLIDE_MAX_ACCELERATION*accelerationfactor);
}
if(button_R2.isReleased())
{
Serial.println("pressed stick_R2");
if(accelerationfactor<1)
{
accelerationfactor=accelerationfactor/0.5;
}
Serial.println(accelerationfactor);
pan_stepper->setAcceleration(PAN_MAX_ACCELERATION*accelerationfactor);
tilt_stepper->setAcceleration(TILT_MAX_ACCELERATION*accelerationfactor);
slide_stepper->setAcceleration(SLIDE_MAX_ACCELERATION*accelerationfactor);
}
if(button_L3.isReleased())
{
Serial.println("pressed button_L3");
}
if(button_R3.isReleased())
{
Serial.println("pressed button_R3");
clearKeyframes();
//Serial.println(slide_stepper->getCurrentPosition());
}
//start select
if(button_SELCET.isReleased())
{
Serial.println("pressed button_SELCET");
}
if(button_START.isReleased())
{
Serial.println("pressed button_START");
}
//////////////////////////////////////////////////////////
//STICK INPUT
if(stick_LX.isPressed())
{
pan_is_moving=true;
panspeed_current=speedfactor*PAN_MAX_SPEED*float(0.0078125)*abs(stick_LX.getValue());
Serial.println("pressed stick_LX");
Serial.println(stick_LX.getValue());
pan_stepper->setSpeedInHz(panspeed_current);
Serial.println("maxspeed:");
Serial.println(panspeed_current);
if(stick_LX.getValue()>1)
{
pan_stepper->runForward();
}
else
{
pan_stepper->runBackward();
}
}
else
{
if(pan_is_moving)
{
pan_stepper->stopMove();
//pan_stepper->setSpeedInHz(0);
pan_stepper->setDelayToDisable(65535);
pan_is_moving=false;
}
}
if(stick_LY.isPressed())
{
tilt_is_moving=true;
tiltspeed_current=speedfactor*TILT_MAX_SPEED*float(0.0078125)*abs(stick_LY.getValue());
Serial.println("pressed stick_LY");
Serial.println(stick_LY.getValue());
tilt_stepper->setSpeedInHz(tiltspeed_current);
Serial.println("maxspeed:");
Serial.println(tiltspeed_current);
if(stick_LY.getValue()>1)
{
tilt_stepper->runForward();
}
else
{
tilt_stepper->runBackward();
}
}
else
{
if(tilt_is_moving)
{
tilt_stepper->stopMove();
tilt_stepper->setDelayToDisable(65535);
//tilt_stepper->setSpeedInHz(0);
tilt_is_moving=false;
}
}
if(stick_RX.isPressed())
{
slide_is_moving=true;
slidespeed_current=speedfactor*SLIDE_MAX_SPEED*float(0.0078125)*abs(stick_RX.getValue());
Serial.println("pressed stick_RX");
Serial.println(stick_RX.getValue());
slide_stepper->setSpeedInHz(slidespeed_current);
Serial.println("maxspeed:");
Serial.println(slidespeed_current);
if(stick_RX.getValue()>1)
{
slide_stepper->runBackward();
}
else
{
slide_stepper->runForward();
}
}
else
{
if(slide_is_moving)
{
slide_stepper->stopMove();
//slide_stepper->setSpeedInHz(0);
slide_stepper->setDelayToDisable(65535);
slide_is_moving=false;
}
}
if(stick_RY.isPressed())
{
Serial.println("pressed stick_RY");
Serial.println(stick_RY.getValue());
}
}
}
else
{
pan_stepper->stopMove();
tilt_stepper->stopMove();
slide_stepper->stopMove();
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB