|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Hall Effect Sensor Example Code
Quote:
|
|
#3
|
|||||
|
|||||
|
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. |
|
#4
|
|||
|
|||
|
Re: Hall Effect Sensor Example Code
Quote:
|
|
#5
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Hall Effect Sensor Example Code
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |