Shop OBEX P1 Docs P2 Docs Learn Events
Supressing Current Spike — Parallax Forums

Supressing Current Spike

LightfootLightfoot Posts: 228
edited 2007-04-07 02:01 in General Discussion
When I first put my noisy model train motor on the track I find it creates a pattern of noise that causes my logic circuits to crash (see my post noise). What can I do to slowly ease that motor on? The circuit initially has no load, whenever a load is placed on it, I want to prevent it from suddenly powering up.

Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-06 21:11
    "Slowly easing the motor on" is not likely to fix your problem. Model trains have other noise issues like the intermittant connection to the rails. You need to have a stable, noise-free power supply for your logic circuits. How are you powering your logic? What do you have and how is it connected? There may also be noise working back into your circuitry from the outputs (whatever they are). You may need some isolation for the inputs and outputs as well. Other people use Stamps and Propellers to control huge relays switching 3-phase power in industrial environments without problems. Their controllers have to be very carefully designed to avoid these kinds of noise problems. It can be done.
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 21:14
    The logic is powered by the USB bus. I have schmitt trigger optoisolators between the power supply and logic completely seperating everything and still it somehow manages to affect it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-06 21:42
    Again, you will have to post at least a partial schematic and some portions of your code for anyone else to give you more than general suggestions. You may have noise coming in on your USB bus. You may have problems in your program when there are noisy inputs. Who knows? You're not providing enough information.
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 22:26
    My schematics and programs are attached.· Note SX20 pin chips are used in the schematic because that is what I will use in the final design.· I am using SX28s for prototyping because they are through-hole.· There is also a 4mhz resonator for U2.· The UM232R is a usb to ttl converter module.· The resonator and UM232R (there are pointers that correspond to the appropiate pins on it) are not listed because I do not know their symbols.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    954 x 573 - 173K
    882 x 534 - 156K
  • T ChapT Chap Posts: 4,198
    edited 2007-04-06 22:37
    Are you ramping the PWM up when starting the motor?
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 22:42
    The only time noise is a problem is when the track is live and I place the·locomotive on the track.· Even if I do this I have to "like wiggle it around in a certain way" to get the logic to crash.· Normally I would not do this but certain conditions on my·train layout may cause·the same problem·so I·do not want it·crashing under any circumstances.· I think its the UM232 and/or U2·that is crashing because U3, the PWM generator, still generates pulses after the crash.· RB on U2 still holds its state along with RA.1.· The only thing that does not·work is the SERIN·part.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Lightfoot) : 4/6/2007 10:54:38 PM GMT
  • T ChapT Chap Posts: 4,198
    edited 2007-04-06 22:46
    Starting at 0 duty and gradually chanmging duty to the desired speed. In a loop it would resemble:

    RampUpLoop
      'set duty to 0 here
       duty = duty plus 1
       
    
    



    I am not sure on SX code, but you ge the idea, you start the duty at 0 and ramp it up so the motor des not get full power at the start. Think of it as turning a dial, only you are increasing the duty.
  • T ChapT Chap Posts: 4,198
    edited 2007-04-06 22:48
    Sorry I guess it wasn't clear where the problem was, can you not just start the motor power after the train is on the track?
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 22:50
    just edited my last post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-06 22:52
    I suspect you're coupling noise somehow from your track or control circuitry into your USB driven power supply. It looks like there's some filtering on the UM232R, but it's only about 15uF. You might need more. I'd suggest adding a 100uF 6V or 10V electrolytic capacitor across your Vdd supply and perhaps another one or two 0.1uF ceramic capacitors mounted at the SX processors (within an inch or two max.) Make sure none of the logic is physically too close to the track or its wiring and that the USB cable doesn't parallel anything carrying power. I'm assuming that your power ground and logic ground are separate.

    I'm not an SX programmer, but your programs look pretty trivial.
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 22:54
    they are seperate

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-06 22:58
    You may also need much better filtering in your motor power supply. Try adding 470uF or 1000uF on the output of the regulator..
  • LightfootLightfoot Posts: 228
    edited 2007-04-06 23:34
    Added:

    .1uf caps across power pins
    470uf cap across voltage regulator output
    100uf cap across +5v and GND for logic power supply.

    No cigar

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • T ChapT Chap Posts: 4,198
    edited 2007-04-07 00:49
    Lightfoot

    To understand this better, you have a live track that you want to place the locomotive on and have the locomotive immediately start moving? The locomotive has the typical slides on the bottom that move over the surface of the track?

    If that is the case, could you try a few tests and post the results. First, since the track is live, could you place a 220R and and LED across the track somehow so that you have LED status at all times showing power. Second, place an LED and resistor on both SX's on a spare pin, set the code to go high(LED on) on boot. Put an LED on the power rails for both supplies. Once you have visual indicators in the places described, try to get it to crash again and note any LED status changes.

    Lastly, try sheilded cable on all inputs to the SX's, and even try some grounded aluminum foil or sheilded enclosure around all the logic and SX's.
  • LightfootLightfoot Posts: 228
    edited 2007-04-07 00:56
    No, it is not european HO scale. One rail is + and the other is -. The power is picked up by the wheels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • T ChapT Chap Posts: 4,198
    edited 2007-04-07 01:07
    Well the same test should apply and might provide some info.

    Post Edited (TChapman) : 4/7/2007 2:06:38 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2007-04-07 02:01
    This regulator design is ideal for what you are experiencing...

    http://forums.parallax.com/forums/default.aspx?m=176778&f=25&p=1#m177647

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.