View Single Post
  #9   Spotlight this post!  
Unread 28-01-2007, 19:50
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Digital to OI Analog

Quote:
Originally Posted by Mike Copioli View Post
Here I will save you all the trouble of reading this and the headache of trial and error.


Use a 10k ohm Digpot as a voltage divider with a 1k ohm resistor between ground and one leg of the voltage divider. Tie the other lead to 5v. Connect the wiper to the analog input of the O/I. The 1k ohm resistor creates the 500mv drop necessary to offset the input to the O/I. We use the MCP42010 digital pot. This will work perfectly however you will need to play with the input voltage and the R-value to get the correct range and center. Of course since the MCP42010 has a tolerance of %20, the values needed to calibrate are unique to each POT.
Hello Mike,

Thanks for contininuing the discussion... and perhaps I should appologize for being a bit of a wind bag coupled with the ability to type. ;-)

As neither IFI nor, apparently, anyone else had taken the time to provide a complete summary of the joystick interface, I did feel that it was important for anyone considering going down that this path to be aware that there are several things to consider when engineering something that will work, as-is, with this interface, and within FIRST's current rules.

Aside from considering how to do the digital to analog conversion, and its pitfalls, the other significant consideration, as I'm certain you will acknowledge, is the question of how to power it.

Your situation is unique in that it has been granted an exception to the rule of external power. Clearly any device intending to act as a USB host could not be powered from the OI... it just would not work.

For something less complicated that only needs to consume a 10-20mA, the problem is certainly much more manageable/tolerable.


Shifting the discussion to/back to, implimentation specific details...

As you correctly point out, using a digital pot comprised of a tapped string of polysilicon resistors is succeptable to large errors when used in an application where an absolute resistance value is important. Your solution of adding a series resistor to lift one end of the pot off ground is a good solution for making a 10K pot work, whether it be digital or analog. Perhaps for the benefit of others you could expand upon how you compensate for the poor absolute tolerencing of the digital pot.

Polysilicon resistors work well in ratiometric configurations such as a simple voltage divider (as in the case of a digital pot) or R-2R ladder configurations because on any given die, the resistors will be matched well in terms of ratios, even though the absolute values vary over a wide range (from die to die).

For my own purposes, I had also considered configuring a pot as you suggested, as well as simply using a 100K pot with only two connections, but decided that I wanted to avoid the tolerancing problem without trading off resolution, or individually compensating each device... which is a valid design descision. Alternately, you could create a common, low impedance, 500mV voltage source to tie the pot to.

I then considered using the pot strictly ratiometrically (i.e. tied between +5 and gnd) and using an op-amp to sum the wiper with an offset voltage to push the zero value up without sacrificing resolution, and to have a low impedance output to minimze that error.... but that all took up space I didn't have.

A more traditional R-2R, multiplying DAC coupled with an external op-amp and offset voltage would be another way to accomplish the same thing at about the same cost and component count.

In the end, I chose to use a 10bit, voltage output, quad DAC. In particular, an Analog Devices AD5314. I chose this part more for size and immediate availability, than for reasons of cost. The higher resolution allows for the 500mV offset to be removed in software without loosing the ability to hit each of the 8 bit A/D converter 'bins' as seen by the OI.


Anyone considering designing something that will work within the constraints of IFI's joystick interface is bound to have their own reasons for wanting to do so, and there are a number of ways to solve these interface problems, each with their own set of pro's and con's.

Perhaps in the future, FIRST and/or IFI will afford us with a more flexible operator interface. Usable power and a serial port would be excellent additions, but I wouldn't take away the existing interface as it is quite usefull in its own right.



Thanks,
__________________
--Dave