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

Offline kamelryttarn

  • High Voltage Experimenter
  • **
  • Posts: 92
  • 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: WTS [EU]: UD2.7 thru hole pcb
[Sell / Buy / Trade]
FilipŠebík
Today at 08:39:46 AM
post Re: UD 2.7C Build
[Dual Resonant Solid State Tesla coils]
Thunderstruck
Today at 08:35:33 AM
post Re: Chinese MOSFETS/IGBTS
[Solid state Tesla coils]
flyrod
Today at 04:07:24 AM
post Re: Chinese MOSFETS/IGBTS
[Solid state Tesla coils]
Thunderstruck
March 23, 2019, 10:07:54 PM
post Re: WTS [EU]: UD2.7 thru hole pcb
[Sell / Buy / Trade]
Mads Barnkob
March 23, 2019, 04:07:55 PM
post WTS [EU]: UD2.7 thru hole pcb
[Sell / Buy / Trade]
Fumeaux
March 23, 2019, 02:12:48 PM
post Re: UD 2.7C Build
[Dual Resonant Solid State Tesla coils]
Thunderstruck
March 23, 2019, 08:03:58 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
petespaco
March 23, 2019, 01:50:47 AM
post Re: Chinese MOSFETS/IGBTS
[Solid state Tesla coils]
Hydron
March 23, 2019, 12:11:10 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
badpeter
March 22, 2019, 08:19:21 PM
post Re: Chinese MOSFETS/IGBTS
[Solid state Tesla coils]
profdc9
March 22, 2019, 06:39:37 PM
post Chinese MOSFETS/IGBTS
[Solid state Tesla coils]
Fumeaux
March 22, 2019, 05:51:55 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
petespaco
March 22, 2019, 03:46:16 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
kamelryttarn
March 22, 2019, 11:25:19 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
Mads Barnkob
March 22, 2019, 10:56:16 AM
post Re: looking for PCB creating software
[Printed Circuit Board]
Teravolt
March 22, 2019, 06:02:15 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
badpeter
March 21, 2019, 11:04:48 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
Hydron
March 21, 2019, 07:51:23 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
badpeter
March 21, 2019, 07:09:05 PM
post Re: looking for PCB creating software
[Printed Circuit Board]
kamelryttarn
March 21, 2019, 02:26:09 PM
post Re: GDT Experiments
[Solid state Tesla coils]
Uspring
March 21, 2019, 11:57:53 AM
post Re: GDT Experiments
[Solid state Tesla coils]
Teravolt
March 20, 2019, 11:15:50 PM
post Re: GDT Experiments
[Solid state Tesla coils]
Thunderstruck
March 20, 2019, 09:07:04 PM
post Re: Keep or throw away ?
[Beginners]
Teravolt
March 20, 2019, 05:18:07 PM
post Re: New small SSTC
[Solid state Tesla coils]
Bambinz
March 20, 2019, 03:52:15 PM
post Re: New small SSTC
[Solid state Tesla coils]
Mads Barnkob
March 20, 2019, 01:23:52 PM
post Re: GDT Experiments
[Solid state Tesla coils]
T3sl4co1l
March 20, 2019, 01:18:29 PM
post Re: GDT Experiments
[Solid state Tesla coils]
Mads Barnkob
March 20, 2019, 01:06:24 PM
post Re: cute-qcw Tesla Coil
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
March 20, 2019, 01:00:46 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
Mads Barnkob
March 20, 2019, 12:41:22 PM
post Re: Keep or throw away ?
[Beginners]
Thunderstruck
March 19, 2019, 10:02:41 PM
post Re: Keep or throw away ?
[Beginners]
Hydron
March 19, 2019, 08:14:33 PM
post Re: Keep or throw away ?
[Beginners]
Teravolt
March 19, 2019, 05:12:03 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
Experimentonomen
March 19, 2019, 01:32:32 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
Mads Barnkob
March 19, 2019, 12:20:34 PM
post Re: Strange gdt waveforms
[Dual Resonant Solid State Tesla coils]
Mads Barnkob
March 19, 2019, 12:15:22 PM
post Re: Which varnish to use to coat the Secondary?
[Solid state Tesla coils]
Mads Barnkob
March 19, 2019, 10:46:50 AM
post Re: Keep or throw away ?
[Beginners]
Thunderstruck
March 19, 2019, 09:11:09 AM
post Re: Keep or throw away ?
[Beginners]
Mads Barnkob
March 19, 2019, 08:24:31 AM
post Re: Keep or throw away ?
[Beginners]
Teravolt
March 19, 2019, 01:51:51 AM
post Re: Keep or throw away ?
[Beginners]
Thunderstruck
March 18, 2019, 09:56:42 PM
post Re: cute-qcw Tesla Coil
[Dual Resonant Solid State Tesla coils]
Weston
March 18, 2019, 07:55:52 PM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
petespaco
March 18, 2019, 06:11:07 PM
post Re: Strange gdt waveforms
[Dual Resonant Solid State Tesla coils]
Hydron
March 18, 2019, 02:27:35 PM
post Re: cute-qcw Tesla Coil
[Dual Resonant Solid State Tesla coils]
Uspring
March 18, 2019, 12:52:35 PM
post Re: Strange gdt waveforms
[Dual Resonant Solid State Tesla coils]
FilipŠebík
March 18, 2019, 12:22:58 PM
post New small SSTC
[Solid state Tesla coils]
Bambinz
March 18, 2019, 11:46:18 AM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General chatting]
Bambinz
March 18, 2019, 11:29:02 AM
post Re: Help for people buying the "12-48 Volt 1800/2500 Watt ZVS induction Heater"
[Electronic circuits]
Mads Barnkob
March 18, 2019, 10:35:04 AM
post Re: Strange gdt waveforms
[Dual Resonant Solid State Tesla coils]
Marty
March 18, 2019, 05:32:43 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