pot simulation

HI

I want to make an automatic RC system for stress testing motors , my plan is to take the readings from the pots in the rc gimbals, establish the limits that i want to reproduce, and then reproduce them with an arduino so that i get the same stress test each time,
right now i just stress the hell out of the motors to see if they have problems or not, but each test is different based on my commands,

i know how to read the pot value and print it to an lcd for establishing the limits,

but i dont know how to simulate that signal and send it back out to the rest of the rc system ready for transmition,
can anyone give me a pointer?
thanks,

my plan is to take the readings from the pots in the rc gimbals

but i dont know how to simulate that signal and send it back out to the rest of the rc system ready for transmition,

Do you mean read the joystick pots?
Or do you mean read the PPM/PWM stream?
Maybe there's something you can do with the Tx's buddy/trainer port.

can anyone give me a pointer?

void* p = NULL;

i mean read the joystick pots directly,

i think that would be easier for a novice than decoding the pwm stream, I will use an old RC handset that can be freely hacked and mashed into what i need,

The pots just have analog levels at the wipers, yes? Connect those to two analog inputs.
Read them in, send out as digital values, or mimic them with DACs elsewhere if you need analog again.

Or simply include appropriate digital potentiometers in your device. Use A2D to determine the limits your interested in, then "swap" in a digital pot and perform your tests with the digital pot replacing the signals from the controllers pot.

CrossRoads:
The pots just have analog levels at the wipers, yes? Connect those to two analog inputs.
Read them in, send out as digital values, or mimic them with DACs elsewhere if you need analog again.

CrossRoads, im still trying to talk to the boss about the other boards, when i know anything i´ll let you know,

back to subject,

will the digital signal look like a difference in resistance to the board that was previously connected to the pot?

wanderson:
Or simply include appropriate digital potentiometers in your device. Use A2D to determine the limits your interested in, then "swap" in a digital pot and perform your tests with the digital pot replacing the signals from the controllers pot.

is a digital pot something physical or coded?
I have no idea what it is,

Ok on the mini1284's.

For this one - I think you want a digitally controlled potentiometer then to replace the joystick's pot.
Many exist, here's one example.

ok ,
so it says 3 wire serial data input, is that to control it? I am going to need to replace 4 pots and a slider, is that going to be possible on a 328u?

Yes.
Common INC & U/D to all devices.
Unique CS to each.
Total: 7 pins.

Next step - what is the voltage across the existing pots?

well the voltage across the exisitng pots has to be tested, i can test it on monday when back at work ,

is the coding to control these digital pots complicated? I am planning to make a set test routine, all it will really have to do is take the digital pots output from the minimum that i have yet to establish from the exisitng pots, up to the max and back down again on each of the pots in turn, and if possible then all of them at the same time,

the plan is to test the motor response on an rc model under heavy stress conditions,

I would say dirt simple (clarified after reading the datasheet!):

With CS low and U/D high, a high-to-low transition on INC increments the
internal counter, increasing the resistance between W and L.

When both CS and U/D are low, a high-to-low INC transition decrements the
internal counter, decreasing the resistance between W and L.

At either end (maximum or minimum positions), additional transitions in the
direction of the end points will not change the counter value (the counter will not wrap around).

Wiper Increment Control Input. With CS low, a high-to-low transition increments
(U/D high) or decrements (U/D low) the wiper position.

Up/Down Control Input. With CS low, a high-to-low INC transition increments
(U/D high) or decrements (U/D low) the wiper position.

Example: send 8 transitions to the Increment pin to increase the resistance:

digitalWrite (CS, LOW);
digitalWrite (UD, HIGH);
for (int x = 0; x<8; x=x+1){
digitalWrite (INC, HIGH);
digitalWrite (INC, LOW);
}
digitalWrite (CS, HIGH);

And you'd probably want a counter to keep track of where you were.

so basically that little bit of psuedo would have increased the resistance a bit , by one increment assumedly,

i would just have to make some functions for increase and decrease and implement a counter to give me an order of events based on counter value,

call the functions i want based on the counter, and then reset the counter ready to start the cycle again,

its looking feasible,

since you seem to know what you are talking about, would the digi pots need external circuitry? hopefully they could run on 5v

That code would have incremented 8 times.
The pots do run on 5v signals with 5V across the variable part.

With power cycling, the wiper goes to position 16.

There are other pots also, including non-volatile parts that retain their setting.

so cant you set x as an integer inside the IF statement? I have always been doing it at the start of the sketch outside of setup,

thats an interesting thing to know because if you have a lot of seperate statements that dont necccesarily come true you dont need to waste power with a lot of unused variables,

No, you can:

for (int x = 0; x<8; x=x+1){
digitalWrite (INC, HIGH);
digitalWrite (INC, LOW);
}

but this is a loop that will run 8 times, thus 8 pulses.

I normally declare all my variables at the top of the sketch, vs locally like this. x can always be reused by other loops as long as only 1 at a time is running.