# [AmpeROSE] Simulation of initial calibration

Hello everyone!

This time, we are going to talk about the simulation, especially, some simulation that helps to see how we will do the initial calibration.

First, the full simulated circuit is the following one: On the top left, there is the current mirror, then in the centre to the right there is the part of the circuit that allows to do the current-to-voltage conversion and a model of the DUT (device under test composed by a battery of 5V and a resistive charge associated to a decoupling capacitor). At the bottom, there is on the left the amplification and then the filter in the middle.  The last element on the right is the simulation of the signals that allows to control the shunts.

Here are some interesting measurements done on this circuit: At the bottom there is the current generated by the current mirror in the measurement stage. As you can see, it as the form of a pulse, the on level is 2mA. Just above, there are the command signals of the shunts.

Here, we will focus on two times, each being represented by the vertical dotted lines. The first one correspond to the case where the second shunt is activated, so we have current flowing through the shunt 2 and 3. And the second case correspond to all shunts being used.

On the plot above, the signal represented is the output signal on which some computation where done. The formula is the following one: (VFILTER – Voffset) / (100 * 2m). So the first step is the subtraction, we remove the offsets introduced by the amplifiers. It is not represented here but we can measure it, we just have to measure VFILTER when there is no current flowing into the shunts. Then there is a division by 100 which is the amplification and 2m which is the value of the current at our points of interests here. As you may have guessed, this curve allows us to deduce the real resistances of the shunts including the values of the resistances of the transistors. At the first cursor, we can observe that the resistance is 10.002891 Ω and the second give us the value of 176.87423 mΩ.

Then, we can use these values while measuring that what was done on the first plot. We use the following formula: (VFILTER – Voffset) / (100 * Res). So here again, there is the correction of the offset and then the division by the amplification and the value of the resistance, 10. 002891 Ω at the first cursor and 176.87423 mΩ at the second cursor. And as you can see on the plot, the value deduced back is 2mA in both cases which is the actual current flowing.

As you saw here, we have a good faith in our system, now, it will be harder to do exactly the same thing as here. The main reason is that the measurement will be done through an ADC. The results is that the offset may be less precise for example. There is also the fact that resistors will have errors on theirs values, so we may need to verify the value of the amplification. We also may have an error on the current generated. So even though these results are promising, we will have a lot to do in our software to do a good initial calibration. This site uses Akismet to reduce spam. Learn how your comment data is processed.