Go Down

Topic: pot simulation (Read 1 time) previous topic - next topic

spruce_m00se

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,

AWOL

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


Quote
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.

Quote
can anyone give me a pointer?

Code: [Select]
void* p = NULL;
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

spruce_m00se

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,


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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

spruce_m00se


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?

spruce_m00se


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,

CrossRoads

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.
http://www.maxim-ic.com/datasheet/index.mvp/id/1976
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

spruce_m00se

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?

CrossRoads

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?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

spruce_m00se

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,

CrossRoads

#11
Jul 20, 2012, 09:38 pm Last Edit: Jul 20, 2012, 09:43 pm by CrossRoads Reason: 1
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

spruce_m00se

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

CrossRoads

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.
http://www.maxim-ic.com/products/digi_pot/
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

spruce_m00se

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,


Go Up