Random problem when 12V motors are running?

Hey all,

I am working on a “drone-boat”, using a FEZ Panda.
The GPS / Data logging part is working well.
The Panda also has to control 2 DC motors (brushed, 12V, 1A, 1000RPM), through a Ardumoto.

When I’m running my app without powering my Ardumoto (and consequently my motors), everything is working great, I can see it in my debugger output & with a LCD display.

But When I’m powering my ardumoto, then my motors start to spin (that’s OK!), but my application freezes after few seconds. The debugger is in a strange state, and I know my program is not exectuing any more because my LCD display stands still. I don’t get any exception.

Looks like a random problem caused by some noise, but I think I did the things in the right way :
12V motor circuit and 5V Panda “+” circuits are separated. Only ground is shared.
12V Lead batteries power the Ardumoto’s VIN pins, and consequently the motors.
The Fez Panda is powered by USB in my testings.

Do you think all this is OK?
Could you tell me what tests/check I should do to understand where do the problem come from?

Noise is propagated in different forms: RFI/EMI. The first line of defense is to keep low voltage logic cables away from high voltage/current cables for motors. You’ll also likely want to add some filter caps to both power supplies and sometimes small DC motors can benefit from bypass caps from each brush to the case.

Can you post a schematic of how you have things hooked up?

Hi Jeff!

Thank you for your reply!
Here is the schematic.

It is very simplified, I did not mention the other components. I think it is not necessary, si I just write here the list : GPS EM 406, HMC compass, airmar sounder (12V powered), a Max232 shield to connect to the sounder, a LCD, 2 buttons to navigate in menu, a SD card socket and a small piezo.

Do you think I made a mistake somewhere?

Note 1 : There are no decoupling capacitors soldered on my motors. I thought it was not necessary because logic and motor power supply are separated. Am i wrong?
Note 2 : Yes, some 12V cables are “not so far” from logic cables… Few centimeters… If you think it is a good suspect, I can post a picture of the whole electronics so you can make a better idea and give your feeling.

I have the same problem with a similar project, I use 3 interruptports and 4 GPIO from the panda to control a two 5V DC Motors using a pololu driver TB6612FNG. Everything works if i don’t connect the motors, but when the motors are connected and running all my interruptports are called multiple times until my panda crashes.

I Think that is a problem from the ground, i use 3 different sources uncluding USB from my pc. Other possible problem is the noise that generates my motors and make my interruptports goes crazy because if i use inputports instead, everything works.

Hello Charlie,
I have investigated more and I reached the same conclusion : My crash is due to interrupt ports. In my case I use interrupt ports for 2 buttons. When I remove my buttons (physcally) => no more crash!
OK, so like you there is something bad happening with InterruptPort.

To understand your case : Why do you use interruptPort? Also, what are the 4 “GPIO” wires?

I don’t understand why you get noise since you have separated the all the powers (+). Yes your ground is shared but it is told everywhere it is a best practice, so I don’t think noise comes from there.
I have to test “decoupling caps” on my motors. If it works I will tell you then.

Have you pulled down your interrupt ports? That might be the cause of your problems…

No, I’m pull-up. Here is my code for the button :
button = new InterruptPort((Cpu.Pin)pin, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
So as you pinpoint it might be wrong. I have made several tests so I can’t remember what was my original code.
I’m note sure what InterruptMode I should put.
I’ll make a try this evening and tell you, but I’m optimistic.

In all honesty I have never used the internal pull ups, I have no clue what values they are etc. If you have a physical resistor laying about I would suggest you try it with that. That way you can be sure :).

Hey, i know it has been a while but i came accross your post and dont see if you have reached a solution,

i have a similar problem, i am trying to run some motors via my fez panda2. I have 2 limit switches connected to the ends of the tracks of the motors and i am using the motor in PWM mode.

I have setup 2 interrupt routines for the limit switches and some debug LED’s so that i know if the routine run or not. The routine is simply meant to change the direction of the motor direction via a single digital i/o. The uart is used to send simple commands to start/stop or change the direction of the motor.

The code runs properly if the motors are not in operation, and the debug LED’s only change state when i manually touch the limit switches. But as soon as i start up the motors via PWM the interrupts are triggering randomly. I know the interrupts are triggering as i can see that from the debug LED’s.

I have probed the i/o pins of the interrupts and those pins are not changing state - so the interrupts are just randomly triggering. i am also using a schmitt trigger circuit before the interrupt pins to ensure that there is no grey are that may trigger an interrupt.

I have attempted to remove the PWM mode and run the h-bridges of a digital i/o line but this did not change anything.

Have you found a solution to your problem?

thanks in advanve

In all honesty, the universal answer to most of these problems is:

Zener Diodes, Varistors, fast response Shottky diodes, ferrite beads and low ESR decoupling capacitors as well as low ESR reservoir caps.

Shove an abdundance of those onto your circuit and you shouldn’t have problems :). I make a habit of putting at least one of each one of those components onto every design I make, for good measure. Saves you the headache of having random EMI causing difficult to diagnose problems.