Encoder interfacing with dsPIC33FJ256MC710

Post Reply
giulio
Posts: 1
Joined: Wed Nov 05, 2008 7:23 pm

Encoder interfacing with dsPIC33FJ256MC710

Post by giulio » Thu Nov 20, 2008 6:15 pm

Hi Lubin,

I expose the problem:
I'm working on the Flex (full version) and I have to interface two incremental rotary encoders, both with 2 channels;
the control I've dveloped is formed by the two encoder signals in input (processed by QEI or other; I never thought about yet)
and the torque for the electric motor in output (there are differences using OC or PWMout block?).
I'm asking to myself where I can place it: in the gpio, one in gpio and the other in QEI, or with an external chip (like hctl2032)?
for all this solutions I would also need the simulink blocks. I'm not so expert in this field for create the c functions and than the blocks,
and also for conversions of the type.
Can I have your help?

thanks
Giulio

malife
Expert
Posts: 56
Joined: Tue Apr 17, 2007 7:24 am
Location: Santa Cruz, CA
Contact:

Re: Encoder interfacing with dsPIC33FJ256MC710

Post by malife » Sun Jan 11, 2009 5:17 am

Hello Giulio,
It seems like your problem is a bit more related to design rather than the blockset itself. If you need to read more than one QEI channel, than there is not much you can do with a dsPIC. You can try using the input capture, but be aware that you have to write your own logic to determine the phase and the speed (besides you need an aditional one if you want to use the index from the encoder). QEI is a relatively new module in the dsPICs make sure you look at the Microchip websited they have a "tips and tricks" document specifically related to doing that with interrupts and the input capture module (which is fully soported by Lubin's blockset).

Regarding PWM, yes, PWM engine is much more efficient than the OC. The PWM uses no timer and it is better suited for motor control.

Hope this helps

Mariano

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests