Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

rotary encoder sales site?

Status
Not open for further replies.

Hank Fletcher

New Member
Ugh! I've finally resolved to myself that I'll need a rotary encoder for the project I'm designing. I've been avoiding them because I don't know much about them, but it seems the best solution so I don't think I have a choice except to try and get my head around the rotary encoder options.

What I need is:
- 360 degrees (continuous rotation not necessary, so even 345 to 360 max would be okay)
- around 512 ppr
- good for at least 600rpm
- quadrature signal prefered

I've had a hard time Windows :) shopping for this to get a better idea of my options within these specs and especially to get some idea of cost - no one seems to be posting their prices for these things! Does anyone have any tips, either for suppliers or to help me in general to come to a better understanding of these things? Thanks!
 
Last edited:
You're in luck. Newark carries a Simpson rotary oprical encoder that does 600 ppr. It's Newark #83F7542 @ $159.24. It's Simpson part #SE-600, if you want to check specs (it has quadrature output). The URL is www.newarkinone.com
 
Newark carries a Simpson rotary optical encoder...
I'm reading the datasheets for that right now, and it looks good. Trouble is, I'm very much in the prototyping stage of my project, and as a personal interest I'm having to support the cost all myself. I'm starting to come to the conclusion though that for what I want, $150 or so might be my only option? Sorry, I probably should have mentioned that cost is a factor.

A similar option was to go for a servo motor which included an encoder from midwestmotion, and the motor and the encoder were almost the best specs I could hope for. I can't remember exactly, but I requested a quote from them about a year ago I think, and the cost was around $300. With that in mind, I'm trying to reason that if I'm going to spend (to me) big bucks, I might as well get exactly what I want, but I'm still not sure (that is, not sure what my girlfriend would say if she knew what I'd spent the money on!).

My MacGyver solution was to use a cordless drill as the motor, and then some kind of pot (like the ones in the old Atari 2600 paddles, but they only have just over 270 degrees rotation). I'd be happy with something like that for the first prototype, as long as I could get something close to 1/200 to 1/360 accuracy within an entire rotation.
 
You know what's weird? When I first checked out the encoder j.p.bill mentioned it was listed at the price he gave. I checked back ten minutes later, and now it's over $200!
 
How about this one? It's not quadrature, rather it's an magnetic absolute encoder with PWM or analog output. I think the refresh rate is 1000Hz if you pick the 10-bit versions. The 12-bit versions have a sampling rate that is 250Hz so it's really too slow for many things I find.

https://www.usdigital.com/products/ma3/

$30.
 
Well there are circuits inside the encoder that sample the magnetic field and then convert it into a reading. The bits is how accurate it converts it at- meaning that if you use a 10-bit encoder with a 12-bit ADC, it's pointless because you lose those 2 bits of accuracy. It's the same deal with the PWM output, if you measure the PWM output with more than 10-bits of accuracy on a 10-bit encoder, those extra bits are wasted.

What's more important for your project, the absolute position of the encoder? Or it's relative position (or speed)? If you need absolute, it'd be easier to go with something other than quadrature (since it's relative to a starting point). And of course, you can derive speed from an absolute encoder very easily with some elementary math.
 
Last edited:
I think I'm just new to what the benefits are to having the 10-bit PWM signal, particularly since the analog signal according to the site has a twice as good sample frequency? The plan is to put the encoder signal into the 10-bit A/D of a PIC mcu, if that helps explain where I'm coming from.
 
Hi Hank,

What are you planning to use the encoder for?


Torben
 
Yes, knowing more about your application might bring out more suggestions and recommendations. I've seen rotory quad encoders fabracated with simple printed disks and a pair of opto devices that could be made very inexpensively but one really needs to know more about the application and the enviroment it will work in.

Lefty
 
It's for position feedback for the slide motor (the big aluminum wheel in the photos) on the trombone robot I'm building. I've attached two photos, but I also have a short video if that helps. The video though is in .avi format, which I don't know if I can upload to the forum or how to convert it to a compatible file. Let me know if you know how to do that, and I'll upload the video too (it's less than 1 MB).

Right now I'm leaning heavily towards dknguyen's suggestion, since it's one I actually understand and is within my budget! Yes it's small, but I don't see that being a big issue for this application. In fact, the low inertia and the zero torque of the ball bearing option are a big plus. The only downside I can think of is the low sample frequency (2KHz for 10-bit analog). The slide's going to be moving at about 6m/s at its fastest, which will translate to 3mm accuracy per sample, but I think with some creative PID this might be acceptable.
 

Attachments

  • TromboneSlideDrive001.jpg.jpg
    TromboneSlideDrive001.jpg.jpg
    781.6 KB · Views: 223
  • TromboneSlideDrive002.jpg.jpg
    TromboneSlideDrive002.jpg.jpg
    775 KB · Views: 198
Last edited:
Hank Fletcher said:
I think I'm just new to what the benefits are to having the 10-bit PWM signal, particularly since the analog signal according to the site has a twice as good sample frequency? The plan is to put the encoder signal into the 10-bit A/D of a PIC mcu, if that helps explain where I'm coming from.

No ADC needed and noise immunity. FOr my applications the encoder tends to be next to a noisy motor and far away from where the electronics are so an ADC wouldn't work as well, even with double a sample frequency. As far as accuracy per reading goes, i just find it pointless to analog sample something twice.

I don't play a trobone so I don't know much how much difference there is between 3mm and 6mm (although, it makes a huge difference on a violin!).

I would suggest a potentiomter and you could sample with the fastest ADC you could get your hands on and calibrate everything, but yours sounds like a multi-rotaiton application (though not a infinite rotation application), and I doubt you could find a pot like that. YOu also have to remember that the encoder will repeat it's position after a revolution so you need something to keep track of that. IN this case, it sound slike an incremental encoder would be just as good as an absolute encoder due to the many rotations. THat is, unless you use a giant pulley that would only rotate once, then absolute is more convenient. Of course, you lose accuracy then, but you gain a relative speed advantage since the pulley won't be spinning so fast.
 
Last edited:
The big pulley in the photo rotates just less than 360 degrees to accommodate movement over the entire length of the slide, that is, the circumference of the large pulley is just slightly greater than the length of the slide. For that reason, the pulley will never need to rotate more than once in either direction. I should say that the photos represent an early prototype - eventually the pulley/line will be a little different so that the line (actually two lines) are permanently attached to the pulley, which at that time have two grooves for separate lines in either direction. Sorry, I know that might be hard to visualize, but the short of it is the new set-up will eliminate drift due to the line sliding on the large pulley when it's in motion. What that means is that the position of the pulley will then be an accurate representation of the position of the slide (as oppose to there being the chance that the line has slipped on the pulley). The big wheel, at its fastest, will spin at about 600rpm.

The PWM signal from the encoder you mentioned interests me, but I still don't understand it. What's the difference between reading the voltage of a PWM signal and an analog signal, and how do I go about reading it in a way that avoids the noise you mentioned? I think the PIC mcus have PWM capture capabilities, but I'm still trying to put it all together - any thoughts?

The distance between semitones in terms of slide extensions on the trombone is approximately 10cm. With that in mind, each millimetre difference represents roughly one cent in terms of pitch tuning (or 1% of one semitone). I can't say for sure, but I think that for a human arm to be able to place an object within 3mm while moving at 6m/s is quite good, and like I said, I'll fiddle with the PID so that, for instance, if the trombone is playing a whole note it gradually moves the slide to a more accurate position. I think what this is all leading to is that there should be another kind of sensor feedback used for this project in the form of an audio tuner that can hear the pitch and respond to that for more accurate positioning, but that's a long way off at this point.
 
Last edited:
Hank Fletcher said:
The big pulley in the photo rotates just less than 360 degrees to accommodate movement over the entire length of the slide, that is, the circumference of the large pulley is just slightly greater than the length of the slide. For that reason, the pulley will never need to rotate more than once in either direction. I should say that the photos represent an early prototype - eventually the pulley/line will be a little different so that the line (actually two lines) are permanently attached to the pulley, which at that time have two grooves for separate lines in either direction. Sorry, I know that might be hard to visualize, but the short of it is the new set-up will eliminate drift due to the line sliding on the large pulley when it's in motion.

The PWM signal from the encoder you mentioned interests me, but I still don't understand it. What's the difference between reading the voltage of a PWM signal and an analog signal, and how do I go about reading it in a way that avoids the noise you mentioned? I think the PIC mcus have PWM capture capabilities, but I'm still trying to put it all together - any thoughts?

Aside from the initial sampling accuracy that occurs inside the encoder, the accuracy of a PWM signal is limited by the speed and accuracy of the reference clock you are using to measure the PWM signal with. FOr analog it is the noise and bits of the ADC. YOu don't get around the noise unless you filter it, but then you take a loss in response time.

PWM- digital, more noise immunity, but the number of samples you can get is limited to the frequency of the PWM (obviously since the measurement itself is based on a length of time).

Analog- analog, less noise immunity, but you can sample it a lot faster (but in this case if you sample too fast it gets pointless since the signal is actually already being sampled inside the encoder and turned into an analog signal again so sampling faster than the internal rate gets you nowhere, similar to sampling with more bits than the encoder is using internally). You can do analog processing with analog signals though such as filtering and other things like that.

Just make it play by ear...after all, that's the proper way of playing! Not memorizing the position of the notes! And no tuning needed! I suppose you could have it dynamically learn relate the notes to a position as it plays and constantly update. But it would be easier just to have to play the lowest note all the way up to the highest note remembering the position every time it started up. BUt you still need an encoder either way or some other method to measure physical postion.
 
Last edited:
I think I'm starting to understand now. I think I know pretty well the deal with the analog option, I just don't know much about PWM signals, especially when it comes to PIC mcus (which in themselves I know very little about!).

So suppose the PWM signal comes out of the encoder in 10 bits, which from what I've read of the PIC 16F88 is the top of what it can handle. Does the PIC read the PWM signals individual bits? And that's how it eliminates the noise problem, right? Since the highs and lows from the encoder will be about 5V and 0V respectively, and thus relatively immune to interference? I don't at all know how to sync up the signal from the encoder to what the PIC would be reading - am I even in the ballpark to be concerned about that? Or is that even a problem at all - would I just set the PIC's PWM capture (capture - is that the right word?) sample frequency to close to the encoder's (around 1KHz), and it all works out the same?
 
Last edited:
WHy don't you just search for a basic article on why digital signals are more noise immune than analog signals. It just has more to do with a digital signal can be distorted, but it can only be either a 0 or 1, and unless it's distorted enough that it crosses the voltage threshold between the two binary values, it will retain that value. WIth analog, every value has meaning so if you distort it a bit you lose some meaning.

For PWM, no need to sync up. The PIC capture module will do that on it's own and read out the length of time that the PWM signal is "ON" for or "OFF" for, either that or it will read out the ratio between the two (the duty cycle), and if you know the frequency of the signal (which you do since it's a spec of the encoder), you can calculate the on and off times (which are the values that have meaning for the encoder). Or you could do the conversion between the relationships "pulse width vs position" to "duty-cycle vs position" beforehand and program that into the PIC instead.

By the way, PWM means variable pulse width (the amount of time the pulse is on vs the time it is off), not frequency. In general, the frequency of a PWM signal is kept constant while the width of the pulse is varied. If this doesn't make sense, all you need is a picture.

Try to google to find a simple image if you are confused.
https://www.4qdtec.com/images/wvfrm.gif

Notice how the on time varies, but the frequency of the pulse is the same. Each "section" lasts for the same amount of time. What varies is the length of time each section remains high and low.
 
Last edited:
either that or it will read out the ratio between the two (the duty cycle)...
That's what I've been taking issue with! If the PIC just reads the ratio, then even if it's a digital PWM signal, it's still subject to interference, isn't it? Or does the PWM capture module on the PIC have (what I would call from my music recording knowledge) a built-in noise gate so that that's a non-issue? What you're telling me is that the PWM capture on a PIC will only pick up the individual bits, and not do what I'm anticipating, i.e. simply act as an A/D that averages out the highs, the lows, and all the interference? See what I mean? You could put a PWM signal to an A/D, and the A/D would just give you an average of everything coming in (even the noise). But what you're telling me, and what I'm really wanting to hear, is that you can put a PWM signal into a PIC's PWM and get exactly and only the PWM bits read. Right?

Sorry, this has less to do with me knowing about the pros and cons of analog vs. digital, or a what a PWM signal is (which I'm all cool with), and is more about me coming to an understanding of what PICs and their PWM capabilities are.
 
Last edited:
Let's say we have an anlog signal that can vary from 0-5V and a digital signal that also varies 0-5V with 2.5V being the threshold between HI and LO.

If I superimpose noise onto the analog signal that is a sine wave at 10mV, you just lost 10mV of accuracy on the analog signal. If the digital signal is currently a LO sitting at 1V and I add the same amount of noise to it, it is still a LO and no information is lost since it is still below the 2.5V threshold that makes it a LO and not a HI. Errors in PWM come from the jitter in the clock used to generate/measure it. Averaging is also something that is inherently done with PWM due to the multiple measurements that are taken for a reading, though you could do it explicity with analog too.

You do not measure PWM with an ADC. YOu measure it with a digital input and a clock (the so called input capture module). You measure the TIME that it is HI and LO, not the actual voltage it is at (like in analog). IN analog you measure the actual level of the voltage and that is your information. In PWM you measure the TIME that the signal is above 2.5V for, and the time that it is below 2.5V (using the frequency to know when a cycle is over, or using aformentioned data to calculate the frequency of the signal if you wish). As long as the voltage in PWM (or any digital signal for that matter) is below 2.5V it's meaning doesn't change no matter what you do to it (and likewise for above 2.5V). This makes it more immune to noise. THe averaging I was talking about is not the averaging of voltage levels, but the averaging of the time that the pulse is HI for over several cycles.

Of course, 2.5V is just an example threshold value for a 5V system.
 
Last edited:
It's such a complicated thing of beauty, I can't believe it all works (although I know it must). The fact that all that PWM and more is in an IC that costs less than $5 blows me away.

Errors in PWM come from the jitter in the clock used to generate/measure it. Averaging is also something that is inherently done with PWM due to the multiple measurements that are taken for a reading,
So how does that work in a PIC? If it says it has 10-bit capture at a 1KHz sample rate, will it actually be taking more measurements than 10 bits times 1000 per second, and then averaging out however many samples it's actually taken into a 10-bit value? I mean, in practice, despite the errors from clock jitter, does the PWM approach still beat out the analog approach, presuming in both cases your best means of capturing either is, for instance, a 16F88?
 
Last edited:
Well I think PWM is better if you have an accurate clock and if 1kHz update rate is fast enough since you the signal is only analog once. FOr the analog output it gets converted twice.

The PIC will be "watching" the signal at much higher than 1kHz, but the PWM output from the encoder only produces 1000 readings per second. The PIC after all all is a discrete time device and therefore only "samples" the signal at a finite rate. THe final position reading though is limited by the encoder's PWM frequency (1kHz). The "averaging" in this case isn't due to sampling or taking readings at faster than 1kHz. It is due to the fact that the encoder's sample rate of 1kHz is higher than the bandwidth (ie. fastest transient time) of the motor. ALthough, that could be said for the analog system too if you sample fast enough and average consecutive readings to combine them into a single reading.
 
Status
Not open for further replies.

Latest threads

Back
Top