M0 Feather reset when running DC motor with Motor FeatherWin

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by adafruit_support_bill »

I think we've touched on all the usual suspects and remedies. When none of those work, then an oscilloscope can be very helpful in understanding the nature of the underlying problem.
But sometimes the M0 feather reset after 2 seconds after one motor is switched on..
That is a little unusual. Starting and stopping are typically when these motors put out the most noise.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

ok thanks a lot! will try that then.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

Hi!
I am planning to try using a twisted pair shielded cables for the 3 DC motors to avoid emitting too much emi around. Maybe this would solve my issue.

To do so I am thinking about using an ethernet ftp cable.
As it has 4 twisted pair in it with one shield covering them all, I was thinking to use 3 of those twisted pairs for the 3 DC motor power cable from the Motor Feather wing.

My first question is: would this help to reduce emitting emi around those cables?

Second question is: can I connect the shield of the cable to any of the 3 DC motor power output cable connections terminal blocks of the Feather wing? Or does it need to be connected to ground?

Thank you!

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by adafruit_support_bill »

For the motor wires, the shielding is going to help more then the twisted pairs. Connect the shield to ground on just the Feather Wing end of the wires.

User avatar
abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by abear7 »

You might try putting a .1uf ceramic capacitor on the reset pin to ground. My feather was randomly resetting when I was pressing the buttons near the reset pin so I suspected the internal pull-up resistor was high and thus susceptible to being trigger by body capacitance or resistance. After putting a .1uf it has never reset again.

Also after finding this in the data sheet you might need a cap on this pin also.

Power-On Reset on VDDANA
POR monitors VDDANA. It is always activated and monitors voltage at startup and also during all the sleep modes. If VDDANA goes below the threshold voltage, the entire chip is reset.


Good luck.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

Hi abear7,

Thank you very much for your message, it works great now!!!

It didn't crash once since I added the capacitor between reset and ground pin.
I have been looking into this for long time now, big thanks!!

I will do more tests and see but so far, great and never been that good.

I am new to electronics and not sure I understand the reason why it works though.
I guess the reset pin is connected to 3.3V and as the 3.3V is fluctuating too much when I run the motors, the 3.3v goes below a threashold on the reset pin which restart the controller. Is that right? So the 0.1uF capacitor help stabilising the 3.3V supply to the reset pin?

Thank you!

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by adafruit_support_bill »

Thanks for the tip abear7. Good to know about the sensitivity of the reset pin on these.
And thanks IoTall for the follow-up. Good to hear that everything is working well.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

To Bill: now that we know this is the issue, is this 0.1uF capacitor added between the Reset and Ground pin the most optimal and robust solution?

Thanks!

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by adafruit_support_bill »

Interference problems generally defy one-size-fits-all type solutions. This one seems like a good one to add to the bag-of-tricks for the Feather.

Eliminating noise at the source is the 'ideal' solution, but seldom 100% achievable. Because DC motors are such 'bad actors' in general, I usually start by attempting to suppress as much as possible at the motor. If that fails, then I start looking at ways to keep it from disrupting other sensitive components in the system. In this case, it looks like the reset pin is a key vulnerable point on the feather, so a bypass cap there will help protect it.

User avatar
abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by abear7 »

I'm glad that solved the problem. When having random reset issues this should be the first thing to investigate. Driving motor, relays, especially anything inductive will cause voltage spikes and depending on the layout of the signals on the PCB and input impedance of the reset input pin these spikes can trigger the reset logic in the MCU. I found this on the 128x32 OLED feather since the C button is near the reset pin and I noticed it sometimes reset when I was pressing the button. I actually put the capacitor from reset to the adjacent VCC pin since that was easier and that works too. I would prefer it to ground though. If you experience it again you might put a slightly larger cap maybe .47 or so. Don't use an electrolytic cap, ceramic is best for this application. When driving large loads suddenly can also cause a similar problem if the voltage regulator is not size sufficiently for the load. Using an oscilloscope is very useful diagnosing this type of problem.

Good luck on your project.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

Super, thank you for the help! I can continue to the next step now :)

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

Hi,
Trying to understand what is the best practice and looking for examples online, I found this one from another forum. (https://electronics.stackexchange.com/q ... -reset-pin).

This is for another controller and here is how the reset pin is setup:
JqK7V.png
JqK7V.png (18.94 KiB) Viewed 520 times
Is tha that the best possible way for the M0 controller too?
In that case is there a best combination of capacitor and resistor values?

Thanks again!

User avatar
abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by abear7 »

The SAM D21 MCU has an internal pull up between 20-60K already. That circuit is very typical but I prefer the larger .1uf capacitor.

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

Thanks a lot for the answer.

I read few forum discussions and apparently an external 10k resistance from reset to 3.3v + having the 0.1uF capacitor from reset pin to ground as you proposed is a classic way to make this reset pin part robust in noisy conditions. This is what I did.
Apparently there are some discussions if this cap should be put to 3.3v instead of ground but I didn't find somewhere an explanation of which way is really the best.

Anyway, it is working perfect for me now. Thanks a lot again!

User avatar
IoTAll
 
Posts: 231
Joined: Wed May 31, 2017 6:34 pm

Re: M0 Feather reset when running DC motor with Motor Feathe

Post by IoTAll »

I come back to this topic as I think I have a similar issue with DC motors on another project, but in the opposite case and on a GPIO pin this time.

On the previous project, the reset pin needed to be kept high and to avoid unexpected reset because of noises from the motors, we added a capacitor to ground and a resistance to VCC.

In my new project, I need to keep a GPIO pin LOW instead during normal operation, and raise it to high at a specific time.
When I activate the DC motor, I think there is noise on this GPIO pin which makes it not keep the 0v and fluctuate a little and very rapidly.
Is there a typical way to avoid thoses noises to keep the GPIO low?
I of course in the code already declared this pin as output and turned low but this is not enough.

I am using the M0 feather.

Thanks a lot!!

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”