Hi,
I have a problem with my project. I have an encoder signal for the PMSM motor position which I have brought. I am going to develop a FOC for the motor by integrating an inverter. However, my designed inverter has a resolver to get the position signal. Now I need to convert my encoder signal into an analog signal. In PLECS, I saw there is a quadrature encoder counter. I want to know if PLECS has a decoder blockset for that or any method to do this. Otherwise, can you please help me with some resources?
Thank you
Your question isn’t exactly clear to me. I’m assuming this relates to Code Generation for the TI C2000, based on your last few questions posted to the forum, but please correct me if I’m wrong.
Now I need to convert my encoder signal into an analog signal.
For the TI C2000 TSP you can use the Quadrature Encoder Counter block which uses the QEP peripheral on the C2000 chip to count the edges from the counts edges generated by a quadrature encoder
The outputs of the Quadrature Encoder block are The block outputs the current counter value (c), the index pulse (i), and the latched counter value from the previous index pulse (ic). You can use these values to determine the machine angle and speed. See the “Six-Phase PMSM” demo model for an example.
However, my designed inverter has a resolver to get the position signal
Using a resolver is quite different from an encoder. For the resolver, the C2000 chips do not have an onboard resolver decoder. Typically these are used with external hardware. What does your resolver decoder hardware look like? That will determine the interface to the C2000 chip and what peripherals to use.
I’ll also note that the RT Box 2 and 3 include resolver emulation hardware which can a) emulate a motor drive system with a resolver and b) generate an exciter voltage and calculate the rotation angle based on sine and cosine feedback signals to control a physical motor drive system.
Hi Bryan,
You are correct, I am asking about Code Generation for the TI C2000. Actually, what I need to do exactly is convert the encoder signal into sine or cosine wave form or ramp signal and output it through an analog pin of TI C2000. Then I can give that analog input to the resolver input. Can you please give some guidance for converting encorder digital signals to analog signals and linking them into DAC output pin.
Thanks for the additional details - it sounds like you want to use the C2000 device as a “translator” between the encoder and resolver. Review the Six-Phase PMSM demo model I referenced previously where an encoder measurement is transformed to an electrical angle. From there you can pass it through a Trigonometric block and to a DAC to pass through the Sin/Cos signals.
I suspect you’ll hit other roadblocks along the way emulating a resolver with this approach, but that’s something for you to discuss with your colleagues.
Sachith,
this is not how a resolver works. To emulate a resolver, you would need to map your counter value to an angle theta (where max_counter_value → 2*pi), then multiply an incoming exciter signal with the sine and cosine of theta and output the resulting signals. Since the exciter signal is itself a sine wave, you’d need an ADC to sample the exciter signal, multiply it and pass the results to two DACs.
I doubt that this can be done on a C2000. RT Box 2 and RT Box 3 have some dedicated hardware which would allow this kind of conversion.