Updated Hardware description (markdown)

Gabriel Koppenstein committed 2022-03-01 22:59:49 +01:00
1 parent 46f58a9684
commit ecdb1df63d
1 file changed
+17 -17
+17 -17
@@ -2,7 +2,7 @@ Overview
--------------------------
![Block Diagram](https://github.com/1nct/RP2040-Decoder/blob/main/docs/svg/Block_Diagram.svg)
The above block diagram gives a general overview regarding the operation of components. For better illustration it has been divided into four functional blocks. Furthermore these functional blocks can be subdivided and will be explained in detail.
The above block diagram gives a general overview regarding the operation of components. For better illustration it has been divided into four functional blocks. Furthermore these functional blocks can be subdivided and will be explained below.
* Input Stage
- DCC Signal Level Shift
@@ -28,21 +28,21 @@ Characteristics
| Input Voltage Low<sup>(0)</sup> | V<sub>IL</sub> | 0 | 1.155 | V |
| Total GPIO Current<sup>(0)</sup> | I<sub>IOVDD_MAX</sub>| | 50 | mA |
| Absolute max. motor output current<sup>(1)</sup> | I<sub>MOTOR</sub> | | 2.8 | A |
| Absolute max. auxillary output current<sup>(2)</sup> | I<sub>AUX</sub> | | 750 | mA |
| Absolute max. auxillary output current<sup>(2)</sup> | I<sub>AUX</sub> | | 400 | mA |
(0): According to: [RP2040 Datasheet](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf) (assuming V<sub>DD</sub> = 3.3V)
(1): According to: [BDR6133 Datasheet](https://datasheet.lcsc.com/lcsc/2101211904_Bardeen-Micro--BDR6133_C2687793.pdf)
(2): According to: [WNM2030 Datasheet](https://datasheet.lcsc.com/lcsc/1809191616_WILLSEMI-Will-Semicon-WNM2030-3-TR_C239769.pdf) (@25°C)
(2): According to: [T2N7002BK Datasheet](https://datasheet.lcsc.com/lcsc/1810271831_TOSHIBA-T2N7002BK-LM_C146372.pdf)
Input Stage
--------------------------
![Input Stage](https://github.com/1nct/RP2040-Decoder/blob/main/docs/svg/Input_Stage.svg)
D1 Rectifies the DCC square-wave into DC, the amplitude is not critical as long as its within the 25V limit. The rectified Voltage is then provided to the 3.3V voltage regulator (U1) and to the motor driver (U2).
D1 Rectifies the DCC square-wave into +V, the amplitude is not critical as long as its within the 25V limit. The rectified voltage +V is then provided to the 3.3V voltage regulator (U1) and to the motor driver (U2).
The circuit on the left ensures that the DCC signal is in a suitable voltage range to be processed by the microcontroller. Diode D2 protects the GPIO from negative Voltages. The zener diode D3 increases the maximum input voltage and thus an increase in the total input voltage range, which would not be achievable with a regular voltage divider.
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 GPIO24 is pulled high by the RP2040, as soon as Q1 gets turned on (V<sub>GS</sub> > V<sub>GS,th</sub>), GPIO24 gets pulled to GND potential. R1 and R2 ensure that V<sub>GS</sub> doesnt exceed ±20V.
Motor Driver
--------------------------
@@ -50,23 +50,23 @@ Motor Driver
The Motor Driver is a complete H-Bridge IC specifically made for DC-Motors.
In order to control the motor, it is necessary to measure the back-EMF. This is done by the ADC which measures at Points ADC_EMF_A and ADC_EMF_B respectively. The two resistors and the zener diode function similar to the circuit in the input stage. Only this time the actual voltage V<sub>EMF</sub> has to be measured. This means for voltages higher than ~1.8V the non-linearity of the Zener Diode needs to be taken into account. The correction is done in Software, approximated by the following formula:
V<sub>EMF</sub> > 1.8V:
V<sub>EMF</sub> ≈ 11⋅(V<sub>ADC_EMF_X</sub>)<sup>2</sup> - 43⋅(V<sub>ADC_EMF_X</sub>) + 45
V<sub>EMF</sub> < 1.8V:
V<sub>EMF</sub> ≈ (V<sub>ADC_EMF_X</sub>)⋅(<sup>10kΩ+10kΩ</sup>/<sub>10kΩ</sub>)
Note: ADC converts 3.3V to 4096 and 0V to 0
In order to control the motor, it is necessary to measure the back-EMF. This is done by the ADC which measures at Points ADC_EMF_A and ADC_EMF_B respectively. The two resistors are used as a voltage divider.
Auxillary Output
--------------------------
![Auxillary Output](https://github.com/1nct/RP2040-Decoder/blob/main/docs/svg/Aux_Outputs.svg)
Switching of loads up to a maximum of about ~750mA can be done using these four N-Channel MOSFETS. They are switching on the low-side which means the load is either switched on and connected to GND or switched off and not connected to GND. So in order to connect any load, the load needs to be supplied by the +12V and the negative "-" side has to be connected to AUX(X).
Switching of loads up to a maximum of about ~400mA can be done using four N-Channel MOSFETS. They are switching on the low-side which means the load effectively gets connected to GND potential as the Transistor starts to conduct.
GPIO
--------------------------
To Switch lighter loads, six GPIOs can be used. Alternatively they can of course be used as inputs as well (e.g. Reed switch).
Microcontroller
--------------------------
![Microcontroller](https://github.com/1nct/RP2040-Decoder/blob/main/docs/svg/Microcontroller.svg)
The Microcontroller needs a crystal oscillator to function properly. Flash memory is also needed as it holds the configuration variables and the program itself. R3 & C14 are used to filter ADC_AVDD (This might possibly be omitted in a future Revision).
Complete Schematic
--------------------------