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.


All times are GMT -5. The time now is 19:30.

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