Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Digital to OI Analog (http://www.chiefdelphi.com/forums/showthread.php?t=52835)

marcan 26-01-2007 21:28

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 :)

Stuart 26-01-2007 21:36

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

Kevin Sevcik 26-01-2007 21:51

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.

marcan 26-01-2007 22:02

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?

DonRotolo 26-01-2007 22:13

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

marcan 26-01-2007 22:25

Re: Digital to OI Analog
 
Quote:

Originally Posted by Kevin Sevcik (Post 566038)
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.

Quote:

Each port provides four analog inputs. These inputs are typically connected to joysticks and
potentiometers, providing an analog input ranging from 0 to 254 (in software) that is transmitted to the
Robot Controller.
They never mention what the requirements for wiring up anything other than potentiometers are. You can sort of guess they take raw voltages too from their description (which is what I described, using a resistor as a pull-down for pots in joysticks), but it's never really described in any sort of detail.

Quote:

Originally Posted by Kevin Sevcik (Post 566038)
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.

100mA can go a long way for sensor-related electronics. Microcontrollers can use very little power if the code is done right, and sensors also really don't use that much power. Really, the only way you're going to reach that limit is if you use bad design or already-built modules, or things like LEDs.
Quote:

Originally Posted by Kevin Sevcik (Post 566038)
B. There's only so much you can do giving the RC a byte at a time using the OI.

8 analog inputs is 8 bytes, which is plenty for many control systems.

Quote:

Originally Posted by Kevin Sevcik (Post 566038)
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.

Easy example: PS2-Chicklet. Interfacing to the PS2 joystick interface is much easier than USB, and I think it could be done with less than $10 in parts. Have a microcontroller read in the digital values and output them to a digital potentiometer. If we finally decide to use gamepad control, and it turns out the digital pots work well, we're definitely not going to be using the USB-Chicklet - I already have tons of PIC microcontrollers lying around, and PS2 controllers are basically free since pretty much everyone has one lying around. No need to spend $130 on the Chicklet.

And, using the same theory with different things interfaced to the PIC, you could use pretty much anything.

Quote:

Originally Posted by Kevin Sevcik (Post 566038)
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.

Software would work in that case, definitely. Even then though, that would definitely not exceed 100mA if you use low power for the LEDs or an LCD module instead (LEDs do draw relatively lots of power - one is okay, but a bunch of displays definitely exceed 100mA)

Quote:

Originally Posted by Kevin Sevcik (Post 566038)
Mostly I think the 5V, 100ma limit is just too restrictive for teams to do much fancy stuff.

It certainly could be larger (say 500mA), but 100mA is still enough to get some play out of things. Also, as far as what I plan to connect goes, the limit probably stretches to 120mA, which according to the IFI docs would limit voltage to 4.5V (still fine for my circuit). Remember, there are tons of things out there that run on little bitty AAA batteries, and those things don't really store that much energy. It just takes some low-power design. I'm really considering using a certain device which draws around 50mA worst-case (and it's a pretty advanced device). You'll hear more about it if it works out.

marcan 26-01-2007 22:27

Re: Digital to OI Analog
 
Quote:

Originally Posted by Don Rotolo (Post 566061)
If you understand what the Joysticks do, then you'll better understand what the OI expects to see.

There are many different ways to measure a 100K resistor. Short of a digital potentiometer (which is a good universal solution), it's difficult to emulate a variable reistor using digital data, if you don't know how it is measured. For example, if the OI used a charging capacitor (measuring the time), it would require a different interface than if it used a simple analog voltage measurement.

Mike Copioli 26-01-2007 22:32

Re: Digital to OI Analog
 
)

Quote:

Originally Posted by marcan (Post 566050)
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

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.

marcan 26-01-2007 22:56

Re: Digital to OI Analog
 
Quote:

Originally Posted by Mike Copioli (Post 566074)
http://ww1.microchip.com/downloads/e...Doc/11195c.pdf

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.

Not a problem - all we need to do is calibrate to our specific parts.

Quote:

Originally Posted by Mike Copioli (Post 566074)
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.

You are overestimating the amount of power a small MCU requires. Developing a USB Host device is much more complex than SPI which is a very simple protocol - a small PIC will do, which will definitely use less than 100mA of power. In Sleep mode (which is what the PIC should be most often in, if it doesn't have much to do and it's coded properly), the current is measured in single-digit microamps (yes, micro). With EVERYTHING enabled (not likely), running at 48Mhz (maximum, overkill) frequency, the maximum current drawn is 50mA. With a much more common 4Mhz frequency (plenty for most usages), current is 6mA. These values are for a PIC18F4550, which is a pretty big PIC. The digital pots use less than a milliamp each even under active conditions. The OI provides 100mA. You do the math.

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.

Mike Copioli 27-01-2007 00:31

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 566091)
Not a problem - all we need to do is calibrate to our specific parts.


You are overestimating the amount of power a small MCU requires. Developing a USB Host device is much more complex than SPI which is a very simple protocol - a small PIC will do, which will definitely use less than 100mA of power. In Sleep mode (which is what the PIC should be most often in, if it doesn't have much to do and it's coded properly), the current is measured in single-digit microamps (yes, micro). With EVERYTHING enabled (not likely), running at 48Mhz (maximum, overkill) frequency, the maximum current drawn is 50mA. With a much more common 4Mhz frequency (plenty for most usages), current is 6mA. These values are for a PIC18F4550, which is a pretty big PIC. The digital pots use less than a milliamp each even under active conditions. The OI provides 100mA. You do the math.

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.


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.

Kevin Sevcik 27-01-2007 01:02

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.

Stuart 27-01-2007 01:17

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.

marcan 27-01-2007 03:10

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.

Mike Copioli 27-01-2007 08:31

Re: Digital to OI Analog
 
Quote:

Originally Posted by Kevin Sevcik (Post 566156)
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.


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.

Mike Copioli 27-01-2007 08:36

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 566180)
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.


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.

Mike Copioli 27-01-2007 08:46

Re: Digital to OI Analog
 
Quote:

Originally Posted by Stuart (Post 566160)
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.

Dave K. 28-01-2007 12:19

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 566022)
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.

Mike Copioli 28-01-2007 16:39

Re: Digital to OI Analog
 
Quote:

Originally Posted by Dave K. (Post 566827)
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.

Stuart 28-01-2007 17:30

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.

Mike Copioli 28-01-2007 17:56

Re: Digital to OI Analog
 
Quote:

Originally Posted by Stuart (Post 566992)
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.

Stuart 28-01-2007 18:12

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

Mike Copioli 28-01-2007 19:12

Re: Digital to OI Analog
 
Quote:

Originally Posted by Stuart (Post 567025)
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.

Dave K. 28-01-2007 19:50

Re: Digital to OI Analog
 
Quote:

Originally Posted by Mike Copioli (Post 566960)
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 K. 28-01-2007 20:08

Re: Digital to OI Analog
 
Quote:

Originally Posted by Stuart (Post 567025)
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,

Stuart 28-01-2007 20:44

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

marcan 28-01-2007 21:18

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.

Mike Copioli 28-01-2007 22:39

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.

Dave K. 29-01-2007 03:35

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 567186)
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 (Post 567186)

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 K. 29-01-2007 04:05

Re: Digital to OI Analog
 
Quote:

Originally Posted by Mike Copioli (Post 567255)

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,

marcan 29-01-2007 05:47

Re: Digital to OI Analog
 
Quote:

Originally Posted by Dave K. (Post 567386)
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. (Post 567386)
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.

Dave K. 30-01-2007 14:04

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 567391)
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).

Not to become the rules police here, but if this is for a FIRST competition, they'd nix the control because of the Bluetooth radio.


Quote:

Originally Posted by marcan (Post 567391)
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.

Yes, I thought of that, and I suppose if you are pulling the +5V Aux power line down significantly, then it could be of some help. The flip side is that if the load was inconsistent, the asynchronous sampling of the analog inputs could cause you to introduce additional error rather than correct for it.

Again, the input sample rate is ~38Hz.

Quote:

Originally Posted by marcan (Post 567391)
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.

At that point, you might be better off with another self powered, home brew device that watches the RC->OI data stream, extracts what it needs, and gives the driver the approriate feedback via a seperate alerting device, be it visual, rumble, or a tazer jolt. As long as the wiring doesn't tie into the same device that is wired to the joystick port, it should be permitted.

marcan 05-02-2007 04:02

Re: Digital to OI Analog
 
Quote:

Originally Posted by Dave K. (Post 568220)
Not to become the rules police here, but if this is for a FIRST competition, they'd nix the control because of the Bluetooth radio.

I believe radios (other than the IFI ones) are only prohibited on the robot, not on the OI.

R66:
Quote:

The radio modems provided in the 2007 Kit Of Parts are the only permitted method for
communicating with the ROBOTS during the competition. Radio modems from previous
FIRST competitions can not be used. The radio modem must be connected directly to the
Robot Controller using one of the DB-9 cables provided in the 2007 Kit Of Parts. No other
form of wireless communications can be used to communicate to, from or within the ROBOT
(e.g. no Bluetooth devices are permitted on the ROBOT).
Notice that the Bluetooth communications stay within the Operator Console, and everything is channeled through the IFI radio. Thus, no other method other than the IFI radios is used to communicate "to or from the robot" (and certainly nothing within)

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:

Originally Posted by Dave K. (Post 568220)
Yes, I thought of that, and I suppose if you are pulling the +5V Aux power line down significantly, then it could be of some help. The flip side is that if the load was inconsistent, the asynchronous sampling of the analog inputs could cause you to introduce additional error rather than correct for it.

Again, the input sample rate is ~38Hz.

Of course, it would work best when the load is constant or varies with a very low frequency (which will likely be the case of many control systems).

Quote:

Originally Posted by Dave K. (Post 568220)
At that point, you might be better off with another self powered, home brew device that watches the RC->OI data stream, extracts what it needs, and gives the driver the approriate feedback via a seperate alerting device, be it visual, rumble, or a tazer jolt. As long as the wiring doesn't tie into the same device that is wired to the joystick port, it should be permitted.

True. Not that I think it would really be that useful in competition, it's just something that would be easy to do just for kicks, given what we already have. I've written a custom dashboard that, besides doing what the original does, also shows stuff like the camera vision system data, and a couple other things, so adding it onto that would be fairly trivial.

Dave Flowerday 05-02-2007 09:46

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 572049)
Notice that the Bluetooth communications stay within the Operator Console, and everything is channeled through the IFI radio. Thus, no other method other than the IFI radios is used to communicate "to or from the robot" (and certainly nothing within)

I think you'll get burned by R11:
Quote:

<R11> For the purposes of determining compliance with the weight and volume limitations specified in Rule <R07>, these items are NOT considered part of the ROBOT and are NOT included in the weight and volume assessment of the ROBOT:
...
* The OPERATOR CONSOLE.
...
However, for all other purposes the items listed above are considered part of the ROBOT and must comply with all other applicable rules and equirements. In particular, these items are subject to the shipping deadlines specified in Section 4.5.1.1 and must ship in the crate with the rest of the ROBOT.
Emphasis mine. Since the operator console is "part of the robot" when interpreting R66, you cannot use wireless communications to or from it (in my interpretation).

Dave K. 05-02-2007 12:46

Re: Digital to OI Analog
 
Quote:

Originally Posted by marcan (Post 572049)
I believe radios (other than the IFI ones) are only prohibited on the robot, not on the OI.

R66:

Notice that the Bluetooth communications stay within the Operator Console, and everything is channeled through the IFI radio. Thus, no other method other than the IFI radios is used to communicate "to or from the robot" (and certainly nothing within)

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 :)


Of course, it would work best when the load is constant or varies with a very low frequency (which will likely be the case of many control systems).


True. Not that I think it would really be that useful in competition, it's just something that would be easy to do just for kicks, given what we already have. I've written a custom dashboard that, besides doing what the original does, also shows stuff like the camera vision system data, and a couple other things, so adding it onto that would be fairly trivial.

At competition...

<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