generated from sirlilpanda/kicad-project-template-actionless
Compare commits
2 Commits
4d334124a7
...
e239240178
| Author | SHA1 | Date | |
|---|---|---|---|
| e239240178 | |||
| 3f4bef7cbf |
@@ -1,7 +1,7 @@
|
||||
(kicad_symbol_lib
|
||||
(version 20241209)
|
||||
(version 20251024)
|
||||
(generator "kicad_symbol_editor")
|
||||
(generator_version "9.0")
|
||||
(generator_version "10.0")
|
||||
(symbol "DOZ50N03"
|
||||
(pin_names
|
||||
(offset 0)
|
||||
@@ -10,8 +10,12 @@
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(in_pos_files yes)
|
||||
(duplicate_pin_numbers_are_jumpers no)
|
||||
(property "Reference" "Q4"
|
||||
(at 6.35 1.2701 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -21,6 +25,8 @@
|
||||
)
|
||||
(property "Value" "DOZ50N03"
|
||||
(at 6.35 -1.2699 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -30,74 +36,90 @@
|
||||
)
|
||||
(property "Footprint" "Package_SON:VSON-8_3.3x3.3mm_P0.65mm_NexFET"
|
||||
(at 5.08 2.54 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Datasheet" "https://www.lcsc.com/datasheet/C36499165.pdf"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Description" "C36499165"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "NOTES" ""
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Part Number" ""
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Supplier PN" ""
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Supplier link" ""
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "ki_keywords" "transistor NMOS N-MOS N-MOSFET"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(symbol "DOZ50N03_0_1"
|
||||
@@ -268,6 +290,62 @@
|
||||
)
|
||||
)
|
||||
(symbol "DOZ50N03_1_1"
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "1"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "2"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "3"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -5.08 0 0)
|
||||
(length 5.08)
|
||||
@@ -289,62 +367,6 @@
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "1"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "2"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "3"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(name "S"
|
||||
(effects
|
||||
(font
|
||||
@@ -367,8 +389,12 @@
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(in_pos_files yes)
|
||||
(duplicate_pin_numbers_are_jumpers no)
|
||||
(property "Reference" "U"
|
||||
(at 13.208 -26.67 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -377,6 +403,8 @@
|
||||
)
|
||||
(property "Value" "TI DRV8701ERGER"
|
||||
(at -10.922 26.924 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -385,31 +413,37 @@
|
||||
)
|
||||
(property "Footprint" "Package_DFN_QFN:VQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias"
|
||||
(at 9.144 -28.956 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(justify left)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Datasheet" "kicad-embed://drv8701.pdf"
|
||||
(at 9.398 -30.734 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(justify left)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "Description" ""
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(hide yes)
|
||||
)
|
||||
)
|
||||
(symbol "DRV8701E_1_1"
|
||||
@@ -424,6 +458,24 @@
|
||||
(type background)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 27.94 270)
|
||||
(length 2.54)
|
||||
(name "VM"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "1"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_out line
|
||||
(at -16.51 22.86 0)
|
||||
(length 2.54)
|
||||
@@ -478,17 +530,35 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_out line
|
||||
(at -16.51 12.7 0)
|
||||
(pin power_in line
|
||||
(at 0 -27.94 90)
|
||||
(length 2.54)
|
||||
(name "DVDD"
|
||||
(name "GND"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "8"
|
||||
(number "5"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 7.62 0)
|
||||
(length 2.54)
|
||||
(name "VREF"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "6"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -514,17 +584,107 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 7.62 0)
|
||||
(pin power_out line
|
||||
(at -16.51 12.7 0)
|
||||
(length 2.54)
|
||||
(name "VREF"
|
||||
(name "DVDD"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "6"
|
||||
(number "8"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin open_collector line
|
||||
(at -16.51 -22.86 0)
|
||||
(length 2.54)
|
||||
(name "nFAULT"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "9"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin open_collector line
|
||||
(at -16.51 -20.32 0)
|
||||
(length 2.54)
|
||||
(name "SNSOUT"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "10"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin output line
|
||||
(at -16.51 -3.81 0)
|
||||
(length 2.54)
|
||||
(name "SO"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "11"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 -12.7 0)
|
||||
(length 2.54)
|
||||
(name "IDRIVE"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "12"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 -10.16 0)
|
||||
(length 2.54)
|
||||
(name "nSLEEP"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "13"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -568,114 +728,6 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin output line
|
||||
(at -16.51 -3.81 0)
|
||||
(length 2.54)
|
||||
(name "SO"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "11"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 -10.16 0)
|
||||
(length 2.54)
|
||||
(name "nSLEEP"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "13"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -16.51 -12.7 0)
|
||||
(length 2.54)
|
||||
(name "IDRIVE"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "12"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin open_collector line
|
||||
(at -16.51 -20.32 0)
|
||||
(length 2.54)
|
||||
(name "SNSOUT"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "10"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin open_collector line
|
||||
(at -16.51 -22.86 0)
|
||||
(length 2.54)
|
||||
(name "nFAULT"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "9"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 27.94 270)
|
||||
(length 2.54)
|
||||
(name "VM"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "1"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 -27.94 90)
|
||||
(length 2.54)
|
||||
@@ -695,43 +747,6 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 -27.94 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "GND"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "25"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 -27.94 90)
|
||||
(length 2.54)
|
||||
(name "GND"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "5"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin output line
|
||||
(at 16.51 17.78 180)
|
||||
(length 2.54)
|
||||
@@ -786,17 +801,17 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin output line
|
||||
(at 16.51 2.54 180)
|
||||
(pin input line
|
||||
(at 16.51 -17.78 180)
|
||||
(length 2.54)
|
||||
(name "GH2"
|
||||
(name "SN"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "24"
|
||||
(number "20"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -805,16 +820,16 @@
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at 16.51 0 180)
|
||||
(at 16.51 -12.7 180)
|
||||
(length 2.54)
|
||||
(name "SH2"
|
||||
(name "SP"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "23"
|
||||
(number "21"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -841,16 +856,16 @@
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at 16.51 -12.7 180)
|
||||
(at 16.51 0 180)
|
||||
(length 2.54)
|
||||
(name "SP"
|
||||
(name "SH2"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "21"
|
||||
(number "23"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
@@ -858,17 +873,36 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at 16.51 -17.78 180)
|
||||
(pin output line
|
||||
(at 16.51 2.54 180)
|
||||
(length 2.54)
|
||||
(name "SN"
|
||||
(name "GH2"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "20"
|
||||
(number "24"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin power_in line
|
||||
(at 0 -27.94 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "GND"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "25"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
|
||||
@@ -1168,7 +1168,7 @@
|
||||
)
|
||||
(symbol "DOZ50N03_1_1"
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(name "D"
|
||||
(effects
|
||||
@@ -1186,7 +1186,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
@@ -1205,7 +1205,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
@@ -1242,7 +1242,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(name "S"
|
||||
(effects
|
||||
|
||||
@@ -660,411 +660,6 @@
|
||||
)
|
||||
(embedded_fonts no)
|
||||
)
|
||||
(symbol "DOZ50N03_1"
|
||||
(pin_names
|
||||
(offset 0)
|
||||
(hide yes)
|
||||
)
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(in_pos_files yes)
|
||||
(duplicate_pin_numbers_are_jumpers no)
|
||||
(property "Reference" "Q18"
|
||||
(at -2.794 1.27 90)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(justify left)
|
||||
)
|
||||
)
|
||||
(property "Value" "DOZ50N03"
|
||||
(at 6.35 -1.2699 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
(justify left)
|
||||
)
|
||||
)
|
||||
(property "Footprint" "Package_SON:VSON-8_3.3x3.3mm_P0.65mm_NexFET"
|
||||
(at 5.08 2.54 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Datasheet" "https://www.lcsc.com/datasheet/C36499165.pdf"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Description" "C36499165"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "NOTES" "NMOS"
|
||||
(at 6.35 0 90)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Part Number" "DOZ50N03"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Supplier PN" "C36499165"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Supplier link" "https://www.lcsc.com/product-detail/C36499165.html?s_z=n_C36499165"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Manufactor Part Number" ""
|
||||
(at 0 0 90)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "Supplier Part Number" ""
|
||||
(at 0 0 90)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(property "ki_keywords" "transistor NMOS N-MOS N-MOSFET"
|
||||
(at 0 0 0)
|
||||
(show_name no)
|
||||
(do_not_autoplace no)
|
||||
(hide yes)
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "DOZ50N03_1_0_1"
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.254 1.905) (xy 0.254 -1.905)
|
||||
)
|
||||
(stroke
|
||||
(width 0.254)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.254 0) (xy -2.54 0)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.762 2.286) (xy 0.762 1.27)
|
||||
)
|
||||
(stroke
|
||||
(width 0.254)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.762 0.508) (xy 0.762 -0.508)
|
||||
)
|
||||
(stroke
|
||||
(width 0.254)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.762 -1.27) (xy 0.762 -2.286)
|
||||
)
|
||||
(stroke
|
||||
(width 0.254)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.762 -1.778) (xy 3.302 -1.778) (xy 3.302 1.778) (xy 0.762 1.778)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 1.016 0) (xy 2.032 0.381) (xy 2.032 -0.381) (xy 1.016 0)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type outline)
|
||||
)
|
||||
)
|
||||
(circle
|
||||
(center 1.651 0)
|
||||
(radius 2.794)
|
||||
(stroke
|
||||
(width 0.254)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 2.54 2.54) (xy 2.54 1.778)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(circle
|
||||
(center 2.54 1.778)
|
||||
(radius 0.254)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type outline)
|
||||
)
|
||||
)
|
||||
(circle
|
||||
(center 2.54 -1.778)
|
||||
(radius 0.254)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type outline)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 2.54 -2.54) (xy 2.54 0) (xy 0.762 0)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 2.921 0.381) (xy 3.683 0.381)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 3.302 0.381) (xy 2.921 -0.254) (xy 3.683 -0.254) (xy 3.302 0.381)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
(type default)
|
||||
)
|
||||
(fill
|
||||
(type none)
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "DOZ50N03_1_1_1"
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "1"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "2"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "3"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin input line
|
||||
(at -5.08 0 0)
|
||||
(length 5.08)
|
||||
(name "G"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "4"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(name "S"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
(number "5"
|
||||
(effects
|
||||
(font
|
||||
(size 1.27 1.27)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(embedded_fonts no)
|
||||
)
|
||||
(symbol "Device:Battery"
|
||||
(pin_numbers
|
||||
(hide yes)
|
||||
@@ -3489,7 +3084,7 @@
|
||||
)
|
||||
(symbol "DOZ50N03_1_1"
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(name "D"
|
||||
(effects
|
||||
@@ -3507,7 +3102,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
@@ -3526,7 +3121,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 5.08 270)
|
||||
(at 2.54 -5.08 90)
|
||||
(length 2.54)
|
||||
(hide yes)
|
||||
(name "D"
|
||||
@@ -3563,7 +3158,7 @@
|
||||
)
|
||||
)
|
||||
(pin passive line
|
||||
(at 2.54 -5.08 90)
|
||||
(at 2.54 5.08 270)
|
||||
(length 2.54)
|
||||
(name "S"
|
||||
(effects
|
||||
@@ -6726,7 +6321,6 @@
|
||||
)
|
||||
)
|
||||
(symbol
|
||||
(lib_name "DOZ50N03_1")
|
||||
(lib_id "esp32-racer-lib:DOZ50N03")
|
||||
(at 134.62 109.22 270)
|
||||
(unit 1)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"board": {
|
||||
"active_layer": 6,
|
||||
"active_layer": 0,
|
||||
"active_layer_preset": "",
|
||||
"auto_track_width": true,
|
||||
"hidden_netclasses": [],
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"other_text_upright": false,
|
||||
"pads": {
|
||||
"drill": 0.0,
|
||||
"height": 0.95,
|
||||
"width": 0.8
|
||||
"height": 0.5,
|
||||
"width": 0.63
|
||||
},
|
||||
"silk_line_width": 0.1,
|
||||
"silk_text_italic": false,
|
||||
@@ -60,12 +60,7 @@
|
||||
"width": 0.0
|
||||
}
|
||||
],
|
||||
"drc_exclusions": [
|
||||
[
|
||||
"courtyards_overlap|39255000|68870000|e06bdfe1-53ae-4fc2-b728-570ca465444f|e2dcf49c-eee1-4d66-a3a4-d1ffe470ec14",
|
||||
"no they dont"
|
||||
]
|
||||
],
|
||||
"drc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
|
||||
22
software/lsm6dso_example/CMakeLists.txt
Normal file
22
software/lsm6dso_example/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# The following lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
set(ENV{IDF_COMPONENT_MANAGER} "0")
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
# add the component directories that we want to use
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"components/"
|
||||
)
|
||||
|
||||
set(
|
||||
COMPONENTS
|
||||
"main esptool_py i2c lsm6dso filters"
|
||||
CACHE STRING
|
||||
"List of components to include"
|
||||
)
|
||||
|
||||
project(lsm6dso_example)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
50
software/lsm6dso_example/README.md
Normal file
50
software/lsm6dso_example/README.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# LSM6DSO Example
|
||||
|
||||
This example demonstrates how to use the espp LSM6DSO 6-axis IMU driver with the
|
||||
ESP-IDF. The example is modeled after the ICM42607 example and shows how to
|
||||
configure the IMU, read accelerometer and gyroscope data, and use orientation
|
||||
filtering (e.g., Madgwick filter).
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
- I2C communication with the LSM6DSO
|
||||
- Configurable accelerometer and gyroscope range and output data rate
|
||||
- Periodic reading of accelerometer, gyroscope, and temperature data
|
||||
- Orientation filtering using Madgwick filter
|
||||
|
||||
## Usage
|
||||
- Configure the I2C pins and address in `sdkconfig` or via Kconfig options
|
||||
- Build and flash the example to your ESP32/ESP-IDF target
|
||||
- The example will print IMU data and orientation to the serial console
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view
|
||||
serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
|
||||
(Replace PORT with the name of the serial port to use.)
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||

|
||||

|
||||
|
||||
## Example Code
|
||||
See `main/lsm6dso_example.cpp` for the full example source code.
|
||||
|
||||
## Configuration
|
||||
- Default I2C address: 0x6A (can be changed in Kconfig or via config struct)
|
||||
- Example I2C pins: SDA = 21, SCL = 22
|
||||
|
||||
## Documentation
|
||||
See the [documentation](https://esp-cpp.github.io/espp/imu/lsm6dso.html) for
|
||||
full API details.
|
||||
2
software/lsm6dso_example/main/CMakeLists.txt
Normal file
2
software/lsm6dso_example/main/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
INCLUDE_DIRS ".")
|
||||
46
software/lsm6dso_example/main/Kconfig.projbuild
Normal file
46
software/lsm6dso_example/main/Kconfig.projbuild
Normal file
@@ -0,0 +1,46 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
choice EXAMPLE_HARDWARE
|
||||
prompt "Hardware"
|
||||
default EXAMPLE_HARDWARE_QTPYPICO
|
||||
help
|
||||
Select the hardware to run this example on.
|
||||
|
||||
config EXAMPLE_HARDWARE_QTPYPICO
|
||||
depends on IDF_TARGET_ESP32
|
||||
bool "Qt Py PICO"
|
||||
|
||||
config EXAMPLE_HARDWARE_QTPYS3
|
||||
depends on IDF_TARGET_ESP32S3
|
||||
bool "Qt Py S3"
|
||||
|
||||
config EXAMPLE_HARDWARE_CUSTOM
|
||||
bool "Custom"
|
||||
endchoice
|
||||
|
||||
config EXAMPLE_I2C_SCL_GPIO
|
||||
int "SCL GPIO Num"
|
||||
range 0 50
|
||||
default 19 if EXAMPLE_HARDWARE_QTPYPICO
|
||||
default 40 if EXAMPLE_HARDWARE_QTPYS3
|
||||
default 19 if EXAMPLE_HARDWARE_CUSTOM
|
||||
help
|
||||
GPIO number for I2C Master clock line.
|
||||
|
||||
config EXAMPLE_I2C_SDA_GPIO
|
||||
int "SDA GPIO Num"
|
||||
range 0 50
|
||||
default 22 if EXAMPLE_HARDWARE_QTPYPICO
|
||||
default 41 if EXAMPLE_HARDWARE_QTPYS3
|
||||
default 22 if EXAMPLE_HARDWARE_CUSTOM
|
||||
help
|
||||
GPIO number for I2C Master data line.
|
||||
|
||||
config EXAMPLE_I2C_CLOCK_SPEED_HZ
|
||||
int "I2C Clock Speed"
|
||||
range 100 1000000
|
||||
default 400000
|
||||
help
|
||||
I2C clock speed in Hz.
|
||||
|
||||
endmenu
|
||||
199
software/lsm6dso_example/main/lsm6dso_example.cpp
Normal file
199
software/lsm6dso_example/main/lsm6dso_example.cpp
Normal file
@@ -0,0 +1,199 @@
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include "i2c.hpp"
|
||||
#include "kalman_filter.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "lsm6dso.hpp"
|
||||
#include "madgwick_filter.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
extern "C" void app_main(void) {
|
||||
espp::Logger logger({.tag = "LSM6DSO Example", .level = espp::Logger::Verbosity::INFO});
|
||||
logger.info("Starting LSM6DSO example!");
|
||||
|
||||
//! [lsm6dso example]
|
||||
using Imu = espp::Lsm6dso<espp::lsm6dso::Interface::I2C>;
|
||||
|
||||
// I2C config (customize as needed)
|
||||
static constexpr auto i2c_port = I2C_NUM_0;
|
||||
static constexpr auto i2c_clock_speed = CONFIG_EXAMPLE_I2C_CLOCK_SPEED_HZ; // Set in sdkconfig
|
||||
static constexpr gpio_num_t i2c_sda = (gpio_num_t)CONFIG_EXAMPLE_I2C_SDA_GPIO; // Set in sdkconfig
|
||||
static constexpr gpio_num_t i2c_scl = (gpio_num_t)CONFIG_EXAMPLE_I2C_SCL_GPIO; // Set in sdkconfig
|
||||
espp::I2c i2c({.port = i2c_port,
|
||||
.sda_io_num = i2c_sda,
|
||||
.scl_io_num = i2c_scl,
|
||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.clk_speed = i2c_clock_speed});
|
||||
|
||||
// make the orientation filter to compute orientation from accel + gyro
|
||||
static constexpr float angle_noise = 0.001f;
|
||||
static constexpr float rate_noise = 0.1f;
|
||||
static espp::KalmanFilter<2> kf;
|
||||
kf.set_process_noise(rate_noise);
|
||||
kf.set_measurement_noise(angle_noise);
|
||||
|
||||
auto kalman_filter_fn = [](float dt, const Imu::Value &accel,
|
||||
const Imu::Value &gyro) -> Imu::Value {
|
||||
// Apply Kalman filter
|
||||
float accelRoll = atan2(accel.y, accel.z);
|
||||
float accelPitch = atan2(-accel.x, sqrt(accel.y * accel.y + accel.z * accel.z));
|
||||
kf.predict({espp::deg_to_rad(gyro.x), espp::deg_to_rad(gyro.y)}, dt);
|
||||
kf.update({accelRoll, accelPitch});
|
||||
float roll, pitch;
|
||||
std::tie(roll, pitch) = kf.get_state();
|
||||
// return the computed orientation
|
||||
Imu::Value orientation{};
|
||||
orientation.roll = roll;
|
||||
orientation.pitch = pitch;
|
||||
orientation.yaw = 0.0f;
|
||||
return orientation;
|
||||
};
|
||||
|
||||
// Madgwick filter for orientation
|
||||
static constexpr float beta = 0.1f;
|
||||
static espp::MadgwickFilter madgwick(beta);
|
||||
auto madgwick_filter_fn = [](float dt, const Imu::Value &accel,
|
||||
const Imu::Value &gyro) -> Imu::Value {
|
||||
madgwick.update(dt, accel.x, accel.y, accel.z, espp::deg_to_rad(gyro.x),
|
||||
espp::deg_to_rad(gyro.y), espp::deg_to_rad(gyro.z));
|
||||
float roll, pitch, yaw;
|
||||
madgwick.get_euler(roll, pitch, yaw);
|
||||
Imu::Value orientation{};
|
||||
orientation.roll = espp::deg_to_rad(roll);
|
||||
orientation.pitch = espp::deg_to_rad(pitch);
|
||||
orientation.yaw = espp::deg_to_rad(yaw);
|
||||
return orientation;
|
||||
};
|
||||
|
||||
// IMU config
|
||||
Imu::Config config{
|
||||
.device_address = Imu::DEFAULT_I2C_ADDRESS,
|
||||
.write = std::bind(&espp::I2c::write, &i2c, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3),
|
||||
.read = std::bind(&espp::I2c::read, &i2c, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3),
|
||||
.imu_config =
|
||||
{
|
||||
.accel_range = Imu::AccelRange::RANGE_2G,
|
||||
.accel_odr = Imu::AccelODR::ODR_416_HZ,
|
||||
.gyro_range = Imu::GyroRange::DPS_2000,
|
||||
.gyro_odr = Imu::GyroODR::ODR_416_HZ,
|
||||
},
|
||||
.orientation_filter = kalman_filter_fn,
|
||||
.auto_init = true,
|
||||
.log_level = espp::Logger::Verbosity::INFO,
|
||||
};
|
||||
|
||||
logger.info("Creating LSM6DSO IMU");
|
||||
Imu imu(config);
|
||||
|
||||
std::error_code ec;
|
||||
|
||||
// set the accel / gyro on-chip filters
|
||||
static constexpr uint8_t accel_filter_bandwidth = 0b001; // ODR / 10
|
||||
static constexpr uint8_t gyro_lpf_bandwidth = 0b001; // ODR / 3
|
||||
static constexpr bool gyro_hpf_enabled = false; // disable high-pass filter on gyro
|
||||
static constexpr auto gyro_hpf_bandwidth = Imu::GyroHPF::HPF_0_26_HZ; // 0.26Hz
|
||||
if (!imu.set_accelerometer_filter(accel_filter_bandwidth, Imu::AccelFilter::LOWPASS, ec)) {
|
||||
logger.error("Failed to set accelerometer filter: {}", ec.message());
|
||||
}
|
||||
// set the gyroscope filter to have lowpass
|
||||
if (!imu.set_gyroscope_filter(gyro_lpf_bandwidth, gyro_hpf_enabled, gyro_hpf_bandwidth, ec)) {
|
||||
logger.error("Failed to set gyroscope filter: {}", ec.message());
|
||||
}
|
||||
|
||||
// make a task to read out the IMU data and print it to console
|
||||
espp::Task imu_task({.callback = [&](std::mutex &m, std::condition_variable &cv) -> bool {
|
||||
static auto start = std::chrono::steady_clock::now();
|
||||
|
||||
auto now = esp_timer_get_time(); // time in microseconds
|
||||
static auto t0 = now;
|
||||
auto t1 = now;
|
||||
float dt = (t1 - t0) / 1'000'000.0f; // convert us to s
|
||||
t0 = t1;
|
||||
|
||||
std::error_code ec;
|
||||
// update the imu data
|
||||
if (!imu.update(dt, ec)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get accel
|
||||
auto accel = imu.get_accelerometer();
|
||||
auto gyro = imu.get_gyroscope();
|
||||
auto temp = imu.get_temperature();
|
||||
auto orientation = imu.get_orientation();
|
||||
auto gravity_vector = imu.get_gravity_vector();
|
||||
|
||||
[[maybe_unused]] auto t2 = esp_timer_get_time(); // time in microseconds
|
||||
|
||||
auto madgwick_orientation = madgwick_filter_fn(dt, accel, gyro);
|
||||
float roll = madgwick_orientation.roll;
|
||||
float pitch = madgwick_orientation.pitch;
|
||||
float yaw = madgwick_orientation.yaw;
|
||||
float vx = sin(pitch);
|
||||
float vy = -cos(pitch) * sin(roll);
|
||||
float vz = -cos(pitch) * cos(roll);
|
||||
|
||||
// print time and raw IMU data
|
||||
std::string text = "";
|
||||
text += fmt::format("{:.3f},", now / 1'000'000.0f);
|
||||
text += fmt::format("{:02.3f},{:02.3f},{:02.3f},", (float)accel.x,
|
||||
(float)accel.y, (float)accel.z);
|
||||
text += fmt::format("{:03.3f},{:03.3f},{:03.3f},", (float)gyro.x,
|
||||
(float)gyro.y, (float)gyro.z);
|
||||
text += fmt::format("{:02.1f},", temp);
|
||||
// print kalman filter outputs
|
||||
text += fmt::format("{:03.3f},{:03.3f},{:03.3f},", (float)orientation.x,
|
||||
(float)orientation.y, (float)orientation.z);
|
||||
text += fmt::format("{:03.3f},{:03.3f},{:03.3f},", (float)gravity_vector.x,
|
||||
(float)gravity_vector.y, (float)gravity_vector.z);
|
||||
// print madgwick filter outputs
|
||||
text += fmt::format("{:03.3f},{:03.3f},{:03.3f},", roll, pitch, yaw);
|
||||
text += fmt::format("{:03.3f},{:03.3f},{:03.3f}", vx, vy, vz);
|
||||
|
||||
fmt::print("{}\n", text);
|
||||
|
||||
// fmt::print("IMU update took {:.3f} ms\n", (t2 - t0) / 1000.0f);
|
||||
|
||||
// sleep first in case we don't get IMU data and need to exit early
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m);
|
||||
cv.wait_until(lock, start + 10ms);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
.task_config = {
|
||||
.name = "IMU",
|
||||
.stack_size_bytes = 6 * 1024,
|
||||
.priority = 10,
|
||||
.core_id = 0,
|
||||
}});
|
||||
|
||||
// print the header for the IMU data (for plotting)
|
||||
fmt::print("% Time (s), "
|
||||
// raw IMU data (accel, gyro, temp)
|
||||
"Accel X (m/s^2), Accel Y (m/s^2), Accel Z (m/s^2), "
|
||||
"Gyro X (rad/s), Gyro Y (rad/s), Gyro Z (rad/s), "
|
||||
"Temp (C), "
|
||||
// kalman filter outputs
|
||||
"Kalman Roll (rad), Kalman Pitch (rad), Kalman Yaw (rad), "
|
||||
"Kalman Gravity X, Kalman Gravity Y, Kalman Gravity Z, "
|
||||
// madgwick filter outputs
|
||||
"Madgwick Roll (rad), Madgwick Pitch (rad), Madgwick Yaw (rad), "
|
||||
"Madgwick Gravity X, Madgwick Gravity Y, Madgwick Gravity Z\n");
|
||||
|
||||
logger.info("Starting IMU task");
|
||||
imu_task.start();
|
||||
|
||||
// loop forever
|
||||
while (true) {
|
||||
std::this_thread::sleep_for(1s);
|
||||
}
|
||||
//! [lsm6dso example]
|
||||
}
|
||||
2081
software/lsm6dso_example/sdkconfig
Normal file
2081
software/lsm6dso_example/sdkconfig
Normal file
File diff suppressed because it is too large
Load Diff
20
software/lsm6dso_example/sdkconfig.defaults
Normal file
20
software/lsm6dso_example/sdkconfig.defaults
Normal file
@@ -0,0 +1,20 @@
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
|
||||
# set compiler optimization level to -O2 (compile for performance)
|
||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||
|
||||
# ESP32-specific
|
||||
#
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
|
||||
|
||||
# Common ESP-related
|
||||
#
|
||||
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384
|
||||
|
||||
# Set esp-timer task stack size to 6KB
|
||||
CONFIG_ESP_TIMER_TASK_STACK_SIZE=6144
|
||||
|
||||
# set the functions into IRAM
|
||||
CONFIG_SPI_MASTER_IN_IRAM=y
|
||||
1948
software/lsm6dso_example/sdkconfig.old
Normal file
1948
software/lsm6dso_example/sdkconfig.old
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user