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

Offline kamelryttarn

  • High Voltage Technician
  • ***
  • Posts: 100
  • 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 CM300 coil build questions
[Dual Resonant Solid State Tesla coils]
acobaugh
Today at 05:32:28 AM
post Re: Welcome new members, come say hello and tell a little about yourself :
[General chatting]
ElectroXa
July 20, 2019, 09:45:42 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
Bert911
July 19, 2019, 11:19:45 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
hightemp1
July 19, 2019, 03:36:44 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
DICKEYBIRD
July 19, 2019, 03:24:38 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
hightemp1
July 19, 2019, 02:23:29 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
DICKEYBIRD
July 19, 2019, 01:06:44 AM
post Re: Floppiclene! A Electronics Cleaning Relic of the Past.
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Justin
July 18, 2019, 10:29:32 PM
post Re: Floppiclene! A Electronics Cleaning Relic of the Past.
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Mads Barnkob
July 18, 2019, 08:52:35 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
hightemp1
July 18, 2019, 05:49:27 AM
post A new quick way to get into tune a DRSSTC
[Dual Resonant Solid State Tesla coils]
VNTC
July 18, 2019, 03:13:27 AM
post Re: Floppiclene! A Electronics Cleaning Relic of the Past.
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Twospoons
July 18, 2019, 12:06:53 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
hightemp1
July 17, 2019, 07:56:41 PM
post Floppiclene! A Electronics Cleaning Relic of the Past.
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Mads Barnkob
July 17, 2019, 11:25:22 AM
post Re: Next Gen DRSSTC
[Dual Resonant Solid State Tesla coils]
Netzpfuscher
July 16, 2019, 07:39:33 AM
post Re: What is the true in tuning guide?
[Dual Resonant Solid State Tesla coils]
VNTC
July 16, 2019, 05:11:21 AM
post Re: Next Gen DRSSTC
[Dual Resonant Solid State Tesla coils]
profdc9
July 16, 2019, 04:05:07 AM
post Re: DRSSTC in brust mode
[Dual Resonant Solid State Tesla coils]
SAMGO
July 16, 2019, 02:25:27 AM
post Re: Next Gen DRSSTC
[Dual Resonant Solid State Tesla coils]
Hydron
July 16, 2019, 01:54:30 AM
post Re: Next Gen DRSSTC
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 15, 2019, 02:51:26 PM
post Re: What is the true in tuning guide?
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 15, 2019, 02:48:02 PM
post Re: A problem solved with hand tools
[General chatting]
Mads Barnkob
July 15, 2019, 01:48:08 PM
post Re: Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 15, 2019, 01:45:00 PM
post Re: A problem solved with hand tools
[General chatting]
Hydron
July 15, 2019, 11:21:29 AM
post What is the true in tuning guide?
[Dual Resonant Solid State Tesla coils]
VNTC
July 15, 2019, 10:01:21 AM
post A problem solved with hand tools
[General chatting]
klugesmith
July 15, 2019, 07:52:41 AM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
klugesmith
July 15, 2019, 07:33:30 AM
post Re: tesla coil varnish is dumb
[Solid state Tesla coils]
Hydron
July 14, 2019, 10:49:03 PM
post Re: tesla coil varnish is dumb
[Solid state Tesla coils]
T3sl4co1l
July 14, 2019, 09:59:40 PM
post Re: tesla coil varnish is dumb
[Solid state Tesla coils]
Mads Barnkob
July 14, 2019, 08:20:52 PM
post Re: Next Gen DRSSTC
[Dual Resonant Solid State Tesla coils]
Netzpfuscher
July 14, 2019, 06:06:30 PM
post tesla coil varnish is dumb
[Solid state Tesla coils]
Fumeaux
July 14, 2019, 05:29:10 PM
post Led Closeups with Mobile phone and lens .
[Smart phones]
DashApple
July 14, 2019, 03:00:09 PM
post Re: Drsstc 3
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 14, 2019, 02:06:26 PM
post Re: DRSSTC in brust mode
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 14, 2019, 02:04:22 PM
post Re: Twin System Build
[Dual Resonant Solid State Tesla coils]
oneKone
July 14, 2019, 01:27:18 AM
post Re: DRSSTC in brust mode
[Dual Resonant Solid State Tesla coils]
johnf
July 14, 2019, 01:22:15 AM
post Re: Drsstc 3
[Dual Resonant Solid State Tesla coils]
oneKone
July 13, 2019, 03:48:54 PM
post DRSSTC in brust mode
[Dual Resonant Solid State Tesla coils]
SAMGO
July 13, 2019, 04:17:55 AM
post Re: Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
donnersm
July 12, 2019, 08:54:54 PM
post Re: Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
profdc9
July 12, 2019, 07:16:40 PM
post Re: Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
profdc9
July 12, 2019, 06:33:00 PM
post Smooth corona or heavy spark, RF wave radiation frequency of Tesla coil drops ve
[Dual Resonant Solid State Tesla coils]
VNTC
July 12, 2019, 11:09:28 AM
post Re: Drsstc 3
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 12, 2019, 09:56:38 AM
post Re: Drsstc 3
[Dual Resonant Solid State Tesla coils]
oneKone
July 12, 2019, 01:23:58 AM
post Re: Completed my pulsed power generator
[Capacitor banks]
MRMILSTAR
July 11, 2019, 05:48:27 PM
post Re: Completed my pulsed power generator
[Capacitor banks]
Mads Barnkob
July 11, 2019, 02:58:13 PM
post Re: Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
July 11, 2019, 02:45:24 PM
post Kaizer half bridge driver
[Dual Resonant Solid State Tesla coils]
donnersm
July 11, 2019, 06:59:01 AM
post Completed my pulsed power generator
[Capacitor banks]
MRMILSTAR
July 11, 2019, 05:43:31 AM

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