Electronics > Projects, Designs, and Technical Stuff
DC motor causing false interupts on MCU
(1/2) > >>
joej970:
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.
Psi:
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?)
joej970:
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
janoc:
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?
Zero999:
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.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod