DC motor causing false interupts on MCU - Page 1
Forum section: electronics / projects

author: joej970
author_rank: Newbie
timestamp: March 21, 2020, 09:48:06 am
content: 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 using1 kHzPWM 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 anothersecondary MCUto 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 areno interferences over the air.But, when controling the DC motor withprimary MCUagain, false interupts occur again. Sointerferences must also be transfered through the wireas 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.

author: Psi
author_rank: Super Contributor
timestamp: March 21, 2020, 09:57:57 am
content: 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?)

author: joej970
author_rank: Newbie
timestamp: March 21, 2020, 10:09:12 am
content: 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

author: janoc
author_rank: Super Contributor
timestamp: March 21, 2020, 10:13:28 am
content: 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?

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2020, 10:44:47 am
content: 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.

author: joej970
author_rank: Newbie
timestamp: March 21, 2020, 05:05:17 pm
content: There is missing schematic of DC motor:https://download.mikroe.com/documents/add-on-boards/click/dc-motor-3/dc-motor-3-click-schematic.pdfwhich 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.