Hello,
I have a sensor that I can read from an exact (or accumulated) angle of rotation in digital form.
How could I emulate an encoder interface (for a motor controller) based on the position information in digital form?
That means I need the number of quadrature pulses generated to match the exact position obtained in a digital form. Also the frequency of the pulses generated should match as closely as possible the actual rate of change of the position information.
I am familiar with the concept of an angle tracking observer on an encoder input (a PLL loop designed to match the speed based on the angle of rotation received). But I am not sure how to make this work "backwards".
Obviously, I need a continuously variable frequency generator, that I will somehow lock in a feedback loop to the position I am reading from the sensor.
How would one implement this? I think the variable frequency generator could be solved using a DDS principle (without using a DAC, just using the MSB of the phase accumulator). But I am not sure how to design the feedback loop around this.
It seems to me that a PSD (or just) PS controller would do, taking the difference between sensor read position and number of generated pulses as the error input. Output would feed the frequency tuning word.
Now thinking about it, this is also a PLL loop (exactly what I wanted), as the phase accumulator in the DDS is in fact the integrator in the loop that forms the PLL together with the PS controller.
I am currently learning VHDL and toying with FPGAs, so this seems a good opportunity to make something more useful than a blinkelight and learn a lot from it.