Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
13a70d4
Initial commit
anirudhupadhyaya Apr 1, 2024
389f267
Update readme
anirudhupadhyaya Apr 1, 2024
9c85d49
Update readme
anirudhupadhyaya Apr 1, 2024
f477839
Update readme
anirudhupadhyaya Apr 11, 2024
ba8b2d8
Add files
anirudhupadhyaya Apr 11, 2024
d070217
Update files
anirudhupadhyaya Apr 11, 2024
9bdcf98
Changes
anirudhupadhyaya Apr 11, 2024
11b4a4b
Changes
anirudhupadhyaya Apr 11, 2024
56110b8
Update files
anirudhupadhyaya Apr 11, 2024
554b202
Get rif of scope image
anirudhupadhyaya Apr 11, 2024
5ea2b99
Minor updates
Jun 3, 2024
996ae82
Merge pull request #101 from Severson-Group/user/npetersen2/patch-1
anirudhupadhyaya Jun 4, 2024
3371b62
Address review comments
anirudhupadhyaya Jun 4, 2024
efa5850
Remove resources
anirudhupadhyaya Jun 4, 2024
c149819
Add back resources
anirudhupadhyaya Jun 4, 2024
fdd3e31
Address review comments
anirudhupadhyaya Jun 6, 2024
3863bd2
Address review comments
anirudhupadhyaya Jun 6, 2024
f0b25e1
Update index.md
elsevers Jun 9, 2024
911e319
Edit current sensor calibration method section
elsevers Jun 9, 2024
b77e573
Edit calibration method section
elsevers Jun 9, 2024
f48e356
Add section on Recalcilating current sensor offset
elsevers Jun 9, 2024
f0d00a2
Clarify that we measure a voltage.
elsevers Jun 9, 2024
cdcb633
Edit conclusion
elsevers Jun 9, 2024
3047a09
Update index.md
elsevers Jun 9, 2024
0097469
Update index.md
elsevers Jun 9, 2024
fb84857
Merge pull request #105 from Severson-Group/elsevers/edit_current_sen…
anirudhupadhyaya Jun 10, 2024
941ff1b
Address review comments
anirudhupadhyaya Jun 24, 2024
355cf05
Update doc
anirudhupadhyaya Jun 24, 2024
4bf6d53
Update index.md
anirudhupadhyaya Jun 24, 2024
89d7632
Update index.md
anirudhupadhyaya Jun 24, 2024
e26351e
Update index.md
anirudhupadhyaya Jun 24, 2024
5806313
Apply suggestions from code review
anirudhupadhyaya Jun 26, 2024
b2da7cb
Update source/getting-started/control-with-amdc/current-sensor-cal/in…
elsevers Jul 1, 2024
93bf498
Update source/getting-started/control-with-amdc/current-sensor-cal/in…
elsevers Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,58 @@
# Current Sensor Calibration

How to calibrate current sensor feedback
## Background

Motor drives typically require current sensors to provide feedback to the control system. This document describes a method to calibrate the current sensors to a linear model during commissioning of a motor drive. The calibration is characterized by two parameters, a gain and an offset, that describe how the sensed current appears as a voltage to the AMDC.

Current sensors are transducers which produce an output signal (either current or voltage) proportional to the primary current flowing through the sensor. There are different types of current sensors relying on different physical phenomenons such as shunt resistors and hall-effect. For the purpose of this document, the specific type of sensor does not matter---just that the output signal is linear with the primary current, and that it is measured as a voltage by the control system. The current sensor needs to be calibrated against an appropriate reference before it can be used in the control system. This reference is a known, trusted current sensor, such as a precision digital multimeter (preferred), hall-effect current clamp, or the setpoint of a DC power supply. While the manufacturer datasheet provides nominal parameters, calibration of the current sensor is necessary to get accurate measurements to account for any deviation due to process variation.

## Calibration Method

A method is now provided to calibrate the current sensors in a motor drive. An example of the assumed system for a three phase motor is shown in the figure below.

<img src="./resources/current_sensor_drawing.svg" width="50%" align="center"/>

Typically, each phase has a current sensor associated with it that needs to be calibrated. This method assumes that the signal measured by the AMDC for each sensor is a voltage that must be converted into a current value.

1. Connect the reference curent sensor (i.e. precision digital multimeter) to the phase U cable of the motor.
1. Set up your AMDC system to enable you to log the raw reading of the drive's current sensor attached to phase U (presumably, by sampling an ADC channel). It is recommended to use the AMDC's logging functionality so that data can be collected over a period of time (e.g. 100 ms) and post-processed to find the average value.
1. Record the drive's sensor reading when there is no current flowing through phase U. _Hint:_ remember to calculate this value as the average over a period of time.
1. Cause a "small" curent to flow through phase U (i.e., apply a voltage across phase U). The value of current is left to the discretion of the user based on the system nominal ratings.
1. Record the drive's sensor reading as well as the reference sensor's reading of the current flowing through the phase U cable.
1. Progressively increase the phase U current and record the readings. Do this over the full range of rated current, both positive and negative.
1. Tabulate the measurements as shown in this example [`exp_data.csv` file](./resources/exp_data.csv).
1. Fit a linear expression of the form $\text{Reading [V]} = \text{Gain [V/A]} \times \text{Current [A]} + \text{Offset [V]}$ to the obtained measurements. This [example Jupyter notebook](./resources/current_sensor_calibration.ipynb) is provided to illustrate the process.
1. Repeat the exercise for the remaining phases of the system.

An example of the results are shown in the plot below. The obtained gain and offset can be used directly in the control code to convert the sensor reading into the actual current measurement.


<img src="./resources/fit.svg" width="50%" align="center"/>

```{tip}
Be sure to conduct the calibration process over the full range of current data (both positive and negative current) to account for any variation in the current sensor reading due to directionality of current.
```
## Use of Calibration Data

The below codeblock can be utilized by the user to convert between raw measurements from the sensor and the actual currents.

```C
#define INV_GAIN (1.0/0.621) // Inverse of gain obtained from curve fit (1/0.621)
double offset = 4.739; // [V], offset from curve fit. This is a variable so that the drive can remeasure and adjust the offset at startup

double current_measurement; // Actual current measurement, to be used in control algorithm

current_measurement = (sensor_reading - offset)*INV_GAIN; // sensor_reading is the raw measurement and needs to be obtained by the user

```

## Recalculate Offset At Startup
The offset value of the current sensors can drift over time. It is recommended that drive developers include code in their control logic to automatically re-zero the current sensor at startup, as follows:

1. Prior to enabling the PWM, when it is known that there is no current flowing in the motor, record approximately 100 ms of sensor data on each phase.
2. For each phase, calculate the average of this data and use it as the new `offset` value in the code block above.
3. Proceed with starting-up the drive.

## Conclusion

The current sensor calibration method presented in this article should be viewed as a best-practice for motor drive development. Readers are welcome to directly use the provided code and Jupyter notebook in their motor drives.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading