Interpolation
Landry
Posts: 17
is there any object that I can use for transforming an incoming sine/cosine to a pulse using the propeller chip?
Post Edited (Landry) : 3/26/2008 1:56:47 PM GMT
Post Edited (Landry) : 3/26/2008 1:56:47 PM GMT
Comments
Hope this help further.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
My project consist of a motor surrounded by magnetic sensors. The sensor send an analog signal to an ADC that convert it to digital. then I get the digital numbers and from there I want to create a pulse stream that can be viewed on a scope. Basically, I want to build an interpolator.
My idea here is to have a lookup table assuming that I have the perfect sine/cosine at a constant speed and from the incoming values from the ADC, I can then approximate the distance traveled by the motor at any moment and create the corresponding pulse.
I don't know if I'm right in this approach or there is different one.
Maybe this en.wikipedia.org/wiki/Pulse-code_modulation can give you an idea of what I want to do
Post Edited (Landry) : 3/27/2008 8:50:09 AM GMT
you want to decode that to an angle, then generate a pulse whose size is equal to that angle?
Sounds like the hard way to do something. Minding the polarities to determine the quadrant,
I think you can get the angle using the arctangent of (the sine divided by the cosine), which
you would have to make a table of, although there may be other ways to do it.
An easy way of determining the rotation angle of the motor would be to use a potentiometer
that can continuously rotate. One of those could even control a LM555 timer chip to generate the pulses.
If it is than you can use the trig tables in the propeller ROM for the conversion and simply add the change in angle to a running total of the angle and than use something like one of the servo objects to output pulses for you.
-Phil
Thanks for all your answer and sorry for the late reply.
From the reply, I see part of what I want to do in each of them.
A while ago, I posted a code where I was using the 'Quadrature encoder' object to find the position of a motor. This is based on the number of pulses that are counted from the encoder. What I want to do now is build a device (encoder) that will take the digital signal from the AD and then make the pulses in such a way that I can see them as squared line on the scope and use the 'Quadrature Encoder' object on it.
Before the system on which I'm gonna work is ready, I'm testing this functionality on different ADC, the AD7706. I read the output of the chip, but just do'n't know where to start for converting the numbers to the nice pulses.
Regards,
Landry