Go to Post Yeah, if we didn't have robots then we could concentrate on all that outreach stuff! - marshall [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 27-01-2007, 08:46
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 454
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: Digital to OI Analog

Quote:
Originally Posted by Stuart View Post
well Ill give credit to where credit is due.

the reason I suggested using a digital pot is because I spent most of last semester(in bits and peaces on weekends) building team lightnings ps2-15pin analog adapter.

so not only is it possible to run digital pots with a micro controller . . its been done and tested.
Yes, I remember you guys from nationals. I believe you used a multiplexing circuit of some kind. You were in our division last year. You had a pit on the same end as us right on the isle. Yes, It is possible. That is not being disputed. I was just pointing out that you most likely will not get the full range from the digpots due to there tolerances.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
  #17   Spotlight this post!  
Unread 28-01-2007, 12:19
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 marcan View Post
Has anyone tried interfacing digitally generated signals to the OI? Everyone seems to be using potentiometers like the original joysticks, but using a DAC is obviously possible (see the USB-Chicklet). Does anyone know what the requirements are for the analog inputs of the OI? Given a schematic of the OI input section it should be very easy to design a circuit that works as intended, but I need to know what the inputs rely on to tell what the joystick value is.

My guess is they have a fixed resistor to GND and use the pots (wired to +5 on the joystick) to form a voltage divider, which is then measured using a PIC's A/D converters. In this case, driving a constant-voltage output (buffered using an op-amp if needed) would essentially make the resistor meaningless and allow you to directly control the input proportional to the applied voltage (from an A/D converter, for example). However, many other input systems are possible, including using capacitors to form an R/C circuit and measuring the time it takes to charge/discharge, or using a more complicated arrangement with resistors.
The following information is based on my own observations of the 2007 OI.

The analog joystick inputs are multiplexed at approximately 38Hz (which is the same as the PWM output period) into what appears to be a current sink, set for about 45uA. When 100K Ohms are presented between the +5Aux pin and the analog input, the resulting voltage will be approximately 0.5V.

Although IFI's documentation states that In the event that an analog value is less than 0.05V, a value of 127 will be generated., in reality that voltage is closer to 0.5V (500mV) than 0.05V (50mV). I measured something closer to 632mV.

When the 100K pot is at one extreme, the voltage at the analog input is obviously equal to the +5VAux voltage, and at the other extreme, will be in the 500-600mV range. For the sake of this discussion, I'll use round numbers and use 4.5V for the entire input voltage span. Dividing the span by 256 yields approximately 17.6mV per A/D count.

I should add a note at this point that unless you utilize something like an accurate oscilloscope to observe the analog inputs with just a pot connected, you won't be able to see how IFI's input circuit works.


Given that the analog input is driving a current sink and digitizing the resulting voltage, supplying the analog input with a voltage is relatively straight forward. The primary consideration is that the voltage source be able to handle the multiplexed current sink load, which should be no problem as long as the output impedance of your circuit is sufficently low.

How low is good enough you ask? If one A/D count is 17.6mV and the current sink is 45uA, then roughly 391 ohms of series resistance between an ideal voltage source and the analog input will result in one A/D count error.


Due to the fact that the +5Aux line is current limited, the other source of potential error comes from any voltage drop introduced by loading this power source. It appears that rather than using the +5Aux line as the upper reference of the A/D conversion, IFI is instead using the voltage from the other side of their current limiting circuit, hence the errors that are introduced when the +5Aux line is externally loaded.

By placing a few different resistive loads on this power output, I noted that the current limit may not strictly be something like a current sense resistor coupled with a high side switch, such as a MOSFET, as the impedance appears to vary slightly. Whatever it may be, I measure an effective resistance of 3 to 4 Ohms across a 10 to 100mA range.

Assuming a series resistance of 4 ohms, an error of a single A/D count would be introduced with about 4.4mA of loading on the +5Aux pin.

Clearly if an external circuit's current demand can be held to something in the 10-30mA range only a few percent of the overall A/D range is sacrificed.


The other source of "power" available on some of the joystick interfaces, are the eight outputs intended to be used for lighting LED's.

These outputs are current limited outputs but are NOT based on a 5V supply. The unloaded voltage on these outputs is approximately 2.5V less than the voltage supplied to the OI (as measured from the tether input... I didn't check the coaxial input, nor the competition port input). That 2.5V difference tracks fairly linearlly as the power applied to the OI is varied.

From a current limiting standpoint, the effective series resistance appears to be on the order of 500 ohms. So if the unloaded voltage were 5V, the short circuit current would indeed be limited to 10mA.

With the RC powered from 12V, the voltage at the OI tether input is about 0.5V less, and the unloaded LED output will be about 9V, and the short circuit current was measured at about 18mA.

IF a custom interface circuit were designed to power itself from the LED outputs, it would of course become dependant on the limitations of the RC programming to keep the interface powered. Multiple outputs could be combined (used diode blocking just to be safe) to increase the available current.


Returning attention to the more practical source of power, the +5V Aux line, one could design a boost supply and then regulate the output back down to +5V in order to drive the analog inputs across their full range... however one still needs to consider the tolerancing of IFI's reference voltage versus the voltage generated by the switching supply. For a one-of-a-kind design, clearly just providing a trim pot, or hand selecting components, to trim the supply to match an individual OI could work just fine, but on a production basis would not be practical.

The other potentially tempting method of matching the supply to the OI would be to servo the supply to one or more of the switch contact inputs which are internally pulled to 5V. The problem here is that the +5Aux voltage appears as though it may be seperately derived. The one I was working with measured about 50mV higher on the +5Aux power versus any of the other controller inputs or outputs measured on the other OI connectors.

A switching power supply would require some careful design so as not to adversely effect other devices dependant on the +5Aux power, as well as protection from generating voltages high enough to damage other inputs on the OI.


Additions and corrections invited.
__________________
--Dave
  #18   Spotlight this post!  
Unread 28-01-2007, 16:39
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 454
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: Digital to OI Analog

Quote:
Originally Posted by Dave K. View Post
The following information is based on my own observations of the 2007 OI.

The analog joystick inputs are multiplexed at approximately 38Hz (which is the same as the PWM output period) into what appears to be a current sink, set for about 45uA. When 100K Ohms are presented between the +5Aux pin and the analog input, the resulting voltage will be approximately 0.5V.

Although IFI's documentation states that In the event that an analog value is less than 0.05V, a value of 127 will be generated., in reality that voltage is closer to 0.5V (500mV) than 0.05V (50mV). I measured something closer to 632mV.

When the 100K pot is at one extreme, the voltage at the analog input is obviously equal to the +5VAux voltage, and at the other extreme, will be in the 500-600mV range. For the sake of this discussion, I'll use round numbers and use 4.5V for the entire input voltage span. Dividing the span by 256 yields approximately 17.6mV per A/D count.

I should add a note at this point that unless you utilize something like an accurate oscilloscope to observe the analog inputs with just a pot connected, you won't be able to see how IFI's input circuit works.


Given that the analog input is driving a current sink and digitizing the resulting voltage, supplying the analog input with a voltage is relatively straight forward. The primary consideration is that the voltage source be able to handle the multiplexed current sink load, which should be no problem as long as the output impedance of your circuit is sufficently low.

How low is good enough you ask? If one A/D count is 17.6mV and the current sink is 45uA, then roughly 391 ohms of series resistance between an ideal voltage source and the analog input will result in one A/D count error.


Due to the fact that the +5Aux line is current limited, the other source of potential error comes from any voltage drop introduced by loading this power source. It appears that rather than using the +5Aux line as the upper reference of the A/D conversion, IFI is instead using the voltage from the other side of their current limiting circuit, hence the errors that are introduced when the +5Aux line is externally loaded.

By placing a few different resistive loads on this power output, I noted that the current limit may not strictly be something like a current sense resistor coupled with a high side switch, such as a MOSFET, as the impedance appears to vary slightly. Whatever it may be, I measure an effective resistance of 3 to 4 Ohms across a 10 to 100mA range.

Assuming a series resistance of 4 ohms, an error of a single A/D count would be introduced with about 4.4mA of loading on the +5Aux pin.

Clearly if an external circuit's current demand can be held to something in the 10-30mA range only a few percent of the overall A/D range is sacrificed.


The other source of "power" available on some of the joystick interfaces, are the eight outputs intended to be used for lighting LED's.

These outputs are current limited outputs but are NOT based on a 5V supply. The unloaded voltage on these outputs is approximately 2.5V less than the voltage supplied to the OI (as measured from the tether input... I didn't check the coaxial input, nor the competition port input). That 2.5V difference tracks fairly linearlly as the power applied to the OI is varied.

From a current limiting standpoint, the effective series resistance appears to be on the order of 500 ohms. So if the unloaded voltage were 5V, the short circuit current would indeed be limited to 10mA.

With the RC powered from 12V, the voltage at the OI tether input is about 0.5V less, and the unloaded LED output will be about 9V, and the short circuit current was measured at about 18mA.

IF a custom interface circuit were designed to power itself from the LED outputs, it would of course become dependant on the limitations of the RC programming to keep the interface powered. Multiple outputs could be combined (used diode blocking just to be safe) to increase the available current.


Returning attention to the more practical source of power, the +5V Aux line, one could design a boost supply and then regulate the output back down to +5V in order to drive the analog inputs across their full range... however one still needs to consider the tolerancing of IFI's reference voltage versus the voltage generated by the switching supply. For a one-of-a-kind design, clearly just providing a trim pot, or hand selecting components, to trim the supply to match an individual OI could work just fine, but on a production basis would not be practical.

The other potentially tempting method of matching the supply to the OI would be to servo the supply to one or more of the switch contact inputs which are internally pulled to 5V. The problem here is that the +5Aux voltage appears as though it may be seperately derived. The one I was working with measured about 50mV higher on the +5Aux power versus any of the other controller inputs or outputs measured on the other OI connectors.

A switching power supply would require some careful design so as not to adversely effect other devices dependant on the +5Aux power, as well as protection from generating voltages high enough to damage other inputs on the OI.


Additions and corrections invited.

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.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
  #19   Spotlight this post!  
Unread 28-01-2007, 17:30
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: Digital to OI Analog

yeah I think were talking about the difference between "a hack" and "a solution".

the Chicklet is a solution that can be mass produced and will always work. the digipot and MC is a hack that you can get to work.
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
  #20   Spotlight this post!  
Unread 28-01-2007, 17:56
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 454
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: Digital to OI Analog

Quote:
Originally Posted by Stuart View Post
yeah I think were talking about the difference between "a hack" and "a solution".

the Chicklet is a solution that can be mass produced and will always work. the digipot and MC is a hack that you can get to work.
So..... by your definition, the Chicklet is a hack....... because the above prescribed solution is EXACTLY how the Chicklet interfaces to the O/I.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
  #21   Spotlight this post!  
Unread 28-01-2007, 18:12
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: Digital to OI Analog

no Im talking about my solution(hack) with the pic and a digi pot only(no voltage devider, or fancy things like that)
this is all in the context of the original question of how to split a analog channel in to more than 1 digital channels
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.

Last edited by Stuart : 28-01-2007 at 18:17.
  #22   Spotlight this post!  
Unread 28-01-2007, 19:12
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 454
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: Digital to OI Analog

Quote:
Originally Posted by Stuart View Post
no Im talking about my solution(hack) with the pic and a digi pot only(no voltage devider, or fancy things like that)
this is all in the context of the original question of how to split a analog channel in to more than 1 digital channels
I know. The digital pot IS the voltage divider. This is exactly what you are trying to accomplish. There is nothing fancy about it. You make a variable voltage divider out of the DIG pot. This is very easy to do.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
  #23   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
  #24   Spotlight this post!  
Unread 28-01-2007, 20:08
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 Stuart View Post
no Im talking about my solution(hack) with the pic and a digi pot only(no voltage devider, or fancy things like that)
this is all in the context of the original question of how to split a analog channel in to more than 1 digital channels
Hello Stuart,

What you are doing, and what Mike has done on the Chicklet, are essentially the same except that he's encouraging you to add one resistor (per channel) so that you don't throw away 10% of your pot's resolution. If you make your series resistor a trim pot, or hand select the resistor, you can remove the error introduced due to the absolute value of a given digital pot.


The origional poster, Marcan, was interested in the "how-to" aspect of interfacing to the OI, and I think someone else had brought up multiplexing.

Marcan was also talking about pulling power from the joystick connector, and I'm not sure anyone had addressed how to calculate the error that will result from doing so... so I elected to explore that topic in a way that hopefully would provide some insight as to how to make a personal decision on how much is too much, and what the tradeoff's are.

From my own exploration of this interface, I found some things that disagree with what IFI has documented, and those were included in my posting, and have also been brought to the attention of IFI in case they want to correct, or clarify, those portions of their user manual.

Thanks,
__________________
--Dave
  #25   Spotlight this post!  
Unread 28-01-2007, 20:44
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: Digital to OI Analog

OHHHH ok I see I thought he was saying run the pot from a voltage divider not as part of one.

that makes a lot of sense. and might be a good idea for the next time I build one(the current one Ive got seams to be spot on as far as tolerance so maybe I got lucky).
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
  #26   Spotlight this post!  
Unread 28-01-2007, 21:18
marcan marcan is offline
Registered User
AKA: Hector Martin
FRC #2117 (Wolvotics)
Team Role: Engineer
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Carrollton, GA
Posts: 14
marcan will become famous soon enoughmarcan will become famous soon enough
Re: Digital to OI Analog

Thanks everyone for the comments. This certainly clarifies a lot of the details about the OI.

Right now, I'm considering two options: a 100K digipot in rheostat mode (the "hack") or the 10+1K divider. I'll probably end up trying both, and see how they behave.

On the subject of DACs and op-amps (or op-amps with the digipots), how would you deal with the range limitations of the op-amp? Even rail-to-rail op-amps aren't truly rail-to-rail (they just get close). Would you be able to use the full input range using an op-amp?

As for the +5V Aux supply, I'm pretty sure it'll meet my needs, based on Dave's info and my own testing, as far as the power required goes. A more important aspect is how the voltage drop due to the current limitation affects the analog inputs when the current is higher and the voltage drops. I'll do some testing once the components arrive.
  #27   Spotlight this post!  
Unread 28-01-2007, 22:39
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 454
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: Digital to OI Analog

QUOTE=Dave K.;567119]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.[/quote]


Dave, using an ADC is the best way to interface to the O/I. The Rev2 Chicklet will use an ADC. We realized the short commings of using the digpot when we got our first batch of pots in the lower end of the spectrum. Although we anticipated it, we thought the tolerances were on the conservative side. We developed a way to test the pots prior to assembly. We sorted them out into seperate groups based on there A to B resistance. This was tedious and not very cost effective due to the fact that we needed to purchase about 33% more pots than we actually needed in order to get enough that were within our spec. As far as elaborating on the voltage divider. It is very simple to overcome the tolerance issues. The 10k pots are actually a little better than the 100k. They vary from 8k to 12k. The object is to keep the offset resistor value within 10% of the pots AB resistance. One way to do this is to use another 10k pot as the offset resistor. That way you can adjust the offset value in software. The offset resistor is not just for allowing full range, actually it's primary purpose is to prevent the input of the O/I from going to ground. If this condition is allowed the O/I will read 127. Another way to calibrate with software is to use a second digpot to adjust the input voltage to the voltage divider pot. The idea is to make it so the center is 127. That is more important than getting full range. Most digpots have a hardware/software shutdown mode. This puts the wiper to center. This is very usefull. But only if the center is 127 on the O/I. If for some reason your device is not connecting to your controller you need a safe state for the interface to go to. This is an effective way to interface to the O/I. But I would still suggest the 10 bit ADC.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
  #28   Spotlight this post!  
Unread 29-01-2007, 03:35
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 marcan View Post
Thanks everyone for the comments. This certainly clarifies a lot of the details about the OI.

Right now, I'm considering two options: a 100K digipot in rheostat mode (the "hack") or the 10+1K divider. I'll probably end up trying both, and see how they behave.

On the subject of DACs and op-amps (or op-amps with the digipots), how would you deal with the range limitations of the op-amp? Even rail-to-rail op-amps aren't truly rail-to-rail (they just get close). Would you be able to use the full input range using an op-amp?
Well one op-amp you could consider would be something like the Burr-Brown (now TI) OPA363 series. Worst case, with a 10k load, which is more than the OI effectively presents, it will get within 20mV (worst case) of V+ and typically within 10mV. That's one I spotted, and I'm sure there are others that would work OK.

As I think I mentioned earlier, you'd need something capable of handling the dynamic loading presented by the multiplexing that the OI uses to scan the channels. There are of course capacitive loading effects as the analog switch selects the channel, and then the load of the current sink.

In the case of the OPA363, it is specified driving a 10k load, which is an order of magnitude greater than the load presented by the OI. Other op-amps that come this close to the rails, are specified at even higher resistances, such as 100k, and may not handle the switched load without introducing some additional error.

As I wrote earlier, I chose not to go down this road for different reasons, and you've certainly highlighted one additional concern that further justifies not pursuing this approach.

Quote:
Originally Posted by marcan View Post

As for the +5V Aux supply, I'm pretty sure it'll meet my needs, based on Dave's info and my own testing, as far as the power required goes. A more important aspect is how the voltage drop due to the current limitation affects the analog inputs when the current is higher and the voltage drops. I'll do some testing once the components arrive.
If you can make good use of your microprocessor's sleep mode, and provide some local capacitance buffered by a series resistor, I think its probable that one could succeed in not loading the +5V aux supply enough for the OI to notice.

For my own interface, I'm faced with powering a 12-13mA device in addition to my interface electronics, so that will already pull the supply down by a few A/D counts. In a practical sense, it doesn't really matter if we loose some resolution in joystick position. Heck we already toss out more bits in the deadband region just to avoid robo-creep when the joystick is a couple knat hairs shy of being truely centered.
__________________
--Dave
  #29   Spotlight this post!  
Unread 29-01-2007, 04:05
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

Dave, using an ADC is the best way to interface to the O/I. The Rev2 Chicklet will use an ADC. We realized the short commings of using the digpot when we got our first batch of pots in the lower end of the spectrum. Although we anticipated it, we thought the tolerances were on the conservative side. We developed a way to test the pots prior to assembly. We sorted them out into seperate groups based on there A to B resistance. This was tedious and not very cost effective due to the fact that we needed to purchase about 33% more pots than we actually needed in order to get enough that were within our spec. As far as elaborating on the voltage divider. It is very simple to overcome the tolerance issues. The 10k pots are actually a little better than the 100k. They vary from 8k to 12k. The object is to keep the offset resistor value within 10% of the pots AB resistance. One way to do this is to use another 10k pot as the offset resistor. That way you can adjust the offset value in software. The offset resistor is not just for allowing full range, actually it's primary purpose is to prevent the input of the O/I from going to ground. If this condition is allowed the O/I will read 127. Another way to calibrate with software is to use a second digpot to adjust the input voltage to the voltage divider pot. The idea is to make it so the center is 127. That is more important than getting full range. Most digpots have a hardware/software shutdown mode. This puts the wiper to center. This is very usefull. But only if the center is 127 on the O/I. If for some reason your device is not connecting to your controller you need a safe state for the interface to go to. This is an effective way to interface to the O/I. But I would still suggest the 10 bit ADC.
I agree that having to sort parts is not a cost effective way to go about manufacturing.

Having been at this a while, I've had designs that despite our best efforts to design to worst case tolerances, the manufacturer's let us down and provided parts well outside of their worst case specifications... and these are large, well respected companies that had the pipelines full of parts before we flagged the problem for them.

When it comes to semiconductors, design to worst case, and if possible, even a bit beyond that.


One of the reasons the AD5314 was a good fit was that its own power on reset set's the output to zero. I'm sure there are other, less costly, devices that would also work well and also provide a power on reset to zero... but this was the one that was available quickly.

Thanks,
__________________
--Dave
  #30   Spotlight this post!  
Unread 29-01-2007, 05:47
marcan marcan is offline
Registered User
AKA: Hector Martin
FRC #2117 (Wolvotics)
Team Role: Engineer
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Carrollton, GA
Posts: 14
marcan will become famous soon enoughmarcan will become famous soon enough
Re: Digital to OI Analog

Quote:
Originally Posted by Dave K. View Post
If you can make good use of your microprocessor's sleep mode, and provide some local capacitance buffered by a series resistor, I think its probable that one could succeed in not loading the +5V aux supply enough for the OI to notice.
I'm not at all concerned with the interfacing PIC uC. The power usage of this is probably going to be very small compared with everything else. My main power hogs are external devices (over which I have little control, outside of disabling a few LEDs to avoid their power draw). However, the good news is that the worst-case power draw is not supposed to occur during normal operation, as the software should be able to configure the devices. Specifically, I want to be able to run a PS2 controller, and a Wii controller (I'm testing out different control schemes. I wonder how practical the Wii controller will be for manipulating a mechanism on the robot). With the Wii controller goes a Bluetooth module of course. Mostly everything is designed to run off of low power, but there are peaks in power usage during initialization mostly (the Wii controller blinks the LEDs which would be disabled later on via software, and the Bluetooth module uses more power during discovery). However, since the peak (init worst-case) power is well under 100mA, and the running power should be significantly under that, I think it should be doable. Everything is going to be powered off a 3V-ish buck converter (adjusted for efficiency).

Quote:
Originally Posted by Dave K. View Post
In a practical sense, it doesn't really matter if we loose some resolution in joystick position. Heck we already toss out more bits in the deadband region just to avoid robo-creep when the joystick is a couple knat hairs shy of being truely centered.
Pretty much the same here - I seriously doubt full resolution is going to be very important, since humans are very good at mentally calibrating such things out. The USB-Chicklet needs to work reliably and accurately (as if the USB joysticks were regular ones), but for our one-off I'm sure we can work out any little kinks in software. Here's an idea: if your current draw varies, you can tie extra inputs on the OI to GND+0.5 and +5V, and use them to do runtime scaling of the inputs on the RC to compensate for any differences.

Crazy idea: wonder how much power the Wii controller's rumble uses? Probably too much, but I'll still give it a go for kicks. If anything, we could have some fun out of competition making the rumble activate when the accelerometers on the robot measure acceleration over a certain threshold.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Analog-to-Digital Converter Code Kevin Watson Programming 29 17-02-2008 13:07
Analog to Digital Conversion Help Der Rowan Programming 4 23-01-2006 00:17
Accelerometer: Analog or Digital? psquared Programming 2 10-02-2005 16:38
Analog / Digital IO Connectors Aidan F. Browne Control System 4 06-02-2005 22:26
Analog vs Digital inputs? f22flyboy Programming 8 08-11-2002 22:18


All times are GMT -5. The time now is 05:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi