Author Topic: Motor makes my microcontroller buggy !?  (Read 1097 times)

0 Members and 1 Guest are viewing this topic.

Offline MattJackTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Motor makes my microcontroller buggy !?
« on: May 10, 2011, 12:41:51 AM »
Hi there,

I am working on a "drone-boat", using a "FEZ Panda" microcontroller.
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.

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.

I have put in attachement a simple schematic of what I'm doing (not mentioning GPS, compass, and other stuff)

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?


Offline Billy

  • Full Member
  • ***
  • Posts: 114
  • Helpful? 2
Re: Motor makes my microcontroller buggy !?
« Reply #1 on: May 10, 2011, 11:18:54 AM »
The Fez Panda is powered by USB in my testings.

Try the test with a 9V battery instead of the USB. It could be the USB buss is hanging, which is stopping the uC. In my experience, it's communication that gets disrupted by motors, with hard faults in the processor less likely. YMMV.

Offline MattJackTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Motor makes my microcontroller buggy !?
« Reply #2 on: May 10, 2011, 01:41:20 PM »
Hi Billy,
I tried with 9V Battery and it is same result exactly.

Offline WaterPig Master

  • Full Member
  • ***
  • Posts: 62
  • Helpful? 3
  • Hurdy Gurdy playing at Raglan
Re: Motor makes my microcontroller buggy !?
« Reply #3 on: May 10, 2011, 02:22:37 PM »
Hmmm… I assume the boards you're using have power supply and decoupling caps? On some commercial devices I have seen people solder a 0.1uF or larger ceramic cap between the motor wires, although admittedly it doesn't sound like this problem is being caused by noise.

I have not used the Ardumotor before, but can you test it without the MCU? I.E. jumper wires controlling the motors? That way you can find where the faults are — if it works without the MCU, then there's a problem with the MCU (then use a logic probe/meter to check what's happening on the control lines?). If it doesn't work, then there's a problem with the motors or motor board.

Hope that helps,
Barnaby

Offline MattJackTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Motor makes my microcontroller buggy !?
« Reply #4 on: May 10, 2011, 03:15:38 PM »
>I assume the boards you're using have power supply and decoupling caps?

Heuuu... No decoupling caps on my motors. I have readit was a good partice to add three 0.1uF between the motor wires as you write, but I thought it was no necessary since I have separated logic circuit from 12V motor circuit.
Maybe I should start to add these caps, what do you think?

>I have not used the Ardumotor before, but can you test it without the MCU? I.E. jumper wires controlling the motors?
I'm not sure I understand. What are the jumper wires you are talking about?
I don't know how to test the motor driver without the MCU, in fact. To control the motors, a PWM signal has to be sent to Ardumoto so I need the MCU do do this.


Offline vinniewryan

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Motor makes my microcontroller buggy !?
« Reply #5 on: May 10, 2011, 04:20:45 PM »
Test your power lines with a scope, if you see noise on the lines add some .1uf caps close to the V+ and V- of the MCU. If you don't have a scope, download a free soundcard scope. Also make sure you have any necessary resistors in place from your MCU's outputs to the logic inputs of the motor controller.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Motor makes my microcontroller buggy !?
« Reply #6 on: May 10, 2011, 10:18:38 PM »
Hi,

Sure sounds like you have a noise problem.
Add caps (the cap between the terminals should be 5 to 10 times as large as the other two).
Twist the motor leads (and the battery leads) and make a separate (heavy wire) route from the battery to the motor controller to the motor. The logic should have its own supply line directly from the battery as well.
"Separate" means that they should only connect at the battery poles.
As it is, you induce the motor noise on the supply lines to your logic.

That should cure it, but if any issues persist, loop the motor wires through a toroid core (preferably a sintered iron dust core - in case you break apart a discarded PC supply or similar to get a toroid, go for a yellow one if you can find one) or use one of the click-on ferrites.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list