Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Hall Effect Sensor. (http://www.chiefdelphi.com/forums/showthread.php?t=32349)

jdong 16-01-2005 16:54

Re: Hall Effect Sensor.
 
Quote:

Originally Posted by Sparks333
Al,
I was looking over the allegra datasheets (links up above... Thanks Caleb Fulton!) and on Page 9, it describes something regarding polarity and direction. I think its internal circuity makes it so when you are facing a tooth going one direction, it's high, but when you are going the other direction, it's low. If your gear teeth are fairly far apart, you would have to measure the duty cycle to see which way it's turning... not sure how it would be done, but it may be possible with a single sensor to tell direction.
Here's what I read. Please correct me if I'm wrong.



http://www.allegromicro.com/datafile/0660.pdf
, pg.9

Well, it's difficult and processor-expensive to do so. You'd have to measure the length of each pulse, by interrupting on rising edge, then having the handler switch to interrupt on falling edge. By using a timer to count the ticks between these two, you can obtain the length of the pulse.

However, the time to pulse also varies with the speed (no direction) of the rotations. You sort of have to know the speed to do much with it.


However, I see little wrong with assuming direction. A PID controller reacts in ~20-30 ms -- it's very unlikely a robot can push yours in the reverse direction at that exact velocity...

Sparks333 16-01-2005 20:04

Re: Hall Effect Sensor.
 
Jdong,
I imagine you are quite right about the complexity, and you bring up a good point about assumptions. I was merely throwing it out as a piece of information that could be used so people could mess with it. I have absolutely no idea about how programming is done, and am rather hopeless (even after 2 C classes!) but what if you were to make the hall-effect sensor read a gear with a large gap between the teeth? that would make the duty cycle difference easier to read. I have other ideas, but most of mine are not that great.

Thanks again!

Sparks

Al Skierkiewicz 16-01-2005 20:52

Re: Hall Effect Sensor.
 
Sparks,
Sorry this is a little late. I have been looking at the sensor and page 9 is a discussion of the output vs. direction. If the gear is moving in one direction the output will rise from a low state to a high. If the gear is moving in the other direction, the output will move from a high to a low. This is data that I don't think could be useful other that scoping the output while rotating the shaft by hand. The suggestion I made earlier (thanks Greg for the corrected waveform) requires two sensors mounted so that the pulses overlap by 90 degrees (electrical degrees that is). You can see that rather easily in Greg's waveform that the top pulse leads the bottom by some amount. If the direction were reversed, the top pulse would lag the bottom pulse by the same amount. If you were to then compare the pulse trains by sampling when the top pulse goes from low to high, and determining the value of pulse train two, you could determine which direction you were turning. (If pulse two is already high when pulse one goes high you are turning in one direction. If pulse two is low when pulse one goes high you are turning in the other direction.) This is easy to do in software, (don't ask me how) and requires about four gates as I remember, in logic hardware to decode. The Hall effect is actually a pretty neat little package in that it uses two sensors at right angles to each other, to cancel out errors and temperature problems automatically. Please note the restrictions on gear tooth specifications when using and positioning the sensor.

Gal Longin 17-01-2005 11:22

Connecting the Hall Effect Sensor.
 
I've been having abit of a problem connecting the hall effect sensors with the 4 pins. i looked at the file on http://www.allegromicro.com/datafile/0660.pdf and it said that one pin is for +v one is for GND and one is the output signal and the one left is also for GND . it seems a bit weird to me. perhaps i'm not understanding it correctly. why would you need two pins for GND. do you really have to connect both the 3rd and the 4th pin to the GND?

please help me figure this out. what is the correct way to connect it?

Al Skierkiewicz 17-01-2005 11:49

Re: Connecting the Hall Effect Sensor.
 
Quote:

Originally Posted by Gal Longin
I've been having abit of a problem connecting the hall effect sensors with the 4 pins. i looked at the file on http://www.allegromicro.com/datafile/0660.pdf and it said that one pin is for +v one is for GND and one is the output signal and the one left is also for GND . it seems a bit weird to me. perhaps i'm not understanding it correctly. why would you need two pins for GND. do you really have to connect both the 3rd and the 4th pin to the GND?

please help me figure this out. what is the correct way to connect it?

If you scan down from page one you will see a reference that Pin 3 is an internal connection, scan a little further and you will see that it "must" be tied to ground externally.
It may be an electrocstatic shield or it may be the shell of the magnetic structure. Four pins tied to a PCB are better than three.

russell 17-01-2005 16:11

Re: Hall Effect Sensor.
 
doesnt the program only run every 26miliseconds? Thats about 38 times per second. So if you had 38 teeth moving past it per second wouldnt your program show taht the robot is simply sitting still? These things look way too complicated for me.

scottm87 17-01-2005 16:34

Re: Hall Effect Sensor.
 
Quote:

Originally Posted by russell
doesnt the program only run every 26miliseconds? Thats about 38 times per second. So if you had 38 teeth moving past it per second wouldnt your program show taht the robot is simply sitting still? These things look way too complicated for me.

First of all, the slow loop runs at something around that speed. The fast loop runs much faster. Even if the fast loop was too slow, there is the magic of interrupts!

Interrupts allow your code to process events that may come in during the execution of another task, and "interrupt" the current processing to handle the interrupt (in a function known as the "ISR", or "interrupt service routine") There are a few magic registers in the controller that control how interrupts are handled (for a good reference, check out Kevin Watson's interrupt code).

So, while the radio may be able to only transmit/recieve information every 26ms, the controller operates much faster, and with interrupts, can handle tasks even faster than the "fast loop" that executes code while waiting for a radio packet.

Scott

Derder1625 17-01-2005 19:16

Re: Hall Effect Sensor.
 
[font=Comic Sans MS][font=Comic Sans MS]hm.. so afterall that has been said..
does anyone know where could we find the manual
for the hall effect sensor??~
:) thank yoU~~

Derder1625 17-01-2005 19:22

Re: Hall Effect Sensor.
 
=] May someone please tell me
where could we find the manual
of the hall effect sensor?? =] thank you

Mike Betts 17-01-2005 19:42

Re: Hall Effect Sensor.
 
Quote:

Originally Posted by Derder1625
=] May someone please tell me
where could we find the manual
of the hall effect sensor?? =] thank you

Please read this thread. The data sheet link is given.

Kevin Watson 18-01-2005 01:37

Re: Hall Effect Sensor.
 
Quote:

Originally Posted by jdong
Well, it's difficult and processor-expensive to do so. You'd have to measure the length of each pulse, by interrupting on rising edge, then having the handler switch to interrupt on falling edge. By using a timer to count the ticks between these two, you can obtain the length of the pulse.

However, the time to pulse also varies with the speed (no direction) of the rotations. You sort of have to know the speed to do much with it.

If I understand this correctly, the duty cycle (time pulse is high/total period) is fixed at some value if the gear is going one way and fixed at a different value when spinning in the opposite direction. If this is true, all you need to do is use a timer to keep track of the delta time between edges to know which direction you're spinning. This *can* be done. In fact, this is very close to how the beacon receiver code worked last year. Perhaps someone can grab a copy of receiver.c and make it work? Last years code is kept here: http://kevin.org/frc/2004.

-Kevin

Al Skierkiewicz 18-01-2005 23:24

Re: Hall Effect Sensor.
 
Kevin,
The data sheet is really vague on this question. I have not used these sensors but in reading the data sheet, it repeatedly talks about how the duty cycle is fixed at some value and is stable with respect to temperature, air gap, and speed. I found that there is some hidden text as respect to duty cycle in the sheet and the waveforms for duty cycle are missing. (search the pdf for "duty cycle" and at the bottom of p8 you will see highlighted blanks, I selected the text and pasted it in another document to read it.)
Due to the variations in tooth shape, tooth depth, surrounding metal, etc., I believe the magnetic fields vary considerably. I am guessing that the manufacturer tried to compensate for these variables and probably aimed for 50% +/-5% by sensing zero cross. There is discussion that the sensor learns it's environment over the space of 64 cycles, adjusting gain and A/D parameters to make the output stable and accurate.
If anyone has practical experience with this device and can produce a waveform or two, it would be a big help. I will try and dig one out and see if I can get some data, next week. FLL state tournament is this weekend, so it's going to be pretty busy between now and then.

pludodog 19-01-2005 00:26

Re: Hall Effect Sensor.
 
What's everyone's best place and advice for mounting the sensor? The data sheet is lacking, but from what I would gather, it has to be mounted behind the teeth, so it can record their absence. Has anyone gotten it to work mounted above the gear pointing downwards (reading through the chain)?

Al Skierkiewicz 19-01-2005 07:31

Re: Hall Effect Sensor.
 
Quote:

Originally Posted by pludodog
What's everyone's best place and advice for mounting the sensor? The data sheet is lacking, but from what I would gather, it has to be mounted behind the teeth, so it can record their absence. Has anyone gotten it to work mounted above the gear pointing downwards (reading through the chain)?

It is unlikely to read through the chain, there isn't enough of a magnetic change. It is better to mount further up in the transmission. Any error in counting is therefore reduced by the gear ratio between the gear you are sensing and the final movement of the robot.

Excelsior 19-01-2005 17:49

Re: Hall Effect Sensor.
 
We are having problems getting this particular sensor to work. We are currently testing it with an o-scope, and it appears that all our wiring is done correctly, but we are getting no output at all.

Any suggestions?


All times are GMT -5. The time now is 21:02.

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