Author Topic: Closed loop control of DC motor  (Read 690 times)

Offline kamelryttarn

  • High Voltage Technician
  • ***
  • Posts: 120
  • Karma: +0/-0
    • View Profile
Closed loop control of DC motor
« on: February 28, 2018, 09:41:26 AM »
A while ago I started a build of a simple (or so I thought) magnetic stir plate. I ordered a cheap motor on ebay and a friend helped me to 3d-print a holder for the neodymium magnets. I use and arduino with a mosfet to get speed control by PWM.

The problem was that the magnets locked on to the screws I used to mount the motor in the plastic case so it took quite a bit of force to get it to start so I thought I could use a closed loop to control the speed of the motor. I bought a new motor with a built in magnetic encoder that sends pulses when the motor spins. I wrote a small program for my arduino and connected the pulse output from the motor to one of the hardware interrupt pins. When I tried it I got very erratic behavior that I believe may be caused by the inertia of the rotating axel . Would you agree and do you have any good ideas what I can do to remedy the problem?

To understand the pictures better I will try to explain the code I used. Every time I got a change (either rising or falling edge) from the encoder, the mosfet channel is turned off and the arduino resumes the regular loop that has a pause time (to regulate speed) and the turns the mosfet on again. In the pictures channel 0 is the encoder on the motor and channel 1 is the mosfet driver. The last screenshot is from a test I did where i let the motor spin for a few seconds and the turned the mosfet off to see how long after the power was cut to the motor it still turned.

High Voltage Forum

Closed loop control of DC motor
« on: February 28, 2018, 09:41:26 AM »

 


* Recent Topics and Posts

post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
Today at 07:22:17 AM
post Re: 833C versus 833A vacuum tube
[Vacuum Tube Tesla Coils (VTTC)]
MRMILSTAR
Today at 06:15:28 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
Today at 05:27:56 AM
post Re: Is this flyback OK for my Plasma ball ?
[Transformer (Ferrite Core)]
davekni
Today at 05:15:44 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
Today at 03:27:07 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
February 26, 2020, 04:01:18 PM
post Re: Is this flyback OK for my Plasma ball ?
[Transformer (Ferrite Core)]
warmania
February 26, 2020, 10:06:48 AM
post Re: Is this flyback OK for my Plasma ball ?
[Transformer (Ferrite Core)]
warmania
February 26, 2020, 10:05:43 AM
post Re: Unusually long-lived electrolytic capacitor
[Electronic Circuits]
ritaismyconscience
February 26, 2020, 06:08:05 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 26, 2020, 05:55:55 AM
post Re: Unusually long-lived electrolytic capacitor
[Electronic Circuits]
T3sl4co1l
February 26, 2020, 05:51:48 AM
post Unusually long-lived electrolytic capacitor
[Electronic Circuits]
MRMILSTAR
February 26, 2020, 05:43:34 AM
post Re: Tesla coil Toroid Aluminium tape benefit
[Spark Gap Tesla Coils (SGTC)]
Jun
February 25, 2020, 01:26:37 PM
post Re: Tesla coil Toroid Aluminium tape benefit
[Spark Gap Tesla Coils (SGTC)]
dj.cosmo.esq
February 25, 2020, 01:05:01 PM
post Re: Tesla coil Toroid Aluminium tape benefit
[Spark Gap Tesla Coils (SGTC)]
Jun
February 25, 2020, 12:35:06 PM
post Re: FPS4000
[High Speed Filming]
Mads Barnkob
February 25, 2020, 11:29:58 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
February 25, 2020, 08:28:28 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 25, 2020, 06:27:40 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
February 25, 2020, 06:20:04 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 25, 2020, 04:23:50 AM
post Re: Tesla coil Toroid Aluminium tape benefit
[Spark Gap Tesla Coils (SGTC)]
Mads Barnkob
February 24, 2020, 02:53:13 PM
post Tesla coil Toroid Aluminium tape benefit
[Spark Gap Tesla Coils (SGTC)]
Jun
February 24, 2020, 02:38:29 PM
post Re: NST
[Spark Gap Tesla Coils (SGTC)]
Jun
February 24, 2020, 02:30:28 PM
post FPS4000
[High Speed Filming]
Hoser415
February 24, 2020, 02:21:50 PM
post Re: HP T620 thin to plus conversion....
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Mads Barnkob
February 24, 2020, 09:09:33 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 24, 2020, 07:08:30 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
February 24, 2020, 04:37:33 AM
post Re: DIY 250W LED Flood Light for High Speed Filming
[Light, Lasers and Optics]
Mads Barnkob
February 23, 2020, 09:04:34 PM
post HP T620 thin to plus conversion....
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
spacecabbie
February 23, 2020, 02:03:15 PM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 23, 2020, 05:43:17 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
klugesmith
February 23, 2020, 04:07:51 AM
post Finding accelerometer location inside a phone
[Smart Phones]
haversin
February 22, 2020, 07:23:28 PM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
dj.cosmo.esq
February 22, 2020, 07:41:18 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 22, 2020, 06:49:22 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
February 22, 2020, 03:39:10 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
Quentief
February 22, 2020, 02:32:55 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
klugesmith
February 22, 2020, 02:10:34 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
Quentief
February 22, 2020, 01:27:41 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Hydron
February 21, 2020, 08:00:10 PM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
February 21, 2020, 02:44:44 PM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
klugesmith
February 21, 2020, 07:21:13 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 21, 2020, 06:11:32 AM
post Re: GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
February 21, 2020, 04:42:34 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
davekni
February 21, 2020, 04:37:53 AM
post Re: UV-cured cyanoacrylate glues?
[Light, Lasers and Optics]
Twospoons
February 21, 2020, 04:28:33 AM
post Re: UV-cured cyanoacrylate glues?
[Light, Lasers and Optics]
klugesmith
February 21, 2020, 04:21:31 AM
post GDT keeps on killing IGBTs
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ritaismyconscience
February 21, 2020, 02:41:03 AM
post Re: 230 volts spark gap
[Spark Gap Tesla Coils (SGTC)]
Quentief
February 21, 2020, 12:28:20 AM
post Re: UV-cured cyanoacrylate glues?
[Light, Lasers and Optics]
Twospoons
February 20, 2020, 09:45:21 PM
post Re: UV-cured cyanoacrylate glues?
[Light, Lasers and Optics]
klugesmith
February 20, 2020, 07:28:01 PM

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
SimplePortal 2.3.6 © 2008-2014, SimplePortal