|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
KOP Gyro
How would I program a BASIC stamp to read the signal from a KOP gyro. Is the signal analog or digital?
Last edited by John Gutmann : 11-12-2005 at 14:06. |
|
#2
|
|||||
|
|||||
|
Re: KOP Gyro
Quote:
![]() I would google the gyro manufacturer/part number and try to find the datasheet for it. You would need to find the rateout, ground and positive in pins. Then you would have to make sure that your board can provide the amount of power needed. You also need to have an analog-to-digital converter. This converts the voltage returned from the gyro to a number (number size depends on ADC, an 8bit ADC is sufficient.) Then you just read it as you would anything else. |
|
#3
|
||||
|
||||
|
Re: KOP Gyro
Quote:
I don't know the manufacturer or part # or anything of the sort. |
|
#4
|
|||||
|
|||||
|
Re: KOP Gyro
The BEI kit gyro is an analog device. On the basic stamp, I believe that there are macros (thats BASIC talk
i think...) that point to built in ADC's, and you just uncomment them to access them. Be careful, on the STAMP brain, you'll prolly have to comment some unused variables in. Its very limited on usable variable space. Then, using a scaling factor, convert the output number into a angle measurement. Sorry, can't tell you the exact math, but if you obtain Kevin Watson's gyro code it either explains it, or you can reverse engineer it. You can PM him (http://www.chiefdelphi.com/forums/me...hp?userid=1028) and he might be able to help with the concept. http://kevin.org/frc/ <<Gyro Code Remember, gyro's output angular rate, not absolute position/angle. Good luck! ![]() |
|
#5
|
||||
|
||||
|
Re: KOP Gyro
If it helps anyone, or ^ i am using a BS 2 the one that comes with the BOE-bot. I am trying to get it to work on that before i put it into my robgot which uses the older IFI BS microprocessor.
I have no idea how to read an analog signal with a BS2. If you knew that could really help, i have looked around the editor and in the help but i will try a few websites Last edited by John Gutmann : 11-12-2005 at 21:45. |
|
#6
|
||||
|
||||
|
Re: KOP Gyro
Looking through the Basic Stamp manual, it seems to me the POT command is the one to use to take analog readings. It's intended to measure potentiometers with resistences from 5 Kohms to 50 Kohms.
I'm no electrical engineer, so I can't tell you if this will work with the gyro (whose datasheet says something about a 1 Kohm impedence). Is there an EE or someone else around who can enlighten us? |
|
#7
|
||||
|
||||
|
Re: KOP Gyro
Quote:
|
|
#8
|
||||
|
||||
|
Re: KOP Gyro
Quote:
I suppose RCTIME would work, then, but it looks as if you need to throw a capacitor into the mix as well. |
|
#9
|
|||
|
|||
|
Re: KOP Gyro
I think you need a true ADC for this. I don't know of any specific devices, so you'll have to consult google.
The problem with using RCTIME is that it's checking for a charge rate, not an actual voltage. I'd have to think about it a little more, but I think it's possible to make it work, but it wouldn't be very pretty. For one thing, it wouldn't work if the input drops below 1.5V. Secondly, caps have an exponential charge rate. I suspect that would introduce some interesting math. That's also ignoring the calibration you would need because of the usual +-20% tolerance of capacitors. Anyway, try to find an ADC. |
|
#10
|
||||
|
||||
|
Re: KOP Gyro
Ok, I will check at school and see if we have any ADCs. If not does any one know of somewhere I can get one without paying a couple dollars for shipping?
|
|
#11
|
||||||
|
||||||
|
Re: KOP Gyro
Quote:
Seriously though, there are some tolerably easy to implement shift in/shift out ADC's -- I think the old controller Eric Rasmussen designed used to have one. Let me see what I can dig up... ...checking... ...found it! It was an ADC0838CCN $2.63 from Digikey I remember interfacing a the BASIC Stamp2 to it. It was easy as pie -- the old PBASIC default is probably lurking out there somewhere if you dig around... ...checking... ...HA! -- man I am good! ;-) I had to use the waybackmachine.org but here it is a copy of the Pre-IFI PBASIC Default Code (it used to be called RXSLAVE.BS2 -- for all you old time FIRST folk) Anyway, Below are the important bits of the PBASIC code to interface to the serial in/serial out ADC: Quote:
Joe J. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gyroscope Code | Kevin Watson | Programming | 65 | 01-03-2008 23:46 |
| Updated: Example Gyro Interface Code | Kevin Watson | Programming | 2 | 28-03-2005 04:36 |
| Example gyro code released. | Kevin Watson | Programming | 60 | 17-03-2005 18:32 |
| Gyro Troubles | SteveO | Programming | 13 | 30-01-2005 16:46 |
| Looking for KOP Helical Gears | ChuckDickerson | Kit & Additional Hardware | 1 | 21-07-2004 15:39 |