Shop OBEX P1 Docs P2 Docs Learn Events
Shorted encoder?? — Parallax Forums

Shorted encoder??

Hey guys, strange problem, hoping someone might have a solution...
The problem as it stands is: when the left encoder is plugged into the board (P13), and the PWR switch is set to 2, the servos jerk once and then all activity ceases. No lights, no running code, nada. Pressing reset does not have any effect during this state. When P13/left encoder is unplugged, all else works normally. When in PWR switch 1, everything works. Can run programs with terminal open and see everything reacting as it should.

Have tried the following:
-Re-run 'Test Encoder Connections' program
-Re-run servo calibration program
-run a blank program to EEPROM
-Switch batteries
-Check, disconnect, reconnect all electrical connections
-Remove all circuit components other than 2x 20k resistors
-Dismount left wheel and encoder and try to firm up connection

The history of the problem is the following:
1) Wrote a combo visible light follow + ultrasonic obstacle avoidance program
2) Tested for ~1hr with good to marginal success
3) Lost sensitivity on sensors (stopped following light, stopped trying to avoid obstacles)
4) Updated program; on deploy, lights on, but no movement (logical structure error)
5) Re-traced steps in program to working version, held reset button while setting power to position 2 - and then current problem ensued.


Has anybody ever run into something like this? I have another encoder en route, but am in a time-critical situation (class project) and would love to debug ASAP...

Thanks!

Comments

  • It sounds like something serious, that could damage a pin or the whole controller. Did you try connecting the right encoder to P13? I would leave the questionable one out of circuit.
  • Sorry, typo there - left encoder is normally connected to P14, right to P15. Just tried unplugging left encoder and plugging right into P14, all seems to work well - the lights stay on. 'Test Encoder Connection' program works as expected for one encoder (right on P14) plugged in and the other not, i.e. the LED on P26 blinks when I turn the right wheel, while P27 stays on solid.
  • Check the pull-up resistors and your circuit, it should look like this.
    476 x 474 - 28K
  • Like this? I've done the connections exactly according to the manual for sure (checked like 3 times), although I cannot confirm the circuit setup is exactly as you have it...
    405 x 720 - 489K
  • It looks like 20k resistors in your set-up, may be to much. Try 10k, brown-black-orange.
  • They are indeed 20k, that's what Parallax sends with the kit...why would the other encoder continue to function correctly though?

    If the resistors are too much, why did we get 2x 2hr+ functional testing sessions before things went haywire?

    Also, if I lower the resistance by that much, don't I then risk passing too much current through and blowing more components? I have to demo this on Wednesday, and I really don't want to mess up any more hardware...
  • MikeDYurMikeDYur Posts: 2,176
    edited 2016-08-01 00:31
    You won't hurt anything with the change, but I'm not sure why you were supplied 20k, documentation calls for 10k. Maybe someone else will chime in on this, as I don't use these encoders myself. From your original post, it sounded like a short that compromised the whole board. Doesn't look like that now.

    EDIT: I took it for granted that you had a BS2 BOE.
  • Ah yeah, sorry should have clarified that. Using a Propeller board v1 (P8x32A-Q44, ActivityBot kit), not a BOE.

    I myself was worried for a while that I had comprised the pin and/or entire board. Now pretty convinced it's the encoder, but still stumped as to why the encoder hardware would malfunction. I mean, it ran into a few feet during testing, but not excessively hard, and that's not what preceded the malfunction. Mostly I'm curious to see if anybody else has had this problem, or whether I really am just good at breaking things in novel and curious ways. Would be stoked if somebody knew of a hardware (or firmware?) fix. My old man thinks a transistor or something might be stuck in the wrong position, but we seem to have proven that the pin itself works just fine.

    Thoughts?
  • Yes, on the Parallax Learn site, it does show 20k resistors, I wouldn't change that, but make sure your batterys are up to the task.
    500 x 309 - 49K
  • My first suspension (well second after a battery problem) is the encoder is out of alignment.

    Make sure the encoders look the same on both sides of the bot.

    I think it would be a good idea to use some sort of diagnostic program which just shows the state of the I/O pin connected to the encoder. Can you write a simple program to display the I/O pin's state?

    If you have the Propeller Tool installed, I could help you with a Spin diagnostic program. I could probably help with some C diagnostic code but it's much easier for me to write a quick program in Spin.

    Besides checking the I/O pin state (of the encoder pin), you should also make sure you can make the CR servo spin in both directions. Can you write some simple code to spin the wheel?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-08-01 06:28
    20K is the correct value. Any documentation that specifies 10K is wrong.

    -Phil
  • I would try Mike's suggestion. Place the working encoder onto pin 14 (where the bad encoder was connected) to narrow down if it's pin 14 or the encoder.
  • @Miguel: Did so, check my 2nd post/1st comment above.
    @everybody else: Definitely was a bad encoder. Received replacement today, took the connection apart to see what it looked like, and there was definitely a short there - see picture.

    Good news is, having replaced the encoder and tweaked the code a bit, it works perfectly! Thanks for the help & suggestions, particularly MikeDYur!
    394 x 720 - 344K
  • RayC16 wrote: »

    Good news is, having replaced the encoder and tweaked the code a bit, it works perfectly! Thanks for the help & suggestions, particularly MikeDYur!


    Yes success! Really good to hear that you had no collateral damage, never seen anything like it, as serious a short that you can have, luckily you weren't working with VIN. Have fun with your robotics hobby, and good luck with your class project.

    BTW: Welcome to the forum, you have been initiated.
Sign In or Register to comment.