Skip to content
22 changes: 22 additions & 0 deletions CurrentCard/REV20200830C/CurrentSensorBoard_BOM_LA100-P.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Comment,Designator,Supplier Part Number 1,Supplier order Quantity
BNC,BNC1,A33798-ND,1
C0603C104Z3VACTU,"C1, C2, C3, C4, C9",399-1100-1-ND,5
GRM1885C1H102JA01D,C5,490-1451-1-ND,1
Capacitor,"C6, C7, C8, C10, C11",1276-2890-1-ND,5
LTST-C193KGKT-5A,DS1,160-1828-1-ND,1
LTST-C193TBKT-5A,DS2,160-1827-1-ND,1
742792609,"L1, L2, L3, L4",732-1591-1-ND,4
HDR1x3,P1,A98334-ND,1
HDR1X7,P2,A32908-ND,1
HDR1x3,P3,A106650-ND,1
Screw terminal,"P5, P6",36-8196-ND,2
ERJ-3GEYJ302V,"R1, R3",P3.0KGCT-ND,2
RC0603FR-07470RL,R2,311-470HRCT-ND,1
ERA3AEB103V,R4,P10KDBCT-ND,1
Burden resistor,R5,RK73H3ATTE28R0F,1
ERA3AEB1072V,R6,P10.7KDBCT-ND,1
ERA3AEB4121V,R8,P4.12KDBCT-ND,1
5004,"TP1, TP2, TP3, TP4, TP5, TP6, TP7",36-5004-ND,7
ADC,U1,296-47183-ND,1
OPA320AIDBVR,U2,296-29480-1-ND,1
REF5045IDGKT,U3,296-24505-1-ND,1
Binary file not shown.
Binary file not shown.
29 changes: 21 additions & 8 deletions CurrentCard/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ REV C

The current measurement card was designed to the following specifications:

1. Current measurement range of +/- 55A (rms)
1. Current measurement range of +/- 55A or +/- 150A (rms)
2. Noise immunity
3. Quick adjustment of the sensing range
4. High sensor bandwidth
Expand All @@ -25,13 +25,16 @@ The high level block diagram of the current sensor card is shown below:
<img src="images/current-sensor-blockdiagram.svg" width="500%" />

### Current Sensor
LEM LA 55-P current sensor is selected for this design, as it is the only sensor available from LEM with an open aperture and PC pins that can measure +/-55A.
Based on the sensing range desired, the current measurement card can use either LA 55-P or LA 100-P from LEM. These sensors have an open aperture and PC pins. The LA 55-P can measure +/-55A, while the LA 100-P can measure +/-150A.

**Note**: The LA 100 series has three variants, LA 100-P, LA 100-P/SP13, and LA 100-TP, that users must be careful about when ordering. The sensor gains of each of these variants are different, which has implications for the choice of the burden resistor. The rest of this document is specific to the LA 100-P variant.

The open aperture was a requirement as it allows for the range to be easily scaled down just by adding turns to the primary.
The LA 55-P is a closed loop compensated hall effect transducer that has an accuracy of +/-0.65% and linearity of <0.15% which is quite good compared to other sensors from LEM.
It has an excellent bandwidth of 200khz and a low impedance current output that is inherently more immune to noise than a high impedance voltage output.
The LA 55-P is a closed loop compensated hall effect transducer that has an accuracy of +/-0.65% and linearity of <0.15% which is quite good compared to other sensors from LEM. The LA 100-P has an accuracy of +/-0.45% and linearity of <0.15%.
They have an excellent bandwidth of 200khz and a low impedance current output that is inherently more immune to noise than a high impedance voltage output.


### Burden Resistor (_R_<sub>_BURDEN_</sub>)
### Burden Resistor (_R_<sub>_BURDEN_</sub>) for LA 55-P
A burden resistor (`R5`) is used to convert the current output of the sensor to a voltage. For a sensing range of 70A, the burden resistance, _R_<sub>_BURDEN_</sub> was calculated using the following equation

_V_<sub>_BURDEN_</sub> = _I_<sub>_PRIMARY_</sub>(_N_<sub>2</sub>/_N_<sub>1</sub>)_R_<sub>_BURDEN_</sub>
Expand All @@ -40,10 +43,19 @@ _R_<sub>_BURDEN_</sub> = (10 V/70 A)*(1000/1) = 143Ω

The LA 55-P datasheet specifies the burden resistor value must be between 135Ω and 155Ω so a 150Ω resistor was selected.

### Current Sensor Gain
The LA 55P has a conversion ratio of _N_<sub>1</sub>:_N_<sub>2</sub> = 1:1000, where _N_<sub>1</sub> is the primary turns (user configurable) and _N_<sub>2</sub> is the secondary turns. With the chosen _R_<sub>_BURDEN_</sub> and _N_<sub>1</sub> = 1, the current sense circuitry has a current - voltage gain of 1/7 [V/A].
### Burden Resistor (_R_<sub>_BURDEN_</sub>) for LA 100-P
For a sensing range of 150A, the burden resistance, _R_<sub>_BURDEN_</sub> was calculated using the following equation

_R_<sub>_BURDEN_</sub> = (2 V/150 A)*(2000/1) = 26.7Ω

The LA 100-P datasheet specifies the burden resistor value must be between 0Ω and 33Ω so a 28Ω resistor was selected.

### Current Sensor Gain for LA 55-P
The LA 55-P has a conversion ratio of _N_<sub>1</sub>:_N_<sub>2</sub> = 1:1000, where _N_<sub>1</sub> is the primary turns (user configurable) and _N_<sub>2</sub> is the secondary turns. With the chosen _R_<sub>_BURDEN_</sub> and _N_<sub>1</sub> = 1, the current sense circuitry has a current - voltage gain of 0.15 [V/A].
To sense lower current, multiple number of primary turns can be added, without the need to modify any other parts of the circuit. As an example, to sense currents in the range of +/- 7 A, _N_<sub>1</sub> = 10 can be used, without modifying rest of the circuit.

### Current Sensor Gain for LA 100-P
The LA 100-P has a conversion ratio of _N_<sub>1</sub>:_N_<sub>2</sub> = 1:2000. With the chosen _R_<sub>_BURDEN_</sub> and _N_<sub>1</sub> = 1, the current sense circuitry has a current - voltage gain of 0.014 [V/A].

### Op Amp Stage
The voltage across the burden resistor is a bipolar signal (voltage span includes both positive and negative voltages).
Expand Down Expand Up @@ -91,7 +103,8 @@ A user may want to change some of the passive components based on the range requ


## Datasheets
- [Current Sensor](../datasheets/LA55P_Current%20Sensor.pdf)
- [Current Sensor (LA55-P)](../datasheets/LA55P_Current%20Sensor.pdf)
- [Current Sensor (LA100-P)](../datasheets/LA100P_Current%20Sensor.pdf)
- [Op Amp](../datasheets/OPA320_OpAmp.pdf)
- [Voltage Reference (LDO)](../datasheets/REF5045_LDO.pdf)
- [Analog to Digital Converter](../datasheets/ADS_8860_ADC.pdf)
Expand Down
31 changes: 31 additions & 0 deletions Mainboard/Firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,34 @@ NOTE: The STM32 devices are typically programmed into non-volatile memory. There
The mainboard firmware is fairly simple, yet very specialized for the application. Before changing *anything* in the code, make sure you understand how it works. Practically every line of the code is optimized for speed and efficiency! Using a multi-channel logic analyzer / oscilloscope is absolutely required when updating the mainboard firmware to validate code timing.

**Do not blindly change the code.**

## Flashing Firmware to Mainboards with Alternative STM32F745ZG Processors

The firmware project provided in this repository is configured for a mainboard populated with a STM32F**765**ZG processor. This project configuration is incompatible with the alternative STM32F**745**ZG chip that is populated on some mainboard PCBs. Creating a new project targeting the alternative STM32F**745**ZG processor and loading in the provided source files is required. Here's how that's done.

### Create a new STM32 Project
1. Within STM32CubeIDE create a new `STM32 project` targeting the `STM32F745ZG` device with the following settings:
- Targeted Language: `C`
- Targeted Binary Type: `Executable`
- Targeted Project Type: `STM32Cube`

### Replace Source Code
2. Open the file folder location of the newly created project
3. Navigate to the `\Core\` directory and replace the `\Src` & `\Inc` folders with the ones provided in the AMDS repository
4. Navigate to the `\Drivers\STM32F7xx_HAL_Driver` directory and replace the `\Src` & `\Inc` folders with the ones provided in the AMDS repository
5. Within STM32CubeIDE refresh & build the project, no errors should be present

### Increase Compiler Optimization
6. In the `Project Explorer` pane on the left, right-click on the STM32Cube Project you created, and click on Properties
7. Expand `C/C++ Build` and click `Settings`
8. Find and click on `MCU GCC Compiler` > `Optimization`
9. Select the dropdown next for `Optimization Level` and change to `Optimize more (-O2)`
10. Select `Apply and Close`

### Flash Firmware to Mainboard
11. Select `Debug Configurations` under the `Run` menu at the top
12. Select the `Debugger` tab in the pop-up window
13. Change the `Frequency (kHz)` setting from `Auto` to `140`
14. Select `Apply`

You are now ready to connect & flash the firmware to the STM32F**745**ZG processor equiped Mainboard!