- Posts: 972
- Thank you received: 0
proximity switch encoder help
I'm using a Mesa 7i76e and I have 2 NPN prox switches reading off a 12 hole disk I made. They do read and I know it's Ideal to have them read 90 degrees out of phase. The outputs are hooked up to enca- and encb- of the mesa card. There is some runout in the disk but they do read every pulse, speed is just all over the place and I want to make sure I'm not wasting my time before I try to true it up. I have only changed the .ini file's encoder scale to 24. I'm wondering if that's correct since it's not a quadrature encoder and the enc+ are not connected. Is there something I have to change in Hal as well?
Please Log in to join the conversation.
Please Log in to join the conversation.
I think the speed thing is because of the on-time overlap. The way the switches are arranged one goes on and off before the other goes on. So basically I think I need to drill bigger holes to increase the off time so they overlap . I will true the disk and hook up the scope and try to phase the pulses. I just want to make sure whatever filter is on there and my encoder scale is set right before I go crazy. It's throwing me off a bit that if it were a quad encoder it would be encoder ppr x 4, But I'm not sure if this is the case here.
btw, these are 5khz switches so switching speed should not be an issue.
Please Log in to join the conversation.
(and therefore 48 counts/turn in the normal 4X quadrature mode of the hostmot2 counter in quadrature mode)
Please Log in to join the conversation.
Please Log in to join the conversation.
Imagine your 48 count encoder running at 600 RPM, This gives you 480 counts per second, or about a count every 2 ms so if a velocity estimate is done at the servo thread every 1 ms, (using delta-counts/delta-time) you will get alternate
double speed (1200 RPM) and zero speed readings.
What is the velocity needed for? If its only for a readout and not high speed feedback, you can low pass filter
the velocity estimate to remove the variations
Also as you may have figured out, slots are better than holes for encoders since they are insensitive to
radial sensor alignment
Please Log in to join the conversation.
The filter thing is kind of what I was looking for can you point me in the right direction on that? that's in the hal file correct?
Slots are a bit harder to machine with just a lathe and a drill press. If I had a mill and a rotary table (or CNC Mill) I'd do it. I work with printing equipment, and alot of the newer digital stuff maintains pretty good positional accuracy with just a drilled disk. Looking at one example today I've noticed that the holes are drilled much closer together which I'm sure makes the on-time closer to 50%. Maybe I should pass it around on here, see if anyone wants to CNC one up for me.
Please Log in to join the conversation.
blazini36 wrote: Slots are a bit harder to machine with just a lathe and a drill press. If I had a mill and a rotary table (or CNC Mill) I'd do it. I work with printing equipment, and alot of the newer digital stuff maintains pretty good positional accuracy with just a drilled disk. Looking at one example today I've noticed that the holes are drilled much closer together which I'm sure makes the on-time closer to 50%. Maybe I should pass it around on here, see if anyone wants to CNC one up for me.
Hmm, I think you need to make yourself a plasma machine and cut the slots. Its only taken me a bit over 12 months....
Australia might be a bit too far away for you to bring it round.
Most printing machines I've seen use a light emitting sensor that wraps around a toothed plate.
Please Log in to join the conversation.
A plasma cut disk wouldn't be the best choice here this is a 2.5" hole circle that should probably go from the 12 I have now to about 20 holes. Ill have to draw it up and see what it looks like. Pics of the current setup (hole spacing is likely too wide)
Attachment not found
Attachment not found
Please Log in to join the conversation.
The filter thing is kind of what I was looking for can you point me in the right direction on that? that's in the hal file correct?
Yes, theres' a lowpass filter component that can be added to your hal file, something like
loadrt lowpass count=1
addf lowpass servo-thread
net filtered_velocity lowpass.0.out
net raw_velocity hm2_5i25.0.encoder.00.velocity lowpass.0.in
# set gain for 1 Hz Bandwidth @ 1 KHz sample
setp lowpass.0.gain 0.0063
for more info
Please Log in to join the conversation.
