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

Offline kamelryttarn

  • High Voltage Technician
  • ***
  • Posts: 104
  • 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: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
Today at 07:27:46 PM
post Re: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
Today at 06:56:20 PM
post Re: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
Today at 05:08:06 PM
post Re: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
Today at 01:35:58 PM
post Re: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
Today at 05:54:23 AM
post Re: Blast from the past!
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
klugesmith
Today at 05:05:55 AM
post Re: UD2.7 Gate Signals
[Dual Resonant Solid State Tesla coils]
coilinator
September 17, 2019, 08:24:59 PM
post Re: Blast from the past!
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
MRMILSTAR
September 17, 2019, 08:19:45 PM
post Re: Blast from the past!
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Mads Barnkob
September 17, 2019, 06:53:52 PM
post Blast from the past!
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
MRMILSTAR
September 17, 2019, 05:52:00 PM
post Re: CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
September 17, 2019, 05:00:47 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
davekni
September 17, 2019, 06:48:38 AM
post Re: My second DRSSTC
[Dual Resonant Solid State Tesla coils]
erdal
September 16, 2019, 11:07:27 PM
post Re: 750W solar offgrid 24V/150Ah battery setup with Victron charger
[Electronic circuits]
johnf
September 16, 2019, 09:48:37 PM
post Re: adventures in homemade flyback bobbins.
[Transformer (ferrite core)]
AlexanderHun
September 16, 2019, 10:42:44 AM
post Re: Offgrid 48V solar to 24V battery setup
[Electronic circuits]
Mads Barnkob
September 16, 2019, 09:40:27 AM
post Re: My second DRSSTC
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
September 16, 2019, 09:28:43 AM
post Re: Large Ferrite Core with IGBT-Brick Driver
[Transformer (ferrite core)]
Mads Barnkob
September 16, 2019, 09:24:17 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
T3sl4co1l
September 16, 2019, 06:59:12 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
davekni
September 16, 2019, 04:18:26 AM
post Re: My second DRSSTC
[Dual Resonant Solid State Tesla coils]
davekni
September 16, 2019, 02:49:28 AM
post Re: Large Ferrite Core with IGBT-Brick Driver
[Transformer (ferrite core)]
davekni
September 16, 2019, 02:43:18 AM
post Re: Homemade HV transformer
[Transformer (ferrite core)]
davekni
September 16, 2019, 02:36:17 AM
post Re: adventures in homemade flyback bobbins.
[Transformer (ferrite core)]
davekni
September 16, 2019, 02:26:40 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
petespaco
September 16, 2019, 01:50:19 AM
post Re: UD2.7 Gate Signals
[Dual Resonant Solid State Tesla coils]
coilinator
September 15, 2019, 08:22:47 PM
post Re: My second DRSSTC
[Dual Resonant Solid State Tesla coils]
erdal
September 15, 2019, 02:09:17 PM
post Re: Homemade HV transformer
[Transformer (ferrite core)]
AlexanderHun
September 15, 2019, 10:39:29 AM
post Re: Homemade HV transformer
[Transformer (ferrite core)]
ElectroXa
September 14, 2019, 07:01:28 PM
post Re: adventures in homemade flyback bobbins.
[Transformer (ferrite core)]
AlexanderHun
September 14, 2019, 06:59:13 PM
post Re: Homemade HV transformer
[Transformer (ferrite core)]
AlexanderHun
September 14, 2019, 06:43:15 PM
post Re: Homemade HV transformer
[Transformer (ferrite core)]
ritaismyconscience
September 14, 2019, 06:35:32 PM
post Homemade HV transformer
[Transformer (ferrite core)]
AlexanderHun
September 14, 2019, 05:05:00 PM
post Re: UD2.7 Gate Signals
[Dual Resonant Solid State Tesla coils]
profdc9
September 14, 2019, 04:50:10 PM
post Re: UD2.7 Gate Signals
[Dual Resonant Solid State Tesla coils]
coilinator
September 14, 2019, 08:42:55 AM
post Re: Transistors good for DRSSTC?
[Dual Resonant Solid State Tesla coils]
ritaismyconscience
September 13, 2019, 05:50:53 AM
post Re: Transistors good for DRSSTC?
[Dual Resonant Solid State Tesla coils]
Max
September 12, 2019, 12:47:03 PM
post Re: Transistors good for DRSSTC?
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
September 12, 2019, 11:07:39 AM
post Re: "karma", "applause/smite" button meaning and use
[General chatting]
Mads Barnkob
September 12, 2019, 11:01:05 AM
post Re: Transistors good for DRSSTC?
[Dual Resonant Solid State Tesla coils]
Hydron
September 12, 2019, 08:44:48 AM
post Transistors good for DRSSTC?
[Dual Resonant Solid State Tesla coils]
ritaismyconscience
September 12, 2019, 05:53:51 AM
post Re: "karma", "applause/smite" button meaning and use
[General chatting]
oneKone
September 12, 2019, 05:37:11 AM
post "karma", "applause/smite" button meaning and use
[General chatting]
MRMILSTAR
September 12, 2019, 05:07:24 AM
post Re: Why did 4HV die??
[General chatting]
oneKone
September 12, 2019, 04:50:24 AM
post Drsstc 4, I'm never stopping
[Dual Resonant Solid State Tesla coils]
oneKone
September 12, 2019, 02:36:00 AM
post Re: Why did 4HV die??
[General chatting]
Hydron
September 12, 2019, 12:34:10 AM
post Re: Why did 4HV die??
[General chatting]
MRMILSTAR
September 11, 2019, 09:29:40 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
MRMILSTAR
September 11, 2019, 09:00:31 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
coilinator
September 11, 2019, 07:54:30 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
freq_out
September 11, 2019, 05:40:14 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