Feed-Forward Circuit Feasibility

I need a feed-forward circuit that monitors a voltage (0 to 10V) and then outputs a predetermined voltage (0 to 5V, at <20mA) depending on the input is this a reasonable project, using a lookup table, with the Arduino?

I have very limited experience with the Raspberry pi, and am completely new to Arduino. I wanted to make sure I wasn't missing a fundamental limitation before digging into learning the details. Links to similar existing projects/information are appreciated.

Cheers

What is the input/output rule?

Unfortunately I don't have an exact functional form for the IO relation, but it follows a downward curving nonlinear relationship.

I could probably try and come up with a fit function and adjust the parameters each time I build one of these (the devices they control all have slightly different IO curves). So far, a lookup table seems easiest.

Input is fairly easy as long as the 10V signal has a fairly low impedance. A resistor voltage divider would bring the signal down to 5V suitable for the Arduino analog input. The Arduino "analog" output is a 400 Hz pulse of varrying duty cycle so you will need a low-pass filter to turn it into an analog signal. If your bandwidth requirement is greater than 40 Hz you will probably need to use an external D/A converter.

I'm confused about why you say 5V would be suitable, and this page linked below lists the input voltage recommendations to be 7-12V. Are these recommended upper and lower bounds for input signals?

Linked Here

The Uno operates at 5V. Recommended operating power supply input is 7 - 12 V. Maximum input at an analog input pin is 5V.

The I/O specs are listed futher down the page:

"The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function."

Barb

Important to point out that the absolute upper limit on ARef should be the power supply voltage, or less, but not more.

Thank you. I should be able to divide my inputs down to the <=5V required by the Arduino. Now I need to learn more about how to do the IO, based on a table of voltages.

You need an entry in the table, or array as that is what you use for each input reading. For best accuracy you need therefore 1024 bytes which is half the free space in a Uno. You could put this into program memory for better memory utilisation. So your input is simply used as the array index and the contents of that location is the output value you pass to the PWM function.

input = analogRead (0);
output = lookup[input];
analogWrite (pin,output);

Thank you. I have a few extra questions.

So I would discretize the expected analog input voltage range into 1024 chunks, then assign each of those a corresponding output based on whatever rule I need?

How would I increase the resolution of the analog input to greater that 1024 chunks by using additional input channels? I have one source wire (voltage) that I would like to monitor.

So I would discretize the expected analog input voltage range into 1024 chunks, then assign each of those a corresponding output based on whatever rule I need?

Yes you can do that.

How would I increase the resolution of the analog input to greater that 1024 chunks by using additional input channels?

You wouldn't. You need an external A/D of bigger than 10 bit resolution.

I see; thanks. One further question regarding the output bandwidth. If I am limited to about 50Hz by the need to low-pass the PWM output at about 500Hz, is there a way to make the PWM frequency itself faster?

Sure just google for how.

Great. Thanks everyone for your help.