I am recording a channel before and after injecting current into that channel. I control the current injection using a switch, when the switch is on current goes to the channel, when the switch is off current is off. My aim is to have a similar amplitude in the channel before and after the current injection.
So currently, I am storing data from the channel before the switch (X), and store data after the switch (Y). I want the data before and after the switch to equal each other (X=Y). The more the switch is on , the higher the amplitude (Y) is in comparison to A, and the opposite is true.
The duration of the switch being ON is what I can control in order to have the amplitude before and after equal.
Would using a PID control be a right way to start?