![]() |
Digital to OI Analog
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. Has anyone taken apart their OI? I'm going to assume it's been the same over the past few years. A schematic or picture from the input section of a 2005 OI would be awesome :) |
Re: Digital to OI Analog
well each port has 4 digital inputs.
but if you want more go to digikey and look up 256step 100k ohm digital potentiometers. you can use that to split 1 analog signal in to 8 digital switches(note the RC would still see it as analog, but you could control it digitaly). |
Re: Digital to OI Analog
First, the inputs take voltages. You can see that on page 5 of the Operator Interface Reference Guide. So no need to take apart your OI when IFI tells you what's going on there.
Second, I don't think there's been a lot of research into this area. This is mostly due to: A. You're limited to the 100mA you can pull from the 5V pin, and probably less. and B. There's only so much you can do giving the RC a byte at a time using the OI. Well. B is mostly my opinion. But I'm not really seeing what, aside from the USB chicklet, you can do with a highly custom circuit at the OI that you couldn't do with a simpler circuit and some processing or a custom circuit on the RC. All I can come up with at the moment is some sort of up-down counter to give you very precise control over the value of the byte with a 7-segment display to tell you what you're outputting. Except that's quite likely to exceed 100mA and, again, you could do it in software on the RC and the user byte. Mostly I think the 5V, 100ma limit is just too restrictive for teams to do much fancy stuff. |
Re: Digital to OI Analog
I could certainly use the digital inputs, but it would be a waste at only 16 available bits (I'd need to multiplex, and for that I'd need to either synchronize to the packet stream or go real slow, which would be a pain)
The digital pots do look like a good solution, and they're not too expensive either. Specifically, these (from Microchip, hah) look like a pretty good choice at $2.65 each (we'll probably use three or four of them to give 6 or 8 inputs). http://www.digikey.com/scripts/DkSea...604125&Site=US http://ww1.microchip.com/downloads/e...Doc/11195c.pdf Thanks for the answer! I'd completely forgotten about digital potentiometers. Out of curiosity still though, does anyone know what the input section of the OI looks like? |
Re: Digital to OI Analog
If you understand what the Joysticks do, then you'll better understand what the OI expects to see.
Look at the schematic I posted some time ago. Easily found by searching.... Don |
Re: Digital to OI Analog
Quote:
Quote:
Quote:
Quote:
Quote:
And, using the same theory with different things interfaced to the PIC, you could use pretty much anything. Quote:
Quote:
|
Re: Digital to OI Analog
Quote:
|
Re: Digital to OI Analog
)
Quote:
If you choose to use the digital pots, make sure you read the data sheet very carefully. They have a tolerance of +-30%. So that means you could get a pot that has a value of 70k to 130k. Also in order to use the pots you must interface the to a device with SPI or I2C. Another words you will need a processor. Processors need power, usually more than the 10mAs supplied by the digital outputs. In short you will need an external power source, which you know, is illegal. This is one of the difficulties that we were faced with when developing the Chicklet. |
Re: Digital to OI Analog
Quote:
Quote:
Also, if we really wanted to use a high-current custom circuit, we could just buy the USB-Chicklet, and use it and a USB PIC to get 500mA. |
Re: Digital to OI Analog
Quote:
Actually you are over estimating the power output of the joystick port. I'm not quite sure were the 100mA is coming from. I assure you it is not from the joyports. LED Drivers (see pinouts on pages 7-10) PORT 1 and PORT 3 each provide four LED output drivers. These LED drivers allow the connection of external LEDs that duplicate the function of the top eight Robot Feedback LEDs on the Operator Interface. The LED drivers provide 5V that is current limited to 10mA. Connect the LED’s anode to the desired LED drive pin. Connect the LED’s cathode to any ground pins. The LED drivers are the only way for you to get Power. They are limited to 10mA. If you are thinking of using the 5Vaux pin, that is limited to a value in uA. So unless you are sleeping your processor 90% of the time, you can not get enough power to run your device. Trust me, If there was a way to get power off of the O/I we would have. I guess if you can get your power consumption below 10mA you would be ok. But you still have to deal with the abysmal tolerances of the MCP42100. |
Re: Digital to OI Analog
Mike,
The 100ma is coming from the OI reference Guide. It says the current limit on the +5V aux pin is 100ma for all 4 ports. If the practical limit is significantly lower than this by a factor of 10 for some reason... well it'd be nice to know, and it'd be nice if IFI updated the reference. EDIT: Finished your post. MICROamps on the 5V aux? The reference clearly says 100mA. If the limit is truly microamps, then IFI really needs to update this document. |
Re: Digital to OI Analog
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. |
Re: Digital to OI Analog
I just tested my OI to 100mA from Port 1 Aux (pins 1 and 4) running two (overloaded) white LEDs. Multimeter measures 100mA, voltmeter measures 4.5V. Okay, so the voltage does drop a bit, but I intend to run 3.3V circuitry using a switching buck regulator anyway, and 4.5V will still work fine for most 5V ICs too. My calculations say worst-case the aux circuits will draw 100mA at 3.3V, which is 66mA at 4.5V and 60mA at 5V (remember, this is a switching regulator, not a linear one, so it ideally does not waste any power). Even with some extra stuff thrown in (LEDs, DC-DC inefficiency, etc), I still have room.
|
Re: Digital to OI Analog
Quote:
I was basing the aux rating on information given to me by IFI. And you should read this more carefully. [5] The current limit of the +5V Aux from all 4 ports is about 100mA. The Aux Fault Led will start illumination when the current draw from the +5V Aux Outputs total about 120 mA and the +5V Aux voltage will have dropped to about 4.5 volts. Worse case, short condition: after about 30 seconds, the voltage will be at about 300 mV with a current of about 250 mA. The limit from ALL FOUR PORTS is 100 mA. (This means all four added together.) When the outputs exceed 120mA the Fault LED will Illuminate. And it clearly states that after 30 seconds the voltage will be clamped to 300mV. If you do further testing you will come to the inevitable conclusion that you cannot get 100mA from one joyport continuosly. |
Re: Digital to OI Analog
Quote:
You may get lucky for about a minute of continuous use, but I assure you you will be operating the O/I out of spec. A good design sould be created so that it meets the specs called out by the data sheets and operational specifications. If your TOTAL current consumed by ALL 5v AUX pins is greater than 100mA you run the risk of the voltage being clamped to 300mV. We have done extensive testing with the O/I and this does happen. |
Re: Digital to OI Analog
Quote:
|
Re: Digital to OI Analog
Quote:
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. |
Re: Digital to OI Analog
Quote:
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. |
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. |
Re: Digital to OI Analog
Quote:
|
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 |
Re: Digital to OI Analog
Quote:
|
Re: Digital to OI Analog
Quote:
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, |
Re: Digital to OI Analog
Quote:
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, |
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). |
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. |
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. |
Re: Digital to OI Analog
Quote:
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:
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. |
Re: Digital to OI Analog
Quote:
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, |
Re: Digital to OI Analog
Quote:
Quote:
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. |
Re: Digital to OI Analog
Quote:
Quote:
Again, the input sample rate is ~38Hz. Quote:
|
Re: Digital to OI Analog
Quote:
R66: Quote:
Either way though, we'll have alternative control methods available, both because of the possibility of having the Wiimote denied, and to see which is more practical. If nothing else, we can still use the Wiimote out of the field :) Quote:
Quote:
|
Re: Digital to OI Analog
Quote:
Quote:
|
Re: Digital to OI Analog
Quote:
<R63>, <R66>, and Section 3.14.3, make it reasonably clear that other than the 900MHz radios, no wireless communication is permitted. The one exception is <R109>, but that doesn't apply here. This may be helpful: http://forums.usfirst.org/showthread...ight=bluetooth |
| All times are GMT -5. The time now is 17:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi