0
\$\begingroup\$

This is a pretty vague question so please bear with me. I can add further information if required; just let me know in the comments. So here is the problem that I want to solve.

There is a system which gives certain voltage output which is the error in a system. It is a sinusoidal wave the peak to peak value of which is my error voltage. I have to take that error voltage and then give a voltage signal to an electronically controlled attenuator which then attenuates my system and changes the error voltage. Obviously I have to minimize the attenuator voltage. But here are the problematic parts:

  1. There is an error null point of voltage which, when given to the attenuator, will nullify the error that null point is not known. The circuit has to find out that null point and keep the attenuator voltage there.

  2. The error null point may change change during the operation of the system due to different things. That may create some problems too.

Can someone help me design an electronic systems (maybe using op-amps?) to solve this problem?

Edit: We have a microcontroller-based system for this already. It uses the ADC of the controller and a DAC to give the voltage to the attenuator. But I just thought maybe there are simpler ways to do this.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Do you know about PID controllers? \$\endgroup\$
    – Phil Frost
    Commented Feb 15, 2013 at 16:06
  • \$\begingroup\$ @PhilFrost I heard about them, but can you please point me to a good resource to read up? \$\endgroup\$
    – Rick_2047
    Commented Feb 15, 2013 at 17:40
  • 1
    \$\begingroup\$ Well, Google and Wikipedia are a good start. \$\endgroup\$
    – Phil Frost
    Commented Feb 15, 2013 at 17:53

2 Answers 2

2
\$\begingroup\$

The microcontroller is the simple way. Digital values don't drift, have offset errors, change over temperature, and generally are a lot more precise than analog. Firmware also allows for various non-linear schemes that would be difficult in analog.

It seems the natural thing to do is to run a control loop iteration each error waveform peak. Capture the peak, and that is you error level for that iteration. The tricky part may be to determine the direction of the control output. Is there a phase reference so you can get a signed error value instead of the absolute value? That would help a lot.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ make a guess, if error increases instead of decreasing, change directions \$\endgroup\$
    – vicatcu
    Commented Feb 15, 2013 at 14:24
  • 1
    \$\begingroup\$ @vicatcu: That's exactly what you want to avoid. It's the fallback though if there really is no way to get a signed error value. You also use a little smarts based on recent history and rate of change and the like. \$\endgroup\$ Commented Feb 15, 2013 at 18:32
  • 1
    \$\begingroup\$ Weighted Proportional, Integral, and Derivative (Differential?) error components, if you will ;-) \$\endgroup\$
    – vicatcu
    Commented Feb 16, 2013 at 0:35
0
\$\begingroup\$

It's a basic control loop that you need. It may be implemented in a microcontroller or analog circuit. Microcontroller will allow changing things quickly, but will require a little hardware to start.

The idea is very simple. Your output (called "command") is what you apply to the attenuator. It is equal to the sum of (error times factorP) , (integral[0 to t] of error times factorF), (derivative of error times factorD). For simplicity some factors may be 0, but probably you will need all of them.

In analog system factors are just gains, and integral or derivative are implemented with a simple opamp circuit. The error itself should probably be measured by peak detector.

In digital implementation you just have to run a timer of, say, 1msec and calculate the command each time. integral will be sum of all incoming errors (don't forget to limit this value) and derivative will be the subtraction of the two most recent values. Again, measurement itself should be taken by peak detector, hardware or software.

And then you are going to tune the system by finding the three factors. It will take some time. Good luck.

Yes, it's based on assumption, that your sine is faster than the control interrupt. If it's not, things will be a little trickier, since you will have ti use the peaks as the interrupt instead timer, and this will make the firmware quite complicated for some cases. So i would suggest to slow down the timer. If your frequency is slow, make the timer even slower.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.