DSPRelated.com
Forums

Newbie DSP question..

Started by mrsmith June 7, 2004
(I am a DSP noobie..) 

Basically this is what I have. 

I have a device that measures RPM. 

The device has a 360 degree optical encoder wheel. 

So at a rotation speed of 1000 RPM 

you have a 6 khz signal. 

(1000/60) * 360 = 6 khz 

Max is 9000 RPM so 

(9000/60) * 360 = 54 khz (max signal freq) 


Now what I need is a : 

1000 rpm = 1khz 
9000 rpm = 9khz 

any ideas?
mrsmith wrote:

> (I am a DSP noobie..) > > Basically this is what I have. > > I have a device that measures RPM. > > The device has a 360 degree optical encoder wheel. > > So at a rotation speed of 1000 RPM > > you have a 6 khz signal. > > (1000/60) * 360 = 6 khz > > Max is 9000 RPM so > > (9000/60) * 360 = 54 khz (max signal freq) > > > Now what I need is a : > > 1000 rpm = 1khz > 9000 rpm = 9khz > > any ideas?
Do you mean that you need a 1kHz signal to correspond to 1000rpm, etc.? If so you can do this with a simple divide-by-six counter, and you don't really need "DSP" at all. The folks on sci.electronics.basic could help you out. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott wrote:

> mrsmith wrote: > >> (I am a DSP noobie..) >> Basically this is what I have. >> I have a device that measures RPM. >> The device has a 360 degree optical encoder wheel. >> So at a rotation speed of 1000 RPM >> you have a 6 khz signal. >> (1000/60) * 360 = 6 khz >> Max is 9000 RPM so >> (9000/60) * 360 = 54 khz (max signal freq) >> >> Now what I need is a : >> 1000 rpm = 1khz 9000 rpm = 9khz >> any ideas? > > > Do you mean that you need a 1kHz signal to correspond to 1000rpm, etc.? > If so you can do this with a simple divide-by-six counter, and you > don't really need "DSP" at all. The folks on sci.electronics.basic > could help you out.
Three flip-flops and a gate will divide by six. For robust indication, you will need to debounce the signal from the encoder before you divide it. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry Avins wrote:

> Tim Wescott wrote: > >> mrsmith wrote: >> >>> (I am a DSP noobie..) >>> Basically this is what I have. >>> I have a device that measures RPM. >>> The device has a 360 degree optical encoder wheel. >>> So at a rotation speed of 1000 RPM >>> you have a 6 khz signal. >>> (1000/60) * 360 = 6 khz >>> Max is 9000 RPM so >>> (9000/60) * 360 = 54 khz (max signal freq) >>> >>> Now what I need is a : >>> 1000 rpm = 1khz 9000 rpm = 9khz >>> any ideas? >> >> >> >> Do you mean that you need a 1kHz signal to correspond to 1000rpm, >> etc.? If so you can do this with a simple divide-by-six counter, and >> you don't really need "DSP" at all. The folks on >> sci.electronics.basic could help you out. > > > Three flip-flops and a gate will divide by six. For robust indication, > you will need to debounce the signal from the encoder before you divide it. > > Jerry
Optical encoders are usually pretty clean -- but a schmitt trigger would be a good idea. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott <tim@wescottnospamdesign.com> writes:

> Jerry Avins wrote: > >> Tim Wescott wrote: >> >>> mrsmith wrote: >>> >>>> (I am a DSP noobie..) >>>> Basically this is what I have. >>>> I have a device that measures RPM. >>>> The device has a 360 degree optical encoder wheel. >>>> So at a rotation speed of 1000 RPM >>>> you have a 6 khz signal. >>>> (1000/60) * 360 = 6 khz >>>> Max is 9000 RPM so >>>> (9000/60) * 360 = 54 khz (max signal freq) >>>> >>>> Now what I need is a : >>>> 1000 rpm = 1khz 9000 rpm = 9khz >>>> any ideas? >>> >>> >>> >>> Do you mean that you need a 1kHz signal to correspond to 1000rpm, >>> etc.? If so you can do this with a simple divide-by-six counter, >>> and you don't really need "DSP" at all. The folks on >>> sci.electronics.basic could help you out. >> Three flip-flops and a gate will divide by six. For robust >> indication, you will need to debounce the signal from the encoder >> before you divide it. >> Jerry > > Optical encoders are usually pretty clean
Not the ones I used to use - even those with differential outputs. But that was a long time ago in a galaxy far, far away... (80's). -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
just divide your count by 6.  In other words, process the
encoder wheel output so that only every 6th pulse is used.

mrsmith wrote:

> (I am a DSP noobie..) > > Basically this is what I have. > > I have a device that measures RPM. > > The device has a 360 degree optical encoder wheel. > > So at a rotation speed of 1000 RPM > > you have a 6 khz signal. > > (1000/60) * 360 = 6 khz > > Max is 9000 RPM so > > (9000/60) * 360 = 54 khz (max signal freq) > > Now what I need is a : > > 1000 rpm = 1khz > 9000 rpm = 9khz > > any ideas?
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
Thanks for the help, BUT I must apologize for not posting the full
details.

Imagine a shaft with 2 encoder wheels.

1st Encoder 360 points around the wheel.
2nd Encoder 6 points around the wheel with ONE point slightly larger.
To be used for synchronization purposes.

The system I am trying to interface with is expecting

a 60 point encoder wheel, with 2 points missing. So 60-2 = 58 total
points
but built like a 60 point wheel. so in a single revolution you will be
missing 2 square waves. Again using for synchronization purposes.


So I need to take the 2 signals from dual encoder setup, and convert
the 2 signals into a single 60-2 based signal.  In other words combine
the hi-res signal and the low res signal and use the low res (single
wider point) to trigger my synchronization gap for the 60-2 trigger.


Does this make sense ?

Thanks for any help..




Tim Wescott <tim@wescottnospamdesign.com> wrote in message 
news:<10c9pqdcp05hp04@corp.supernews.com>...
> Jerry Avins wrote:
> > > Tim Wescott wrote: > > > >> mrsmith wrote: > >> > >>> (I am a DSP noobie..) > >>> Basically this is what I have. > >>> I have a device that measures RPM. > >>> The device has a 360 degree optical encoder wheel. > >>> So at a rotation speed of 1000 RPM > >>> you have a 6 khz signal. > >>> (1000/60) * 360 = 6 khz > >>> Max is 9000 RPM so > >>> (9000/60) * 360 = 54 khz (max signal freq) > >>> > >>> Now what I need is a : > >>> 1000 rpm = 1khz 9000 rpm = 9khz > >>> any ideas? > >> > >> > >> > >> Do you mean that you need a 1kHz signal to correspond to 1000rpm, > >> etc.? If so you can do this with a simple divide-by-six counter, and > >> you don't really need "DSP" at all. The folks on > >> sci.electronics.basic could help you out. > > > > > > Three flip-flops and a gate will divide by six. For robust indication, > > you will need to debounce the signal from the encoder before you divide it. > > > > Jerry > > Optical encoders are usually pretty clean -- but a schmitt trigger would > be a good idea.
mrsmith wrote:

> Thanks for the help, BUT I must apologize for not posting the full > details. > > Imagine a shaft with 2 encoder wheels. > > 1st Encoder 360 points around the wheel. > 2nd Encoder 6 points around the wheel with ONE point slightly > larger. To be used for synchronization purposes. > > The system I am trying to interface with is expecting > > a 60 point encoder wheel, with 2 points missing. So 60-2 = 58 > total points > but built like a 60 point wheel. so in a single revolution you > will be missing 2 square waves. Again using for synchronization > purposes. > > > So I need to take the 2 signals from dual encoder setup, and > convert > the 2 signals into a single 60-2 based signal. In other words > combine the hi-res signal and the low res signal and use the low > res (single wider point) to trigger my synchronization gap for the > 60-2 trigger. > > > Does this make sense ? > > Thanks for any help.. >
Assuming that the 2 missing points would exist, for a moment: then you'd be happy with a divider-by-six solution, right? if so, why not insert the missing points, and then divide-by-six. Again, an all electronic solution shouldn't be difficult. What you need, then, is a PLL, which generates a 60-points-without-missing-codes out of your signal. In easy words: it oscillates at a frequency which is compared and aligned to your incoming signal, but is too slow to "see" the missing points, hence goes on generating pulses. A microcontroller or DSP could do the same thing. If it's the only thing your device must do, I'd choose a hardware solution - if other side effects have to be taken into account, I'd probably vote for the micro, with reserve for future extensibility. Bernhard
mrsmith wrote:

> Thanks for the help, BUT I must apologize for not posting the full > details. > > Imagine a shaft with 2 encoder wheels. > > 1st Encoder 360 points around the wheel. > 2nd Encoder 6 points around the wheel with ONE point slightly larger. > To be used for synchronization purposes. > > The system I am trying to interface with is expecting > > a 60 point encoder wheel, with 2 points missing. So 60-2 = 58 total > points > but built like a 60 point wheel. so in a single revolution you will be > missing 2 square waves. Again using for synchronization purposes. > > > So I need to take the 2 signals from dual encoder setup, and convert > the 2 signals into a single 60-2 based signal. In other words combine > the hi-res signal and the low res signal and use the low res (single > wider point) to trigger my synchronization gap for the 60-2 trigger. > > > Does this make sense ? > > Thanks for any help..
The logical approach would use the encoder that the system was designed for, but sometimes it's possible to make a silk purse from a sow's ear. You're in luck: this is one of those times. A few packages of discrete logic, a small programmable logic device, or a simple program running in any simple microcontroller will do the job. I assume that the two missing pulses on the original wheel are across a diameter; whatever they are, you will know. You will need a circuit to reliably detect the "slightly larger" signal from the six-pulse wheel. It will probably be wide enough to require extra thought, but unless the motion is bi-directional (from your description of the encoders, I assume that it is not), that should make no serious difficulty. Two type-D or J-K flip-flops can be connected to divide by three with an asymmetric waveform, and another dividing that waveform by two will give a square wave at the desired frequency. Decoding the index of the six- pulse wheel and counting from there will give you the signals to suppress the correct two of sixty pulses. Sketch the signals you have and those you want on a large piece of graph paper. The necessary transformation should come clear. The task will be a bit easier if you can specify and adjust the phase relation between the two encoders. Jerry P.S. On most encoders I've used, the index signal is a separate output. You may be seeing the two sensors tied together, giving a larger signal when the index is present. If that's so, separating them will allow an easier and more robust solution than a level-detecting signal slicer. P.P.S. There is probably a group for which this is more on topic than comp.dsp. Still, yours is a digital signal that needs some processing. -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

> mrsmith wrote: > >> Thanks for the help, BUT I must apologize for not posting the full >> details. >> >> Imagine a shaft with 2 encoder wheels. >> >> 1st Encoder 360 points around the wheel. >> 2nd Encoder 6 points around the wheel with ONE point slightly larger. >> To be used for synchronization purposes. >> >> The system I am trying to interface with is expecting >> >> a 60 point encoder wheel, with 2 points missing. So 60-2 = 58 total >> points >> but built like a 60 point wheel. so in a single revolution you will be >> missing 2 square waves. Again using for synchronization purposes. >> >> >> So I need to take the 2 signals from dual encoder setup, and convert >> the 2 signals into a single 60-2 based signal. In other words combine >> the hi-res signal and the low res signal and use the low res (single >> wider point) to trigger my synchronization gap for the 60-2 trigger. >> >> >> Does this make sense ? >> >> Thanks for any help.. > > > The logical approach would use the encoder that the system was designed > for, but sometimes it's possible to make a silk purse from a sow's ear. > You're in luck: this is one of those times. A few packages of discrete > logic, a small programmable logic device, or a simple program running in > any simple microcontroller will do the job. > > I assume that the two missing pulses on the original wheel are across a > diameter; whatever they are, you will know. You will need a circuit to > reliably detect the "slightly larger" signal from the six-pulse wheel. > It will probably be wide enough to require extra thought, but unless the > motion is bi-directional (from your description of the encoders, I > assume that it is not), that should make no serious difficulty. > > Two type-D or J-K flip-flops can be connected to divide by three with an > asymmetric waveform, and another dividing that waveform by two will give > a square wave at the desired frequency. Decoding the index of the six- > pulse wheel and counting from there will give you the signals to > suppress the correct two of sixty pulses. > > Sketch the signals you have and those you want on a large piece of graph > paper. The necessary transformation should come clear. The task will be > a bit easier if you can specify and adjust the phase relation between > the two encoders. > > Jerry > > P.S. On most encoders I've used, the index signal is a separate output. > You may be seeing the two sensors tied together, giving a larger signal > when the index is present. If that's so, separating them will allow an > easier and more robust solution than a level-detecting signal slicer. >
It sounds like a crankshaft sensor, which uses just one channel for cheapness.
> P.P.S. There is probably a group for which this is more on topic than > comp.dsp. Still, yours is a digital signal that needs some processing.
sci.electronics.design would be good, but describe your problem fully from the start. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com