Shop OBEX P1 Docs P2 Docs Learn Events
12v motor noise resetting the prop even with flyback diodes — Parallax Forums

12v motor noise resetting the prop even with flyback diodes

eagletalontimeagletalontim Posts: 1,399
edited 2014-09-24 10:54 in Propeller 1
I have just about finished my solar tracker which uses 2 12V motors to move the base to face the sun. This is working great so far. The problem I am having is noise from the motors is either resetting the prop or causing the frequency readings to go crazy from the 556 timers that adjust frequency based on light into 4 LED's. The light sensor is connected via a standard Cat5 cable and is about 4 feet long. That circuit is run from 5V and has a 4 each 10K pull down resistor close to the prop for each frequency signal back to the prop. There is a 10K resistor on the light sensor board that reduces current back to the prop. When the motors are both off, the signal is clean and works great. When either motor kicks on, the frequency on any of the 4 sensors can jump dramatically while the motor is running. This happens while the motor is running, not right when the motor kicks on.

I am using 2ea relay h-bridge's with flyback diodes on the coils, and from the motor output. There are also diodes between the prop and base of the NPN transistor which switches the relays.

Everything is running from 1ea 7ah sealed battery right now and will be converted to run from the battery bank when installed. To stop this noise, I need help on what to do. Should I add an inductor? If so, how would I determine what size I need? Should I separate the motor power and the prop power including ground and just use a capacitor to join the grounds so the transistors will work? Any help is appreciated!

EDIT * The motors are either on or off. No PWM is used.
«13

Comments

  • tonyp12tonyp12 Posts: 1,951
    edited 2014-09-18 10:19
    Anytime when motors are involved run separate power wires (ground included) from battery to them, never daisy-chain them with circuit.
    Think of ground as river, once it reach the ocean (battery terminal) it's not likely to splash current up a another river next to it (the separate ground wire)

    Show us pics and schematic of the layout and what LDO you use etc.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-18 11:48
    The only way I could separate grounds is to run 3 wires (2 grounds and 1 power) which will be about 20ft of wire each. This is the distance from my control box which is mounted on the solar panel base and the batteries are inside my shed. I am using the 7Ah battery for testing purposes right now until the concrete dries to mount the base.

    The power circuitry for the prop is a switching regulator all in one package for the 5V (Fits right in place of a 7805) and a 3.3V linear regulator. There is a diode on the positive side from the battery to the 5V regulator. After the diode there is a 100uf capacitor rated at 35V. There are also filtering caps between each regulator to help smooth the power before going to the prop. The board is one that I have made for another project that has worked for years with no issues but it was not designed to control 12v motors. I can't really change the circuitry on the board so if I can filter the power before going to the circuit board. I am at work right now and can't draw up or take a picture of the schematic.

    The H-bridges are not on the same board as the Prop are are just connected through wires to the main board. Here is a picture of my current setup except the hbridge's are now relay's instead of transistors and I have removed the 74HC165 since I only need 3 switches. The h-bridges are on the side of the box.
    448 x 796 - 104K
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-09-18 13:26
    A bridge diode block may not be enough. What happens if you put a Delta capacitor configuration on your motors?

    Use three 0.1uF caps.

    One cap directly across the motor terminals
    One cap from one motor terminal to GND
    One cap from the other motor terminal to GND
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-18 13:41
    I will have to try that when I get home. Is there a specific cap that would work best or any 0.1uF ceramic cap? I can swing by radioshack on my way home to pick up some more capacitors. If I need any other things that may help my issue, please let me know! I am almost ready to mount this and have some "free" power...... :)
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-09-18 13:49
    A 0.1uF ceramic "disc" cap would probably be the best.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-18 14:01
    Ok, thanks for the information. I will try some out tonight and see how it does. Will update as soon as I get it tested.
  • LA6WNALA6WNA Posts: 138
    edited 2014-09-18 14:08
    Guess we`re talking about RF noise here, and the cables acting like antennas. So Beau`s cap configuration will surely help surpressing the noise. Be sure to mount them as close to the motor as possible. I would also pay attention to the reset line at the propeller board. The longer this one is, the better antenna it is to pick up noise. Keep it short.
    A ferrite core around the motor-cable at the motor end, would also help stopping the radiation of the RF. The RF`s source is almost always from the sparks at the brushes in the motor. I assume that this is not a brushless motor. Hope you figure out this and get it working. I really like your project. Its cool.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-18 14:36
    Here are a few photos I have of the entire system. I may have gone way too complicated, but hey...it's fun and a good learning experience.

    Please ignore the mess :) I have most of my shed filled up with car parts from my car being in 100,000 pieces!
    448 x 796 - 66K
    448 x 796 - 77K
    958 x 539 - 72K
  • Mark_TMark_T Posts: 1,981
    edited 2014-09-18 18:15
    With long cables 10k is no use as a pull-up, think 1k or 560 ohms even, and add caps if its a slow signal to soak up
    pulse noise / crosstalk.

    Don't share a ground wire in a cable run between a motor and a sensor, in fact don't run sensor and motor cables close together
    if at all possible.
  • cavelambcavelamb Posts: 720
    edited 2014-09-18 20:43
    And run separate ground wires!

    There may be some RF in there, but the reset problem is most likely inductive kickback from the motor.
    Take the motor out of the circuit and see if there is still a reset problem?
    If there is, then pull the relays, because that can do that as well.

    This is at a MUCH lower frequency problem, bigger caps.
    Separate grounds, power leads, chokes and caps - ALL!
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-18 21:49
    How can I run separate ground for the motors since the entire circuit is supplied by 1 battery bank and all the wires will be run under ground for roughly 12 feet in one PVC pipe and an additional 4 feet up on both sides making about 20 feet of wire all run together?

    I am making a few changes to the sensor board and I changed all the pull down resistors on the prop's circuit board to 1K's to see if that will help anything. I am also going to try to use a toroidal inductor, diode, and large capacitor on the before the prop's circuit board to see if that will protect it from noise from the motors.

    The strange thing is the motors turn on and off just fine with no noise issue at the time they switch between the states. The strange readings happen while the motors are on for at least 2 to 3 seconds.

    Each motor draws around 500ma @ 12V if that helps any.
  • LA6WNALA6WNA Posts: 138
    edited 2014-09-19 00:26
    The strange thing is the motors turn on and off just fine with no noise issue at the time they switch between the states. The strange readings happen while the motors are on for at least 2 to 3 seconds
    Could it be that your system has a small amont of "free run"? When it comes to the point where the motor gets more load, the sparks from the brushes getting stronger and generates more RF nois to the environment. Just a thought...
  • evanhevanh Posts: 15,921
    edited 2014-09-19 02:05
    I presume the eventual "battery" that you will be running from is the one the PV panel will be charging? And everything else is mounted out on the tracker, right? Something like what I've hand sketched in the attachment.

    In this case you shouldn't need separate power for the motors. Just have to toughen up the power rails at the relay board with a large capacitor and make sure the 3 volt circuit is entirely off the main current path. Maybe even use a diode+cap in front of the 3 volt regulator just to be sure.
    1024 x 550 - 52K
  • JohnR2010JohnR2010 Posts: 431
    edited 2014-09-19 04:24
    I have a circuit that drives the elevation actuator of wattsun trackers and to make it work reliable I had to do exactly this. In the 5v supply to my 3v regulator I put in an super Cap 2.5f (digi part number 589-1008-ND) it will run the propeller for 90 seconds without power. Solved all my resetting problems. I use solid state relays that are photo coupled to the propeller that also helps. Good luck.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 04:36
    @evanh, that is exactly how the system will be set up. Nice sketch by the way :) If I used a diode and a capacitor, I would have to put it before the entire circuit board the prop is on since it is a printed circuit board I have made for another project. Most all the parts are surface mount and the traces are short and would be hard to connect to.

    If I can use a capacitor and diode on the main 12V coming into the "brain" board, would I put the diode on the ground side and not on the positive side?

    @LA6WNA, I am pretty sure that is a good possibility since everything is hand done on this project and I am sure it is not perfectly aligned to give the motor's a smooth rotation.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 07:09
    I can't seem to locate a DPDT SSR on digikey so I think that option is out. I don't think the relay's are the problem because there is no glitch when the motors turn on or off.... only while running. I may have to try the super cap.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-09-19 07:37
    When your control circuit is deriving it's power from the same source as motors you should also use a diode (always in the supply line, never ground!) with a large capacitor to hold up the supply. There is no need to use a supercap and in fact if the motor stalls it will kill the supply, burn the drivers, while the control system merrily tells it to keep burning. Nah, just use some large electrolytic to hold up the supply during voltage droops and if the motor gets stuck for more than a few seconds then the controller will be reset, presto!

    I have only glanced at this thread a few times but this is one of the basics you need, the other is to have a separate power ground, that is the ground for the motors (via the relays/drivers etc) should go back to the supply and the logic should have it's own ground. Commutator noise can be a big deal while running, especially since you don't have any shielding then the noise is also injected on the signal grounds, not so good. Try the suggestion with the caps across it etc.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 09:20
    I have tried to run a separate ground wire from the h-bridge to the battery before and it did not help. Is there a way I could make a "buffer" circuit board just for the Prop power supply? I have several large caps I have salvaged from computer power supplies and a few inductors and hundreds of diodes. If I can make a circuit board that filters / protects the circuit board for the Prop, I think I will be able to make the modifications without having to go to an entire new circuit board.

    I will also be adding the ceramic capacitors if I can figure out a way to do it. Since the motors are being controlled in either direction, I guess I will have to run a separate ground wire to them to solder the "delta" configuration for the ceramic capacitors? That ground would need to come straight from the batteries and not be connected to the ground of the h-bridge?
  • cavelambcavelamb Posts: 720
    edited 2014-09-19 11:12
    Re: "Buffer circuit on power to logic board" - That's what Peter and some others described.
    Protect the logic power from AC noise from the motors (coils too).


    Re: running separate ground wires:
    What is really being suggested is that it needs to have a single point ground system.
    Think "Star" topology.
    http://www.eetimes.com/document.asp?doc_id=1274098
    http://www.mikeholt.com/mojonewsarchive/GB-HTML/HTML/Single-Point-Ground~20040427.php

    As opposed to a multi-point ground - or "grid"
    http://en.wikipedia.org/wiki/Multipoint_ground
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-09-19 11:40
    Capacitor filtering for brushed motors ....

    http://www.pololu.com/docs/0J15/9

    ...You might be able to get away without a dedicated ground to the motor case, but the Ground to the H-Bridge driving the motor should be sufficient.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 19:46
    Ok.... after doing some testing and more testing, and then some more testing..... I have found that even 4 each 0.1uF ceramic caps as close to one of the motors across the leads did not help much at all.... I did however put 1 single 0.1uF ceramic cap across the motor leads at the junction inside the box with all the electrical stuff and it seemed to help dramatically. I have run out of 0.1uF caps so I guess I need to order several hundred :P

    As for the resetting, I may have fixed that? I used 1ea diode from the positive side of the battery to a 35V 1000uF electrolytic cap then to a random inductor I found inside a computer power supply. It seems to have stopped the prop from resetting so far. I may add another cap since the wires that will be running the circuitry will be quite long.

    Should I add more caps to the junction inside the electrical box across the motor leads instead of at the motor? Maybe the long leads going to the motor is causing noise that the light sensor is picking up?
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 20:23
    Ok, scratch the above post.... I am still getting very random glitches in the parallax serial terminal and the light sensor circuitry is not stable at all :(

    I have ceramic capacitors everywhere recommended, flyback diodes everywhere, and it is still glitching! I even tried to disconnect the light sensor and run one motor for a complete movement range and the circuit still picked up noise.... I am using 1K pull down resistors on that circuit now and nothing seems to help.

    Come to think about this issue and when it started.... It seemed to start happening right after I switched from a transistor based H-bridge to a relay H-Bridge. When I was using the transistor h-bridge, it seemed to work just fine. Any reason why? I am tempted to get a premade motor controller that the prop can hook directly to....

    EDIT * I just tried a transistor H-Bridge and it did the same thing still..... Noise is going to be a HUGE problem for me.

    I have tried the delta capacitor design with no luck.
    I have tried using 2 different batteries : one to run the prop, and one to run just the motor. Noise still transfers some how.
    I have added a "power buffer" to the 12V input to the board the prop is on. This seems to have helped, but not eliminated the serial terminal from crashing. (USB light stops flashing on prop stick) This does not happen when using 2 different batteries with the grounds separate.
    I have tried changing the pull down resistors on the prop's circuit board for the light sensor from 10K to 1K and this made no change.

    Anything else I should try?
  • evanhevanh Posts: 15,921
    edited 2014-09-19 21:12
    ... If I used a diode and a capacitor, I would have to put it before the entire circuit board the prop is on since it is a printed circuit board I have made for another project.

    Have a look at my mock up schematic. It's important to have the zero ohm links to separate low current paths from high current paths. This is the separate power that everyone has mentioned.

    The control cable can be at various points in the circuit, starting from where I've placed the links in my schematic. In this case I've chosen, connector P3, just after the diode+cap. You can see how I've supplied power to the relay coils after the links but before the diode. This allows the relays to draw their power from the battery but not be affected by motor/charging currents all while the Propeller is safely buffered by the 4700uF capacitor.

    PS: There is one concern I have with the relays - I presume you are using relays in this fashion. This cheap method of using changeover relays for switching the motor windings is prone to welding the contacts. And the related arcing causes much RF noise. I'd be a little wary of recommending it long term.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 22:25
    I do want to go with something other than relays but am not sure what to get. Without know every item I need, I worry about buying parts from online since I have to pay shipping and I get impatient waiting 3 or 4 days for something to come in and come to find out, I need something else that I have to order then go through the same process again. When finally done ordering parts, there will be snow on the ground and it would be very hard for me to install this system in the cold..... I like to try and salvage what I already have so I spend very little money if any. If I have a 100% complete parts list, I can go with that, but controlling larger motors is new to me when using the Prop.

    I have gotten out my hand held O-Scope and have tested several inputs and outputs on the prop while one of the motors was running. There is very little noise on the 3.3V and the 5.5V rails, but there is noise on the output of whichever pin is powering the NPN transistor that turns on the relay. Maybe this is what is causing all my problems? Feedback from the transistor on the h-bridge circuit? Both of the transistors are connected by the same ground that connects directly to the motor.
  • SapphireSapphire Posts: 496
    edited 2014-09-19 22:38
    Have you tried using an opto-isolator instead of the NPN? Then you could separate the relay ground from the prop ground, and you'd only be driving the opto-isolator LED from the prop.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-09-19 22:51
    I think I will have to get some of those. Maybe I have something around my house I can tear up to salvage a few? I may just have to order some though.... I don't think radioshack carries any.
  • evanhevanh Posts: 15,921
    edited 2014-09-20 01:05
    I do want to go with something other than relays but am not sure what to get. Without know every item I need, I worry about buying parts from online since I have to pay shipping and I get impatient waiting 3 or 4 days for something to come ...

    Stick with the relays for now. I don't think they are the problem.
    ... but there is noise on the output of whichever pin is powering the NPN transistor that turns on the relay. Maybe this is what is causing all my problems? Feedback from the transistor on the h-bridge circuit? Both of the transistors are connected by the same ground that connects directly to the motor.

    It's very important that the relay coils are commoned to the Propeller, not the motors. You must not allow the motor currents to flow through the Propeller. Have a good hard look at my previous schematic. The relay coils are separated from the relay contacts, and therefore so is the driving transistors.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-09-20 01:08
    Solving noise problems, especially with brush motors is an art and takes years of understanding and experience with analog circuit design. i.e. Don't go grab a random inductor and throw it in the mix as this could cause more problems depending on the value of the inductor.

    Do you have a schematic that corresponds 1 to 1 with your current setup that you care to share?


    EDIT:
    evanh, I don't see any back EMF diode protection for the motors in your schematic.
  • evanhevanh Posts: 15,921
    edited 2014-09-20 01:39
    evanh, I don't see any back EMF diode protection for the motors in your schematic.

    Doh! I'll sort that when I get home.

    EDIT: Done now. :) I've also added the schematic source file I made it with. This is a DipTrace file.
  • cavelambcavelamb Posts: 720
    edited 2014-09-20 02:59
    I think I will have to get some of those. Maybe I have something around my house I can tear up to salvage a few? I may just have to order some though.... I don't think radioshack carries any.

    RadioShack has them but their web site sucks. You have to search by part number to find them.

    Sparkfun has populated breakout boards for le$$.
    This one is a two-channel part that has transistors on the outputs to invert the output polarity to match the input polarity.
    https://www.sparkfun.com/products/9118
    I thought Parallax used to have stuff like that, but couldn't find it if its still there.

    But the suppression diodes... Beau caught that one.
    Gotta get that counter-EMF kickback under control.
Sign In or Register to comment.