Update Docs; Add 3D-Models for flash and Motor driver; Update Readme; Check program code for exceeding size in CMakeLists.txt; Moved measure() function to core1.c/core1.h; Added direction enum typedef; Update Control Loop Block Diagram;

This commit is contained in:
gab-k committed 2024-12-25 21:47:52 +01:00
1 parent 7d2c80574a
commit acdbf3cffe
25 files changed
+1195 -632

No files matched your search

@@ -1,8 +1,9 @@
Overview
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Block_Diagram_Hardware.svg
:alt: Block Diagram
:align: center
Harware block diagram
@@ -22,7 +23,7 @@ The above block diagram gives a general overview regarding the operation of comp
- Crystal oscillator
Electrical Characteristics
====================
==============================
.. table:: Electrical Characteristics & Absolute Maximum Ratings
:widths: auto
@@ -46,10 +47,11 @@ Electrical Characteristics
(2): According to: `T2N7002BK Datasheet <https://toshiba.semicon-storage.com/info/T2N7002BK_datasheet_en_20191025.pdf?did=30376&prodName=T2N7002BK>`_
Input Stage
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Input_Stage.svg
:alt: Input Stage
:align: center
Input stage
@@ -58,20 +60,22 @@ D1 Rectifies the DCC square-wave into +V, the amplitude is not critical as long
The MOSFET on the right effectively translates the rather high DCC voltage to a suitable level for the microcontroller to process. When Q1 is turned off GPIO21 is pulled high by the RP2040 internal pull-up resistor, as soon as Q1 gets turned on (V\ :sub:`GS`\ > V\ :sub:`GS,th`\), GPIO21 gets pulled to GND potential. R1 and R2 ensure that V\ :sub:`GS`\ doesn't exceed ±20V.
Motor Driver
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Motor_Driver.svg
:alt: Motor Driver
:align: center
Motor driver
The Motor Driver is a special H-Bridge IC that is made for DC motors. To control the motor, it is necessary to measure the back-EMF voltage, which is directly related to the motor's speed. This is done by the ADC, which measures at Points ADC_EMF_A and ADC_EMF_B. The two resistors work together as a voltage divider.
Auxiliary Outputs
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Aux_Outputs.svg
:alt: Auxiliary Outputs
:align: center
Auxiliary Outputs
@@ -79,31 +83,33 @@ Switching of loads can be done using four N-Channel MOSFETs (Q2 to Q5). The amou
GPIO
====================
==============================
To switch lighter loads, six GPIO soldering pads are connected to GPIO0 to GPIO5 pins. Although not yet set up in the software, they could be used as inputs as well (e.g. reed switch). GPIO0 and GPIO1 can also be used to facilitate stdio logging via UART, which can easily be set up in CMakeLists.txt.
Microcontroller
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Microcontroller.svg
:alt: Microcontroller
:align: center
Microcontroller, flash memory, crystal oscillator, ...
The Microcontroller needs a crystal oscillator for its clock. External flash memory holds the configuration variables and the program itself. R3 & C14 are used to filter ADC_AVDD (ADC Reference Voltage).
Complete Schematic
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/RP2040-Decoder.svg
:alt: Complete Schematic
:align: center
Complete Schematic
BOM & Alternative Parts
====================
==============================
.. table:: BOM
:widths: auto
@@ -142,14 +148,16 @@ Alternative for HT7533S:
.. _wiring_rev_0_3:
Wiring the Decoder
====================
==============================
.. figure:: ../../../../svg/hw/rev_0_3/Wiring_diagram.svg
:width: 700
:alt: Wiring Diagram
:align: center
:width: 700
:alt: Wiring Diagram
Wiring Diagram
Wiring Diagram
The illustration above provides an example of a wiring configuration.
It supports the connection of up to 4 transistor-switched outputs and 6 GPIOs for lighter loads or custom applications.
@@ -1,7 +1,8 @@
Overview
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Block_Diagram_Hardware.svg
:align: center
:alt: Block Diagram
Harware block diagram
@@ -23,7 +24,7 @@ The above block diagram gives a general overview regarding the operation of comp
- USB Connector
Electrical Characteristics
====================
==============================
.. table:: Electrical Characteristics & Absolute Maximum Ratings
:widths: auto
@@ -49,9 +50,10 @@ Electrical Characteristics
(3): T\ :sub:`Case`\ = 25°C, keep power dissipation, thermal resistance the corresponding temperature rise ΔT and switching losses in PWM mode in mind!
Input Stage
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Input_Stage.svg
:align: center
:alt: Input Stage
Input stage
@@ -60,9 +62,10 @@ D2 Rectifies the DCC square-wave into VDC, the amplitude is not critical as long
The MOSFET on the right effectively translates the rather high DCC voltage to a suitable level for the microcontroller to process. When Q1 is turned off GPIO21 is pulled high by the RP2040 internal pull-up resistor, as soon as Q1 gets turned on (V\ :sub:`GS`\ > V\ :sub:`GS,th`\), GPIO21 gets pulled to GND potential. R1 and R2 ensure that V\ :sub:`GS`\ doesn't exceed ±12V.
Motor Driver
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Motor_Driver.svg
:align: center
:alt: Motor Driver
Motor driver
@@ -70,9 +73,10 @@ Motor Driver
The Motor Driver is a special H-Bridge IC that is made for DC motors. To control the motor, it is necessary to measure the back-EMF voltage, which is directly related to the motor's speed. This is done by the ADC, which measures at Points ADC_EMF_A and ADC_EMF_B. The two resistors work together as a voltage divider.
Auxiliary Outputs
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Aux_Outputs.svg
:align: center
:alt: Auxiliary Outputs
Auxiliary Outputs
@@ -80,14 +84,15 @@ Auxiliary Outputs
Switching of loads can be done using four N-Channel MOSFETs (Q2 to Q5). The amount of current is somewhat dependend on either static R\ :sub:`DS(on)`\ losses and/or switching losses using PWM. They are switching on the low-side, which means the load effectively gets connected to GND potential as the transistor starts to conduct. GPIO24 - GPIO27 are used.
GPIO
====================
==============================
To switch lighter loads, six GPIO soldering pads are connected to GPIO0 to GPIO5 pins. Although not yet set up in the software, they could be used as inputs as well (e.g. reed switch). GPIO0 and GPIO1 can also be used to facilitate stdio logging via UART, which can easily be set up in CMakeLists.txt.
Microcontroller
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Microcontroller.svg
:align: center
:alt: Microcontroller
Microcontroller, flash memory, crystal oscillator, USB connector, ...
@@ -95,15 +100,16 @@ Microcontroller
The Microcontroller needs a crystal oscillator for its clock. External flash memory holds the configuration variables and the program itself. The USB connector can be used to flash the software onto the decoder and also for logging via stdio (can be enabled via CMakeLists.txt). D3 is used as a status LED. R11 & C13 are used to filter ADC_AVDD (ADC Reference Voltage).
Complete Schematic
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/RP2040-Decoder.svg
:align: center
:alt: Complete Schematic
Complete Schematic
BOM & Alternative Parts
====================
==============================
.. table:: BOM
:widths: auto
@@ -142,12 +148,14 @@ Alternative for HT7533S:
.. _wiring_rev_1_0:
Wiring the Decoder
====================
==============================
.. figure:: ../../../../svg/hw/rev_1_0/Wiring_diagram.svg
:width: 700
:alt: Wiring Diagram
:align: center
Wiring Diagram