Jump to content

Testing high resolution optical encoder.. not so smooth results


Narwhal
 Share

Recommended Posts

I spent a little bit of time today attempting to use the high resolution optical encoder from my Tascam project with MIOS.  The results seem not promising, so I wanted to check in here and see if anyone has any suggestions for something I may be missing to get it to work.

The setup:

I have the encoder wired to d0 & d1 of the 4th shift register of a SmashTV DIN module.  On the reverse of the board I've added a small jumper to send 5v power over the unused pin of the input connector.  This was necessary because the encoder needs power and ground to run it's internal logic.  The encoders A output is connected to d0 and the B output is connected to d1.

I'm using the enc_speed project loaded on an PIC18F452.

Procedures:

As I spin the encoder in either direction, slow or fast turning seems to makes no difference, the direction of the value will change directions even though I have continued to spin the encoder in one direction.  It seems to change increment direction most often when I release to re-grasp for further turning, or pause for a bit.

Questions:

I'm guessing that the rate of change of the encoder is either so fast for that MIOS misses some changes, or the pattern is not equivalent to the NON_DETENTED setting.  To me it appears to be fine for the NON_DETENTED setting.

Any suggestions for what I might try?

Spec and pictures are in the part forum topic.

Video of the problem here:

mfuBxhUT3Mc

Link to comment
Share on other sites

More results:

MIOS_ENC_MODE_DETENTED  : Value only increases no matter which direction I turn.

MIOS_ENC_MODE_DETENTED2  : Value only increases no matter which direction I turn.

MIOS_ENC_MODE_DETENTED3 : Value wont increase or decrease no matter which direction I turn the encoder.

EDIT:

** I've also removed the pull-up resistor on the DIN that this is connected to because the encoder performs it's own pulling-up and pulling-down.  This gave no improvement at all.

Link to comment
Share on other sites

As I spin the encoder in either direction, slow or fast turning seems to makes no difference, the direction of the value will change directions even though I have continued to spin the encoder in one direction. 

Just a wild guess: you are probably facing some undersampling here - the encoder outputs more signals than the PIC input / the shift register can handle. You are using high resolution encoders, right? How many peaks per turn do they output? (I got this idea because the problem looks similar to what can be observed in those western / cowboy films: although you know that the coach is moving forward, sometimes the wheels seem to be turning backwards - that's because the "continuous" movie is actually a 24 pictures per second, and undersampling occurs.)

You should probably try to connect the encoder directly to some input pins, e.g. on Port A ?

Best regards, ilmenator

Link to comment
Share on other sites

The encoder speed test app seem to already set the update frq to 1.  I don't think I can take it any lower :-)

movlw 1 ; ms

call MIOS_SRIO_UpdateFrqSet

So does someone have a driver for encoders that are on port A, or do I have to write one?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...