Digital Potentiometer selection

Andrew Cowan

Senior Member
I am designing what is effectively an rc speed controller for very low currents.

I will use a picaxe to read two channels rc signals, mix them, and output to two digital pots (or one dual channel digital pot).

The resistance of the pot must be 10K end to end.

My question is about how to control the pot. When the servo signal is 1.5ms, the pot must be at 5K. When it is at 0.75ms, it must be at 0K etc.

This means I can't use up/down control, as feedback would be needed to give acurate control.

Looking at maxim's website, I can see 10K, 256 step pots controlled by:
2 wire addressable
2 wire serial
3 wire serial
3 wire serial SPI
I2C

I have never used any of these - which would be simplest and fastest (in terms of how fast the program runs)?

Bare in mind that I must be able to make it go to a certain position, rather than just being able to increase or decrease it.

I will probably use a PICAXE on 8MHz.

Need any more information?

Andrew

EDIT: Does wiper resistance mean minimum resistance? If so, I need one with a small wiper resistance.
 
Last edited:

MBrej

Member
When it is at 0.75ms, it must be at 0K etc.
How accurate exactly does it have to be, the best tolerance is 20%, which doesn't seem good enough if your bolding your must?

Also, under the maxim digipots interface column there is an option for up/down control, so all the other serial interfaces, (eg 3 wire serial) will be addressed by telling the digipot the value to output, (although some have dual serial interface and up/down)

Matt
 

Andrew Cowan

Senior Member
How accurate exactly does it have to be, the best tolerance is 20%, which doesn't seem good enough if your bolding your must?

It is to control another speed controller where 5K is neutral, so a neutral rc signal should equal a neutral speed controller. 20% seems a lot of drift - maybe the digital pot is not the best solution.

Also, under the maxim digipots interface column there is an option for up/down control, so all the other serial interfaces, (eg 3 wire serial) will be addressed by telling the digipot the value to output, (although some have dual serial interface and up/down)

That's what I thought - I haven't had any experience with any of them (except up/down control). I 'm not sure which of the other control options would be fastest with a PICAXE - has anyone had any experience with this?

Andrew

Edit: The datasheet for DS1867 claims it has a +-20% tolerence of end to end resistance. However, can tolerence change? As long as I know which input value gives a potential divider of two equal resistances, there is no problem. Tolenrence fluctuation would be the only problem. 3 wire serial does seem to be an easy solution.
 
Last edited:

BeanieBots

Moderator
Um.. low current RC speed controller. Why the digipots?
How about single "small" tranny driven by PWM?
Simpler, FASTER, smaller & cheaper.

If you want to control an analogue speed controller, then you can still use PWM to provide the 'POT' wiper voltage.

If you MUST use a digipot, then I2C will probably be the fastest.

Digipot would my LAST choice for such an app.
Slow, quantized, expensive and far too complex for such a simple task.
 

Gavinn

Member
Hi Andrew,

I used a Maxim DS1803 (http://pdfserv.maxim-ic.com/en/ds/DS1803.pdf) addressable dual digital pot in a recent project as a potential divider to feedback a voltage between 0 and 5v, you can use only a single side if you wish and leave the other for something else.

Addressable means you can write any value to it which meets your requirement. It is available (possibly as a free sample off the Maxim IC webpage) in 10k, 50k and 100k versions.

Here is my project and code for writing to it, it uses I2C and I'm sure you will get the idea by reading the code; http://geekhouse.weebly.com/pic-project---elevation.html
 

Wrenow

Senior Member
Andrew,

If you are wanting to do what I think you are wanting to do, you are probably better off with an ESC (Electronic Speed Controller) appropriately sized to the stall current of the motor chosen. Most of the hobby ESC's work off of a standard servo signal, so you just read servo pulsins, do whatever adjustment you want, and output a servo signal pulsout to the ESC for the result you want (the radio RTX can handle the 20ms timing. You can get very inexpensive aircraft type ESC's that are unidirectional (which is what you would get with a digital pot), but can also get bidirectional ESC's (for cars and boats - you don't want a plane's prop going wrong way 'round in the middle of a flight %-O ).

A cheap bidirectional solution - find a Radio Shack Vex motor (looks like a servo, sells for between US$10 and US$20) - it has an ESC built in that you can strip out if you want it separate - AND an appropriately sized motor, AND a gearbox, all in one easy-to-mount package.

Otherwise, you may be better off with PWM.

An important question - what type of motors are you wanting to run? Many are surprisingly power hungry. A 550 style (pretty common) may only draw 1-2 Amps with little load, but get them stalled and they can draw closer to 80-90 Amps (no, that is not a typo - check out the Mabuchi motor site).

You also might want to check out some of the motor control solutions from Pololu.com, DimensionEngineering.com, RobotPower.com, etc. or check the RobotMarketplace.com (probably the antweight section) for various offerings, as well as the various R/C hobby outlets.

I had thought of using a similar thing to whatr you are talking about to put into the Transmitter before the encoder (to have a computer controlled input), but, die to the tolerances, have figured it is probably best to PWM/filter it to get the oputput voltage needed. Plan to experiment along those lines as soon as I get some free time.

Cheers,

Wreno
 

Andrew Cowan

Senior Member
Hi Wreno

I am driving a speed controller that requires a potentiometer for an input. Your idea about the transmitter encoder is of a very similar idea, and is in itself a fun project I will add to my to do list.

Gavin - looks great, I'll order a couple and have a play with both the digi pots and PWM. 400ohm 1mA wiper is great.

Andrew
 
Last edited:

InvaderZim

Senior Member
Not sure that you need a digi pot, but assuming you do: the 20% tolerance is typical, but easily overcome if you calibrate your system. An individual digi pot should behave predictably once you calibrate to its specific behavior.
 

Andrew Cowan

Senior Member
Thanks for that - it's useful.

Thinking about it, if I don't use a wig-wag pot, it doesn't need to be quite as precise anyway.

A
 

jglenn

Senior Member
Andrew, what are the 2 outputs that are mixed? What are they running? A robot? How are they to be mixed?

You have a speed control with a pot input, measure the voltage across the pot, if it is 5V you can use PWM out with a filter, like a d/a conv, the control won't know the difference, just hook it to where the pot wiper input, and tie the grounds, good to go.

I have used digital pots with the up and down clock, non volatile, you need a special reason to employ them, a speed control might be able to be done without one. Initialization may be indeterminate, when you turn on the power.
 

Andrew Cowan

Senior Member
Andrew, what are the 2 outputs that are mixed?
Throttle, steering

What are they running? A robot?
Yes - a big 1500W robot.

How are they to be mixed?
Usual - throttle + steering to two channel's throttles

You have a speed control with a pot input, measure the voltage across the pot, if it is 5V you can use PWM out with a filter, like a d/a conv, the control won't know the difference,

Will it not? The controller is an AVR at 16MHz. It has some complex fault checking systems - eg it needs to see 10K accross the top and pottom pins of the pot.

hook it to where the pot wiper input, and tie the grounds, good to go.
Maybe.

I have used digital pots with the up and down clock, non volatile, you need a special reason to employ them, a speed control might be able to be done without one. Initialization may be indeterminate, when you turn on the power.

The speed controller has high potentiometer lock out, so this is not a problem.

Andrew
 

jglenn

Senior Member
The AVR speed control must be using an a/d input to sense the pot, nothing magic there. Not sure how it could know there is a 10K pot connected, would have to see the schem. If you can hook up a light bulb load instead of a motor, and a 0-5V power supply to the pot input, experimenting this way should not hurt anything. So if you get sudden full power the bulb will be bright, that's all.

Sounds like a powerful bot, I suggest some safety circuits. Learned this the hard way on an electric car, beefed up safety after a minor accident when it took off under full power and pushed a pickup truck in front of it across the street, just missing a mint 1962 caddy. You had to be in the seat (pressure switch),turn a kysw, the xmission had to be in neutral, the door had to be closed, then a yellow lighted pushbutton lit up.

Pushing the button enabled the power! :p
 

Andrew Cowan

Senior Member
The AVR speed control must be using an a/d input to sense the pot, nothing magic there.

Correct. Will the adc mind a PWM signal? The VAR runs at 16mHz.

Not sure how it could know there is a 10K pot connected, would have to see the schem.

There is a 330K pullup between the potentimeter +V pin and another adc pin. This reads the V+ pin as being 5V if the pot is disconnected.. If the 10K pot is connected, this acts as a pulldown on this input, meaning the input is low. Complex and clever.

If you can hook up a light bulb load instead of a motor, and a 0-5V power supply to the pot input, experimenting this way should not hurt anything. So if you get sudden full power the bulb will be bright, that's all.

Good idea.

Sounds like a powerful bot, I suggest some safety circuits. Learned this the hard way on an electric car, beefed up safety after a minor accident when it took off under full power and pushed a pickup truck in front of it across the street, just missing a mint 1962 caddy. You had to be in the seat (pressure switch),turn a kysw, the xmission had to be in neutral, the door had to be closed, then a yellow lighted pushbutton lit up.

Clever. Don't worry - I'll have plenty of safety features.

A
 

Dippy

Moderator
Clever... but "complex"? A nice bit of basic lateral sensible thinking I'd say. A good example of KIS.

Can you just put a 10K across where the pot 'ends' would be and PWM the pin which would have been connected to wiper? And like BB says: RC it.

Try it... it's only money.

That's a whopping robot.
Robot wars?
Or a wheelchair for fatties?
 

Tom2000

Senior Member
I just received an email from Analog Devices announcing a webinar titled "Understanding and Applying Digital Potentiometers."

The event will take place on January 21st at 1700 UTC.

Here's the registration link.

Enjoy!

Tom
 

Andrew Cowan

Senior Member
Clever... but "complex"? A nice bit of basic lateral sensible thinking I'd say. A good example of KIS.

Yes, but you can't just connect the top pin of the pot to 5V via a 330K resistor, or the max pot reading would be as if a 330K/10K potential divider was made.

Can you just put a 10K across where the pot 'ends' would be and PWM the pin which would have been connected to wiper? Try it... it's only money.


That's the current plan.

That's a whopping robot.
Robot wars?
Or a wheelchair for fatties?


Search and rescue robot for disaster zones (A level project). It weighs about 60kg at the moment. Are PICAXE's any less reliable when overclocked?

Andrew
 
Last edited:

hippy

Ex-Staff (retired)
Are PICAXE's any less reliable when overclocked?

That depends upon what one means by 'over-clocked'.

In most usage with respect to PICAXE's, over-clocking is considered to mean running them above the default 4MHz operating speed, usually using SETFREQ M8 to get them running at 8MHz, or by replacing a 4MHz crystal with 8MHz or 16MHz. For the current range of manufactured PICAXE that's all entirely within specification ( providing power supply voltages are correct for such speeds ).

As long as the PICAXE is used within its recommended envelope of operation it should not be any less reliable than at 4MHz.

Traditional over-clocking would be exceeding the recommended envelope of operation; using a 32MHz crystal where a maximum of 20MHz is stated, running at elevated voltages and so on. In such circumstances a PICAXE can become less reliable.
 

Dippy

Moderator
If you keep within the design parameters you will be OK.

Just one comment re turning up the wick:
If you have a look at Data Sheets you will see that as you turn up the oscillator speed you will have to give the PIC a higher voltage supply i.e. nearer the typical 5V.
Example:
16F886
Code:
Fosc		Supply Voltage
<=8MHz intosc	2.0 to 5.5V
<=4MHz		2.0 to 5.5V
<=10MHz		3.0 to 5.5V
<=20MHz         4.5 to 5.5V
I once hugely overclocked a dsPIC way past it's spec. (accidentally, honest)
It got Fot fuick!
 
Top