-
Notifications
You must be signed in to change notification settings - Fork 2
Add current sensor calibration documentation #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
13a70d4
Initial commit
anirudhupadhyaya 389f267
Update readme
anirudhupadhyaya 9c85d49
Update readme
anirudhupadhyaya f477839
Update readme
anirudhupadhyaya ba8b2d8
Add files
anirudhupadhyaya d070217
Update files
anirudhupadhyaya 9bdcf98
Changes
anirudhupadhyaya 11b4a4b
Changes
anirudhupadhyaya 56110b8
Update files
anirudhupadhyaya 554b202
Get rif of scope image
anirudhupadhyaya 5ea2b99
Minor updates
996ae82
Merge pull request #101 from Severson-Group/user/npetersen2/patch-1
anirudhupadhyaya 3371b62
Address review comments
anirudhupadhyaya efa5850
Remove resources
anirudhupadhyaya c149819
Add back resources
anirudhupadhyaya fdd3e31
Address review comments
anirudhupadhyaya 3863bd2
Address review comments
anirudhupadhyaya f0b25e1
Update index.md
elsevers 911e319
Edit current sensor calibration method section
elsevers b77e573
Edit calibration method section
elsevers f48e356
Add section on Recalcilating current sensor offset
elsevers f0d00a2
Clarify that we measure a voltage.
elsevers cdcb633
Edit conclusion
elsevers 3047a09
Update index.md
elsevers 0097469
Update index.md
elsevers fb84857
Merge pull request #105 from Severson-Group/elsevers/edit_current_sen…
anirudhupadhyaya 941ff1b
Address review comments
anirudhupadhyaya 355cf05
Update doc
anirudhupadhyaya 4bf6d53
Update index.md
anirudhupadhyaya 89d7632
Update index.md
anirudhupadhyaya e26351e
Update index.md
anirudhupadhyaya 5806313
Apply suggestions from code review
anirudhupadhyaya b2da7cb
Update source/getting-started/control-with-amdc/current-sensor-cal/in…
elsevers 93bf498
Update source/getting-started/control-with-amdc/current-sensor-cal/in…
elsevers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 46 additions & 1 deletion
47
source/getting-started/control-with-amdc/current-sensor-cal/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,49 @@ | ||
| # Current Sensor Calibration | ||
|
|
||
| How to calibrate current sensor feedback | ||
| ## Background | ||
|
|
||
| Current sensors provide the necessary current measurement feedback to the control system in a motor drive. This document describes a method to calibrate the current sensors during commissioning of the motor drive, and arrive at the calibration parameters: gain and offset. | ||
|
|
||
| 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 type current sensors. For the purpose of this document, the specific type of sensor does not matter---just that the output signal is linear versus the primary current, and that it is measurable by the control system. The current sensor needs to be calibrated against an appropriate reference before it can be used in the control system. 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 | ||
|
|
||
| <img src="./resources/current_sensor_drawing.svg" width="50%" align="center"/> | ||
|
|
||
| A method is provided to calibrate the current sesnsors connected to a three phase motor drive as shown in the figure. Typically, each phase in a 3 phase motor will have a current sensor associated with it. Hence, each of the three current sensors need to be calibrated. The same method maybe extended to any multi-phase machines. The method is described below: | ||
|
|
||
| 1. Connect a current clamp to the phase U cable of the motor. The measurement provided by the current clamp can be considered as a reference current measurement. | ||
| 1. Hook up the current clamp to an oscilloscope so that the reading of the current clamp can be monitored in real-time. | ||
| 1. Log the raw reading of the current sensor attached to phase U using the logging functionality in the AMDC. | ||
| 1. First, note the sensor reading when there is no current flowing through phase U. | ||
| 1. Next, apply a differential open loop voltage on phase U to cause some current to flow through phase U. The value of voltage is left to the discretion of the user based on the system nominal ratings. | ||
| 1. Note down the sensor reading as well as the reference current flowing through phase U cable. | ||
| 1. Progressively increase the applied voltage and note down the readings. It is recommended to go up until the rated value of the current is flowing through phase U. | ||
| 1. Tabulate the measurements as shown in `exp_data.csv` file [here](./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. A [Jupyter notebook](./resources/current_sensor_calibration.ipynb) is provided for this purpose. | ||
| 1. For the data presented, the fit is shown in the below plot. | ||
| 1. Now the obtained gain and offset can be used in the control code to convert the sensor reading into the actual current measurement. | ||
| 1. Repeat the exercise for phases U and V of the system | ||
|
|
||
| <img src="./resources/fit.svg" width="50%" align="center"/> | ||
|
|
||
| ```{tip} | ||
| It is a good idea to have negative currents in the data points as well to account for any variation in the current sensor reading due to directionality of current. | ||
| ``` | ||
| ## Use of Calibration data | ||
anirudhupadhyaya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The below codeblock can be utilized by the user to convert between raw measurements from the sensor and the actual currents. | ||
|
|
||
| ```C | ||
| #define GAIN 0.621 // Gain from curve fit | ||
| #define OFFSET 4.739 // Offset from curve fit | ||
|
|
||
| double current_measurement; // Actual current measurement, to be used in control algorithm | ||
|
|
||
| current_measurement = (sensor_reading - OFFSET)/GAIN; // sensor_reading is the raw measurement and needs to be obtained by the user | ||
|
|
||
| ``` | ||
|
|
||
| ## Conclusion | ||
|
|
||
| A method to calibrate the current sensors has been presented. The user is also given hints on how the output of the calibration process maybe used in the control code. | ||
243 changes: 243 additions & 0 deletions
243
...rrent-sensor-cal/resources/.ipynb_checkpoints/current_sensor_calibration-checkpoint.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
243 changes: 243 additions & 0 deletions
243
...g-started/control-with-amdc/current-sensor-cal/resources/current_sensor_calibration.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.