Digital gain and offset correction

Hallo, which is the way to perform digital vgain and offset correction using a fpga?

Thanks, Marco T.

Reply to
Marco T.
Loading thread data ...

the answer is the same as for the last time you posted this very same question.

you can do it any way you like as long as it does what you need.

Antti

Reply to
Antti

Antti ha scritto:

Ok, but I never did it, so I asked to know if there is a prefered way.

I made made searches with google, but I didn't found relevant informations.

In example: I have a sensor with wheatstone bridge. I amplify the signal by 100. I connect it to adc. Then I could perform offset correction and also gain.

But my question was made to know which tecnique do you use.

Thanks, Marco T.

Reply to
Marco T.

the answer remains the same. you can use any way you like as long as it does what you need.

for bridge sensor it is WAY WAY WAY more preferable to use special flash microcontroller that can directly connect to bridge sensor. or you can use a sensor conditioner that has the correction already built in. or use generic microcontroller and write the correction in C like this:

my_wanted_result = (actual_measued_value + xxx) * yyy;

or use EDK to build a SoC system in FPGA and write:

my_wanted_result = (actual_measued_value + xxx) * yyy;

or use NIOS and write:

my_wanted_result = (actual_measued_value + xxx) * yyy;

or

... there exactly 28 more possibilities todo the same thing.

stop asking and start doing!

Antti

Reply to
Antti

Gain = multiplication or even simpler, right bitshift if you only need scaling factors of powers of 2 Offset = addition

both operations are done very easily in an FPGA

If you're really asking how to perform multiplication and addition in an fpga, then you should go purchase a decent VHDL or Verilog textbook

- there are many out there. For VHDL I like Andrew Rushton's VHDL for Logic Synthesis, but that's a personal preferance. For Verilog I have no idea, but I'm sure many people here would be happy to recommend you one.

Reply to
Paul

Paul ha scritto:

I wasn't asking about how to perform addition and multiplication.

I was asking if there are other implementations or auto tuning- techniques, in example if someone has made a loopback to perform it.

But if + and * are the only ones... so it's not useful to go on with this conversation.

Marco T.

Reply to
Marco T.

That's *not* what you were asking.

You were asking: "Which is the way to perform digital vgain and offset correction using a fpga?"

How is anyone supposed to see that you want to now about loopback and auto-tuning from that?

How are we supposed to give you decent answers if you don't state your question clearly?

It's like calling your auto shop and asking "How do I fix a broken car?". No mechanic will be able to give you a decent answer, because he doesn't know what kind of car you are talking about, what is broken, what kind of tools you have to repair it and if you know how to use them. Without more information, your question is meaningless and much too vague to answer. That's why Antti reacted the way he did when you first asked this here. It was his ironic way of letting you know that your question doesn't really make sense.

So: Without knowing what it is you want to do gain/offset correction for, noone will be able to give you a decent answer. If, for example, you want to do gain/offset-correction for a CMOS image sensor, it's different from doing GOC for RF receivers. In the end it all amounts to

  • and *, but how you get the values to add or multiply by differs a lot depending on the system you are looking at.

So actually, you don't want to know about *PERFORMING* gain/offset-correction at all (because that's trivial, just + and *)... Instead, what you want to know is how one obtains the correction factors (maybe through auto-tuning and/or loopbacks), which is a totally different subject.

--
My email address is only valid until the end of the month.
Try figuring out what the address is going to be after that...
Reply to
Sean Durkin

Sean Durkin ha scritto:

Sorry for my bad english... I made a generic question to open the thread and then going more specific.

I should connect two type of sensors, one with single ended output (from 0 to 5 Volt) and the second with wheatsotone bridge to an ADC.

I would like to know which are the best techniques to perform auto calibration.

Sorry for other previous posts.

Thanks, Marco T.

Reply to
Marco T.

This has nothing todo with FPGA, it is more related to analog domain and sensor conditioning So try reading some books and look in relevant places about analog measurements.

Antti

Reply to
Antti

It depends very much on what's on the other side of the sensor - the physical thing you're trying to measure. For example, if you know that the thing being measured has a long-term average of zero, it's easy to log the measured long-term average and subtract it from the measurements (offset). Similarly, you may be able to make inferences about the system gain from observations of long-term peak-to-peak swing. The kind of example I have in mind is an electronic compass (navigation): if you can go through one complete rotation, you know that you have seen peak-to-peak swing on both the north/south and the east/west signals, and you also know that when either of the two signals is at a peak, the other one is at zero. That explains why many car navigation systems sometimes ask you to drive round in a circle!

There is NOTHING about the output from any sensor that inherently allows you to calibrate it. You MUST know something about the input to the sensor. Maybe you can zero the input? For example, if it's a light sensor and it has a chopper disc rotating in front of it, you can be sure that the sensor is detecting zero when the chopper disc is interrupting the light. If you are very lucky, you may have some way of introducing a known calibration input to the sensor (put a known weight on the strain gauge...).

Some of the ideas I've mentioned depend on you performing an explicit calibration step. You will then need to consider how frequently to do this. Obviously this depends on how quickly the sensor becomes de-calibrated. Remember that you have to consider thermal effects, changes in supply voltage, and many other possible factors. If you can measure some of these, it may be possible to apply some kind of first-order compensation to the sensor output and thereby reduce the need to recalibrate very frequently.

Automotive sensors provide some very interesting examples. Take, for instance, the manifold-absolute-pressure (MAP) sensor that detects how hard the engine is sucking air in. When the engine is not rotating (easy to tell from the crankshaft sensor) you can be 100% confident that the inlet pressure is the same as atmospheric pressure. This provides a calibration opportunity every time you start the engine.

FINALLY.... For some sensors that can have large offset or gain errors, it may be preferable to apply your corrections by injecting analog voltages into the sensor using a DAC driven from your system. In this way you can pull the sensor's useful output range so that it matches your ADC's conversion range, thus improving dynamic range.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is it not the case that almost everything I've said here is just simple scientific common-sense?

--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
 Click to see the full signature
Reply to
Jonathan Bromley

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.