Go to Post There is always more than one way to design something. - Dave Scheck [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-12-2005, 14:03
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
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   Spotlight this post!  
Unread 11-12-2005, 16:06
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: KOP Gyro

Quote:
Originally Posted by sparksandtabs
How would I program a BASIC stamp to read the signal from a KOP gyro. Is the signal analog or digital?
Erm, the way I understand analog/digital is that digital is either true or false (one or zero) and analog is anywhere in a range of numbers. It would be a pretty horrible gyro if it read back 1 or 0

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.
__________________
http://www.mikesorrenti.com/
  #3   Spotlight this post!  
Unread 11-12-2005, 16:42
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: KOP Gyro

Quote:
Originally Posted by Mike
Erm, the way I understand analog/digital is that digital is either true or false (one or zero) and analog is anywhere in a range of numbers. It would be a pretty horrible gyro if it read back 1 or 0

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.
well I was looking at somethings on some website that sold gyros and some of them sent out a serial signal in digital form. I know how to hook it up, asked how to make the BS read it.

I don't know the manufacturer or part # or anything of the sort.
  #4   Spotlight this post!  
Unread 11-12-2005, 19:21
Andrew Blair's Avatar
Andrew Blair Andrew Blair is offline
SAE Formula is FIRST with Gasoline.
FRC #0306 (CRT)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Corry
Posts: 1,193
Andrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond repute
Send a message via AIM to Andrew Blair Send a message via Yahoo to Andrew Blair
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!
__________________
Reading makes a full man, conference a ready man, and writing an exact man.
-Sir Francis Bacon

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
-Albert Einstein
  #5   Spotlight this post!  
Unread 11-12-2005, 21:37
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
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   Spotlight this post!  
Unread 11-12-2005, 22:25
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
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?
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #7   Spotlight this post!  
Unread 11-12-2005, 23:14
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: KOP Gyro

Quote:
Originally Posted by Pat Fairbank
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?
That is only for the BASIC stamp not the BASIC Stamp 2, I thought about that too.
  #8   Spotlight this post!  
Unread 11-12-2005, 23:24
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: KOP Gyro

Quote:
Originally Posted by sparksandtabs
That is only for the BASIC stamp not the BASIC Stamp 2, I thought about that too.
Oh, sorry, didn't notice that.

I suppose RCTIME would work, then, but it looks as if you need to throw a capacitor into the mix as well.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #9   Spotlight this post!  
Unread 12-12-2005, 00:04
sciguy125 sciguy125 is offline
Electrical Engineer
AKA: Phil Baltar
FRC #1351
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Sunnyvale, CA
Posts: 519
sciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond repute
Send a message via AIM to sciguy125 Send a message via MSN to sciguy125 Send a message via Yahoo to sciguy125
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.
__________________

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------
  #10   Spotlight this post!  
Unread 12-12-2005, 18:12
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
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   Spotlight this post!  
Unread 12-12-2005, 20:27
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: KOP Gyro

Quote:
Originally Posted by sparksandtabs
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?
If $2 is going to kill your project, I am not sure I can help you ;-)

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:
'
' PROGRAM: RXSLAVE.BS2
' Program run by User Programmable CPU in 1998 FIRST Receiver Board
' Written by: Eric Rasmussen
' Date: 12/11/97
'
'
' Declare variables
'
'skip
sensor1 VAR byte
sensor2 VAR byte
sensor3 VAR byte
sensor4 VAR byte
'skip
'
' Define Constants
'
'skip
ADC_SO CON 12 ' Analog to Digital Converter (ADC) data output pin
ADC_SCLK CON 13 ' ADC Clock Pin
ADC_CS0 CON 14 ' Pin to initialize/reset ADC
ADC_SI CON 15 ' Pin used to send data to ADC
'skip
'
' Initialize Hardware and Variables on Power Up or Reset
'
' All pins default to low (ground) & input (floating) on powerup or reset.
' PWM outputs are automatically set to 127 on powerup or reset by the SSC
'
'skip
Output ADC_SI
Output ADC_SCLK
'skip
High ADC_CS0
'skip
'
' Main Program
'
Loop:
'skip

' Read Receiver Analog Sensor Inputs into sensor1-4
Gosub ReadSensors

'skip
Goto Loop ' Start over at Loop:

End ' It should never actually get here!

'
' Subroutines
'
'skip
ReadSensors: ' Read receiver sensor inputs into variables sensor1-4
' Read Channel 1 (Comment out next 4 lines if not using sensor1)
Low ADC_CS0 ' Initialize ADC
Shiftout ADC_SI, ADC_SCLK, msbfirst, [12\4] ' Select Channel 1
Shiftin ADC_SO, ADC_SCLK, msbpost, [sensor1] ' Read Channel 1
High ADC_CS0 ' Reset ADC
' Read Channel 2 (Comment out next 4 lines if not using sensor2)
Low ADC_CS0 ' Initialize ADC
Shiftout ADC_SI, ADC_SCLK, msbfirst, [14\4] ' Select Channel 2
Shiftin ADC_SO, ADC_SCLK, msbpost, [sensor2] ' Read Channel 2
High ADC_CS0 ' Reset ADC
' Read Channel 3 (Comment out next 4 lines if not using sensor3)
Low ADC_CS0 ' Initialize ADC
Shiftout ADC_SI, ADC_SCLK, msbfirst, [13\4] ' Select Channel 3
Shiftin ADC_SO, ADC_SCLK, msbpost, [sensor3] ' Read Channel 3
High ADC_CS0 ' Reset ADC
' Read Channel 4 (Comment out next 4 lines if not using sensor4)
Low ADC_CS0 ' Initialize ADC
Shiftout ADC_SI, ADC_SCLK, msbfirst, [15\4] ' Select Channel 4
Shiftin ADC_SO, ADC_SCLK, msbpost, [sensor4] ' Read Channel 4
High ADC_CS0 ' Reset ADC
Return
'skip
I can't help you with the $2 but I hope the above helped some.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #12   Spotlight this post!  
Unread 12-12-2005, 21:04
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: KOP Gyro

/me once again has a greater appreciation for C
  #13   Spotlight this post!  
Unread 12-12-2005, 21:59
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: KOP Gyro

Quote:
Originally Posted by Joe Johnson
If $2 is going to kill your project, I am not sure I can help you ;-)

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:



I can't help you with the $2 but I hope the above helped some.

Joe J.
I don't want to pay 6$ shipping for a .35$ part. It is absurd.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
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


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

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


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