Go to Post A few months from now I'll be walking to school and then I'll suddenly be attack by a rogue robot trying to feed me a golden ball or something wont I? - Marcel [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 08-02-2005, 17:27
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Hall Effect Sensor Example Code

A friend and I have been working on autonomous mode programming (we're both rookies with no background) and have just gotten pretty good at dead reckoning. We have decided to use the Hall-Effect sensors and gyros to make it more accurate. But we have no idea where to start the programming for either of these. We're not even sure which inputs to put them in. Any help would be great. Example code and description in english would be the best. Thanks a lot.
  #2   Spotlight this post!  
Unread 09-02-2005, 08:30
GAT-X105 STRIKE's Avatar
GAT-X105 STRIKE GAT-X105 STRIKE is offline
Registered User
#0781
 
Join Date: Feb 2005
Location: Kincardine
Posts: 11
GAT-X105 STRIKE can only hope to improve
Re: Hall Effect Sensor Example Code

Quote:
Originally Posted by JJMax7
A friend and I have been working on autonomous mode programming (we're both rookies with no background) and have just gotten pretty good at dead reckoning. We have decided to use the Hall-Effect sensors and gyros to make it more accurate. But we have no idea where to start the programming for either of these. We're not even sure which inputs to put them in. Any help would be great. Example code and description in english would be the best. Thanks a lot.
We're in the same position. We were going to use the CMUcam, but we fried it last night.
  #3   Spotlight this post!  
Unread 09-02-2005, 09:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,854
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Hall Effect Sensor Example Code

Start with the examples Kevin Watson has generously provided at http://kevin.org/frc/

Then hit the ChiefDelphi threads.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #4   Spotlight this post!  
Unread 10-02-2005, 11:03
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: Hall Effect Sensor Example Code

Quote:
Originally Posted by Mark McLeod
Start with the examples Kevin Watson has generously provided at http://kevin.org/frc/

Then hit the ChiefDelphi threads.
We already have that code and we've been searching on the forums but we still aren't having much luck. As I said before neither of us has any background in programming and are learning as we go. Any help is much appreciated. We would really like the basics of the code functions we need to use.
  #5   Spotlight this post!  
Unread 11-02-2005, 13:15
Mark Pierce Mark Pierce is offline
Registered User
FRC #0085 (B. O. B.)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Zeeland, MI
Posts: 239
Mark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant futureMark Pierce has a brilliant future
Re: Hall Effect Sensor Example Code

Yes it can be overwhelming. I just sent this message to another rookie team who asked for assistance:

Our team has not used the hall effect sensors but the programming should be very similar to the encoder code found in Kevin Watson's code library.

The encoder project and the navigation project (if you have a gyro) have the best examples of encoder (or just counting) programming.

In the file encoder.c the Handler routines need to be changed if you do not have two sensors on each side as described in this thread:

http://www.chiefdelphi.com/forums/sh...t=32349&page=1

Read this thread and at least the most recent of the other ones when you do a search for hall effect sensors in the CD forums. They have a lot of useful information.

You would need to change the if statement to only count up if all of your moves are forward, or sense the direction you told each side to move instead of the second input value.

In your main autonomous code (or for testing, your regular processing also) you can then call Get_Left_Encoder_Count() and Get_Right_Encoder_Count().

Average the values to get distance traveled, take the difference to get an approximation of turning. If you keep speeds low enough that you don't have wheel slippage you should end up fairly close to where you want to go.

We've made our own encoders last year using optical sensors and a slotted disk, this year we bought encoders from USdigital.com. In 2003 we just did moves by setting joystick input variables to a desired value for a desired amount of time (based on a counter in the autonomous code). It didn't work every time, but at least we were on our way to where we wanted to be instead of standing still. Sometimes it even worked great!

Good Luck!

Last edited by Mark Pierce : 11-02-2005 at 17:21.
  #6   Spotlight this post!  
Unread 14-02-2005, 17:40
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: Hall Effect Sensor Example Code

Thanks for your help, I think we're going to have to settle with a counter for our first year. We were hoping to get the hall effect up and running, but I don't think we're going to actually be able to get them working on time. We were working with the counter, but turning was our biggest problem. It being very hard to measure a turn on different surfaces with wheel slippage and all. Hopefully we can do it on carpet and get it working atleast somewhat well. Any tips would be greatly appreciated. Thanks.
  #7   Spotlight this post!  
Unread 16-02-2005, 02:38
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,612
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Hall Effect Sensor Example Code

Quote:
Originally Posted by JJMax7
Thanks for your help, I think we're going to have to settle with a counter for our first year. We were hoping to get the hall effect up and running, but I don't think we're going to actually be able to get them working on time. Thanks.
The sensor should be very straight forward to read (encoder but easier). Please post your most recent code and others might be able to help. We have the hall effect working well with +/- 5 cm error (which will hopefully be lower).

Remember to create a test setup with the Hall effect sensor 2 cm away from a sprocket to verify the sensor readings indpendent of your moving robot. Attempt to do this before mouting onto the robot.
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
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
Hall Effect Sensor. Nixterrimus Electrical 77 29-01-2005 10:48
Hall Effect Source LaughingJack Programming 3 26-01-2005 05:28
Code violation using Hall effect sensor pickle Programming 9 19-01-2005 00:10
heres the code. y this not working omega Programming 16 31-03-2004 15:18


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

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