Author Topic: DC motor causing false interupts on MCU  (Read 726 times)

0 Members and 1 Guest are viewing this topic.

Offline joej970Topic starter

  • Newbie
  • Posts: 3
  • Country: si
DC motor causing false interupts on MCU
« on: March 21, 2020, 09:48:06 am »
Hello, I am a third year student of electrical engineering and I am working on a project and have not moved on for several days and I urgently need some help.

In my project I control DC motor's speed using 1 kHz PWM from STM32 BluePill through MikroE's DC motor driver 3 CLICK:
DC motor: Minimotor BC2000 12-24MP, 24V, 2.5A, brushed, no capacitors built in.
DC motor driver: https://www.mikroe.com/dc-motor-3-click .

I use one pin on MCU as interupt to switch on/off the motor. I have debounce filter using 10u capacitor and I am sure the swith itself does not cause false interupts. The switch is connected by 15 cm wires to the MCU and other electronics.  I use separate 24v power supplies: the first for DC motor and second, in combination with 24/3.3 dcdc converter, for electronics - including MCU. I have 22uF cap between 24V/GND and 10uF cap between 3.3V/GND. The circuit is made on home etched PCB with poured ground plane. I have motor's housing connected to EARTH potential.

Problem is that DC motor is causing false interupts on switch interupt pin.
What I already did: I tried to control the DC motor through DC motor driver with another secondary MCU to determine if EM interferences through air or through wire is causing the issue. I noticed that problem persisted even with no electrical connection between primary MCU and DC motor driver, so EM interferences occured over the air. Then I installed 0.1uF ceramic capacitor between DC motor's + and - wire. Now, there are no interferences over the air.
But, when controling the DC motor with primary MCU again, false interupts occur again. So interferences must also be transfered through the wire as well. I noticed that even if I control the DC motor with secondary MCU and connect only ground of secondary MCU to primary MCU, interferences (consequently false interupts) occur.

An asistant from my faculty suggested to use LC filter on motor + and - wires as those wires act as an antenna. I doubt this will solve the issue of false interupts as over the air EM interferences are not a problem anymore. I have not seen any other DC motor's to have such complex circuits so I doubt I need it, especially as the motor is only 37W. Do you think I could use USB cable that has a ferite cylinder attached on it? Are there any other suggestions from you?

Thank you for any thought, comment, help.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10229
  • Country: nz
Re: DC motor causing false interupts on MCU
« Reply #1 on: March 21, 2020, 09:57:57 am »
Can you post a schematic.  im not too sure how you have everything connected.

What kind of switch is this? can you post a link to the switch? (is the switch the optical encode option with that motor?)
« Last Edit: March 21, 2020, 10:08:39 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline joej970Topic starter

  • Newbie
  • Posts: 3
  • Country: si
Re: DC motor causing false interupts on MCU
« Reply #2 on: March 21, 2020, 10:09:12 am »
It is used as input. Switch is used to indicate to MCU whether to output PWM or not.
And there is separete potentiometer to control PWM duty cycle. I also use stepper motor with 2 inputs LIN_LEFT & LIN_RIGHT so stepper changes direction of rotation. But stepper is not causing any problems: no false interupts until motor is attached to click 3 driver.

It's basic rocker switch:https://www.digikey.co.uk/product-detail/en/te-connectivity-alcoswitch-switches/PRASA1-16F-BB000/450-1040-ND/525715
« Last Edit: March 21, 2020, 10:13:20 am by joej970 »
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3881
  • Country: de
Re: DC motor causing false interupts on MCU
« Reply #3 on: March 21, 2020, 10:13:28 am »
The LC filter on the motor wires is not to prevent the radiated EMI (through the air) but to block the conducted one (over the wires). Possibly even a piece of  ferite could fix the problem.

I wonder where the DC motor is in your schematic - I see only a stepper and an uncontrolled fan there?
« Last Edit: March 21, 2020, 10:17:00 am by janoc »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: DC motor causing false interupts on MCU
« Reply #4 on: March 21, 2020, 10:44:47 am »
Try adding a couple of capacitors connected between the motor's frame and power and inductors/ferrite beads in series, as close to the motor as possible.
 

Offline joej970Topic starter

  • Newbie
  • Posts: 3
  • Country: si
Re: DC motor causing false interupts on MCU
« Reply #5 on: March 21, 2020, 05:05:17 pm »
There is missing schematic of DC motor: https://download.mikroe.com/documents/add-on-boards/click/dc-motor-3/dc-motor-3-click-schematic.pdf which I did not include into my schematic.

However, it seems I have solved the problem with modified USB cable with ferite and two additional capacitors connected  between power wires and the motor frame which I connected to earth.
There was no interferences even with no earth connection, while removing cable with ferite resulted in interferences, even with additional capacitors.

Thank you very much for fast reply. Wish you all well.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf