playing with a track ball encoder but X axis is wrong

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Playing with thishttps://www.avrfreaks.net/sites/... it has two optical encoders that convert the speed to a voltage. The Y seems spot on If I move the ball up I get a > 2.5 voltage. If I move it down I get < 2.5. For the X going both right and left I get > 2.5. At reset I get 2.5 on both and there is a calibration pin.  I do use that pin to center the voltage. I can not figure out why I get a > 2.5 for my X axis. If I take the ball out and just spin the encoders I do get a much smoother response but I still get this strange result.

 

the Y axis does seem inverted but that may be intentional, I'm not sure.

 

For implementation I['m using a avr32u4 with the ADC port. I also see the same voltage response on my scope. Just can not for the life of me figure out why the device is doing this. From the tech manual, it claims I should get left and right responses. 

Last Edited: Wed. Oct 13, 2021 - 12:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

X & Y are exact duplicates...so you better get the same results, or start tracing.  

 

Clean your dusty optos

 

Note the output is 180k ohms, too high for the AVR ADC.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Wed. Oct 13, 2021 - 01:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With only a quick look at the schematic, I'd guess that (+) pulses (motion) increase the neutral position, 2.5 V, voltage on Cap C7 (C8), while (-) pulses (motion) decreases the baseline voltage on the caps.

 

With the schematic you can see the pulse inputs to the 4013, and look at TP5 and 6 to see the outputs of that chip.

You can also see the (R) pulses on the 4011 pin 3, and the (L) pulses on the 4011 pin 4, and the inverted (L) pulses on the 4030 pin 10.

You can also see the voltage on the caps.

 

In any event, you can follow the signal train and see why the one channel isn't working.

 

JC

 

Cross post...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
start tracing

+1

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Note the output is 180k ohms, too high for the AVR ADC.
Would this explain why connecting the AVR to it pulls the voltage high (5) . I set the device to go in calibration mode and it shows 3 volts on each pin until I connect the AVR.

 

With the ADC port off I get the 180k 3v but enabling the ports pull up I can not get a resistance reading ( not really sure what that means) but clearly see 5v. 

 

If I put any size resister (tried 100, 500, 1.5) in parallel I get %90 of my voltage I was hoping putting it in the 1k range would make it work. I'm failing to understand something here.

 

Looking at the voltages on a scope they are pretty near constant.

Last Edited: Thu. Oct 14, 2021 - 04:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

is the AVR set as an ADC input, or as a 5V output pin??

 

In any case 180k is way too high to use the ADC. Add a unity buffer opamp to each signal before the ADC. 

 

What is the reason they used 180k?  They had one.  Where does this normally go to?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

is the AVR set as an ADC input, or as a 5V output pin?? The port is configure as input. with pull up I get 5v, with no pull up (floating) I see the 3v. 

 

In any case 180k is way too high to use the ADC. Add a unity buffer opamp to each signal before the ADC. I may try this.

 

 

What is the reason they used 180k?  they had one.  Where does this normally go to? This is a very old (40 year) track ball device commonly used in arcade setups. I'm not sure why 180k, that just seems stupid to me, a lower resistance would have made more sense.

Last Edited: Thu. Oct 14, 2021 - 04:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a very old (40 year) track ball device

Well then, you'll certainly want to see this for inspiration--it was a big hit

https://www.youtube.com/watch?v=...

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
What is the reason they used 180k?  They had one.  Where does this normally go to?

S_K_U_N_X wrote:
This is a very old (40 year) track ball device 

that old, maybe it was valves ?

 

they tended to be higher impedance ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

Why not just connect to the encoders?

 

There's even testpoints on the signals ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

because its for consumers.

 

 

So maybe the dip version of this guy?

https://www.ti.com/lit/ds/symlin...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

S_K_U_N_X wrote:
I can not figure out why I get a > 2.5 for my X axis

since both sides of the circuit are the same, I would assume the xor chip A5 has a bad gate, replace it and see if that fixes your issue with the voltages.

Jim

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

Lets go Brandon!

Last Edited: Thu. Oct 14, 2021 - 06:30 PM