Shop OBEX P1 Docs P2 Docs Learn Events
Circuit stops working right when i connect motor encoder grounds — Parallax Forums

Circuit stops working right when i connect motor encoder grounds

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-12-10 15:47 in General Discussion
Ok so im having a weird issue. Due to my bluetooth module breaking i went to write my pid code for my encoders, which are built in to the motor. I made special board for noise filtering and emi, just a bunch of diodes and caps with a 6pin header to break out my motors encoder and power lines. Ive tested all systems indavidually and they work fine.

now everythings togather and working but as soon as i plug in the 5v ground for my motor encoder my wheels go slow in one direction depending on what encoder is grounded, like i said everything works beautiful seperately!! Everything seems to be good with the micros, hbridge, motors, its just when i plug in the encoders ground that everything goes wrong. If i power the encoder from a totally different 5v supply each encoder works fine when connected to a logic analyzer but as soon as the encoders are on the same power source the wheels stop again... so at this point each encoder would need its own isolated 5v supply. anyone have an idea about what could cause this

Comments

  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-08 17:28
    Did you use something like 10K pullups to the props 3.3V on the open collectors of the encoders?
    With this pullup the encoder pulldowns can go directly into the Prop pins. Or for safety a 10K to the Prop.

    Duane J
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-08 20:44
    it does the same thing with or without the encoder lines pluged in. the encoders go to an arduino tied to a prop, i never coded the arduino pins to inputs but like i said if i just tape the encoder signals off as soon as i plug the ground for the encoders +5v in everything goes bad, the acual +5v signal could be taped off too the grounds are causing the issue. i will draw a schematic and take a pic asap, i think this is purely an electrical issue although im not sure what it could be all my grounds are tied togather for every voltage source. isolating the encoder power lines is the only fix so far...

    Btw no pull up resistors are attached there built in to the faulhaber.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-08 21:31
    Hi rwgast
    Btw no pull up resistors are attached there built in to the faulhaber.
    Your quite right. The Faulhaber gear motor has them built in.
    I just measured to see if there was any connection between the encoder and the motor or case.
    It looks like there is no more than about 30pF between any pin on the encoder, 2 3 4 5, and the motor, 1 6, or the case.
    So the encoder ground should have little to no interaction with the motor.

    Maybe your motor has a short somewhere, possibly in the ribbon cable.

    Duane J
  • RS_JimRS_Jim Posts: 1,768
    edited 2012-12-09 05:39
    Put a volt meter between the logic ground and the motor ground. You may have a ground loop.
    Jim
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-09 15:16
    As far as a ground loop thats what i figured but im not sure how to check for them in non audio applications where you can here it, what would the voltmeter read?

    I do know what the problem is now, somewhat, although idk how to fix it. I took everything apart and then hooked both EMI/Noise boards and motors with encoders to a propeller board running Propalyzer (mostly to make sure the encoders worked and i didnt fry them) and everything went smoothly. So i did some messing around to trouble shoot the problem and figured out whats happening. When the hbridge flips the pins and the encoders are connected thats what stops everything i guess causing a short.. ?

    Right now im just using a 9.6v battery and l293e to test things, I will be using a different bridge and 18v later. So I have my hbridge connected to an arduino and motors like this,

    l293 enable1 to +5v
    l293 in1 to arduino pwm pin 9
    l293 in2 to arduino pwn pin 10
    l293 out1 to motor +5
    l293 out2 to motor ground
    l293 vs to +9.6v
    l293 vss to +5v

    So basically i just send a pwm signal to one of the l293 inputs then pull the other input low, while the enable pin is always hi, like this

    l293 enable +5
    l293 in1 to arduino analog pwm signal
    l293 in2 to arduino digital pin out low

    so if i want to reverse the motor i just flip the in1 and in2 settings, basically this would cause the motors +5v input to be connected to the encoders ground and thats when the issues start... am i going about controlling the hbridge wrong? Im acually controlling the arduino via serial with a propeller and i want to get this all sorted out soon so i can start soldering permanent boards and get this breadboard off my bot.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-12-10 05:25
    The schematic is definitely required to put this to rest.

    However, from your description and tests, you're describing what happens when the h-bridge has one side being connected to 0volts via a motor connection.
    The motor connections on the h-bridge should only go to the motor leads; not to a ground or source except by the action of the h-bridge.

    Cheers,
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-10 15:47
    Ok so I found out today the problem is definitely in my EMI/Noise break out board. When I bypass the motors +/- Signal pins with wires connected directly to the l293 everything runs fine... Im not sure exactly what the issue could be, im going to recheck all my wiring but I thought id post a schematic of the breakout board just to make sure everything is actually correct, I had a heck of a time figuring out how to wire the flyback diodes so im not sure if I made this board right or not. Im also posting a physical picture so the general idea of what im doing makes a little more sense.

    IMG_20121129_100925.jpg
    IMG_20121210_153518.jpg
    .
    1024 x 768 - 70K
    1024 x 1365 - 161K
Sign In or Register to comment.