DC (treadmill) motor controller - Page 1
Forum section: electronics / projects

author: ziqquratu
author_rank: Newbie
timestamp: September 12, 2017, 07:00:14 am
content: Hi all,New here, and looking for some help with a project I'm working on.I'm trying to build a controller for some brushed DC motors (all around 230V, 1.5kW) I've recovered from old treadmills, with the goal of attaching them to some woodworking machinery I'm also building. I'm basing my design on the controllers that came with the treadmills themselves (where I recovered them), as well as some circuits I've examined online. I've come up with a schematic that I think looks reasonable, and I'm hoping that I can get some feedback on it! Please bear in mind that I've not designed anything quite like this before, and am learning many of these things as I go, so there may be some absurdities in here! I am, however, comfortable in my ability to deal with the risks associated with mains voltages. And, for reference, "mains" is 230V at 50Hz in my corner of the world!I've attached my schematic, along with the schematics for the power circuitry from three treadmill controller I salvaged (as a pdf), and a cropped version of a motor controller published in Silicon Chip showing the relevant portions of that circuit. I'm planning to use an MSP430 microcontroller to drive the circuit, as I have them on hand.---The microcontroller is a placeholder at this stage. I'll worry about which pins to use when I start trying to put it on a PCB. Basically, it will read from the hall-effect sensor (which will be on a small breakout board), measure the current RPM, compare to the desired RPM (set by the pot RV2, probably in 100rpm steps; you'll have to hold down push switch SW2 to enter "set speed" mode and avoid risk of set point changes due to vibration or bumps). It will put out a PWM signal, say 2kHz, to the optocoupler; there will also be a 16x2 LCD attached, which I haven't bothered to include here. All this control circuitry will be powered by a small wall-wart, and so be isolated from the main power circuitry. I *think* the basic principles here are sound, but please let me know if I've overlooked something or done something ridiculous.On to the high voltage side of the circuit. The varistor RV1 across the AC lines will help prevent spikes (and I'll probably reuse the EMI filters from the treadmill controllers I have as well). The NTC thermistor TH1 will limit inrush current and so "soft start" the motor. After the rectifier, the voltage will be smoothed by C3 (reusing a cap from the controllers I have), before going through brake resistor R10 to the motor, itself protected by a high-power diode D4. The motor will be low-side driven by IGBT Q4, which is protected by a snubber (R12 and C7) and goes via current sense resistor R11 to ground.To drive the IGBT, a 15V line will extend via R2 and zener D3 (with C4 to smooth the supply and D2 to prevent C4 discharging backwards if the rectified mains dips due to insufficient smoothing). The optocoupler will drive transistors Q2 and Q3 (via a 300R current limiting resistor), which will in turn drive the IGBT (protected from spikes by the second 15V zener D5).As a guard against extreme over-current, I've included Q1 like shown in the Silicon Chip circuit. With the values shown, a current of 48A gives 1.2V across R11. The voltage divider R8 and R9 means Q1 would see 0.6V, which would cause it to pull the optocoupler output to ground and prevent it triggering Q2.I know I could drive the IGBT directly from the optocoupler, however I understand that a driver like this one allows me more room to increase the PWM frequency if I wish to (e.g. if I find the lower frequency is generating too much noise), and will help reduce switching losses, so for a couple of nothing components, it seems worthwhile. Also, I'm using basic transistors, instead of a dedicated driver IC, because I have them on hand and I think that this setup will be more than sufficient for my application.I'm not sure about the overcurrent protection offered by R11/Q1 - seems like a good idea, but I'm entirely open to criticism. I do want to include some means of checking the regular operating current as well - would it be OK to have the micro read the voltage across R11 directly, or is there a better/safer way (that allows me to keep the high-power side totally isolated from the micro circuit)?Oh, and of course there will be a fuse and physical power switches - a small switch to turn on the control circuit, and a NVR switch to allow me to turn the motor on and off without turning off the controller itself (so you can, say, set the speed with the motor turned off).Alright, so I hope that the explanation of my thinking makes sense, and I look forward to hearing what anyone thinks!

author: Zero999
author_rank: Super Contributor
timestamp: September 12, 2017, 08:24:21 am
content: The idea of isolating the MCU from the mains is a good one. The motor current can be measured, whist maintaining isolation, using a Hall effect sensor, on the DC side, or a current transformer, before the rectifier.The most glaringly obvious error is D3 is reversed.Consider increasing R2, as I doubt that much current is required to drive the IBGT. The C4 should be enough to handle the peak gate current and the average current will be much lower. A switched mode PSU, consisting of the guts out of a 15V wall wart (this will work of either AC or DC) or transformer + rectifier (primary on AC side of course!) could be used instead of the zener+resistor.Another thing to consider is that the average voltage across the motor will be greater, now there's a smoothing capacitor. It will also increase the amount of power dissipated in R2 and D3.The only other thing I would have suggested, is an isolated MOSFET/IGBT gate driver IC but I can see you've already made the decision not to.http://www.ti.com/lit/ds/symlink/iso5500.pdf

author: ziqquratu
author_rank: Newbie
timestamp: September 13, 2017, 03:17:05 am
content: Hi Hero, thanks very much for the helpful reply.Quote*Facepalm* Thanks for catching that one!QuoteThanks for the suggestion.QuoteI had wondered about this, but figured that the average voltage across the motor would ultimately be dictated by the PWM (and assumed - perhaps incorrectly? - that the peak voltage wouldn't really matter so long as the average remained below the rated 230V).But, do you think I'd be better off without smoothing at all? Certainly, the treadmill controllers themselves had these large smoothing capacitors, but the Silicon Chip circuit has only a very small one (100nF, which Iassumeis for filtering transients alongside the MOV they placed there?). If I were to remove the 470uF capacitor, should I then include the smaller (100nF) capacitor in its place, should I put it on the other side of the rectifier (across the AC input parallel to the MOV) or should I just dispense with it entirely?QuoteAnother excellent point that I hadn't considered. Thanks. Obviously, the response to this will depend on what I do with regards to smoothing.QuoteA reasonable idea, and it's likely I'd have something suitable in my junk box. I'd still like to try this zener-based method, however, as I plan to make a few of these and don't want to be limited by my ability to scrounge 15V wall warts or transformers (which isn't a concern for the 5V source as those are, of course, everywhere!).Once again, thanks for the really helpful response.

author: Jidis
author_rank: Regular Contributor
timestamp: September 13, 2017, 05:29:56 pm
content: Quote from: ziqquratu on September 12, 2017, 07:00:14 amDon't mean to sidetrack the thread, but I'm curious as to what you're making.Thanks!

author: Zero999
author_rank: Super Contributor
timestamp: September 13, 2017, 06:32:10 pm
content: Quote from: ziqquratu on September 13, 2017, 03:17:05 amThe 100nF capacitor wouldn't have done much smoothing. It would have been there purely for EMI suppression.You're right that the voltage across the motor is determined by PWM, rather than the peak voltage, and if your controller is regulating the speed and has over-current protection, it shouldn't matter.Whether or not smoothing is needed, depends on what the load is. If it has lots of inertia, then no smoothing will be required, otherwise there can be problems with vibration.

author: ziqquratu
author_rank: Newbie
timestamp: September 14, 2017, 12:03:59 am
content: Thanks, Hero. I think the solution, then, will be to give it a try without the smoothing - but I'll leave a place for the cap on my board. That way, I should simply need to add the cap and change the value of R2 if it becomes a problem.Jidis, I've a couple of things on the list. I've just scored a rather nice wood lathe from my father-in-law, for which this will be perfect. I also picked up an old table saw without a motor, and while this one will likely be a bit underpowered, it will get it running until I come across something more suitable. And I'm working with my father-in-law on a wooden bandsaw (along the lines of this one by Mattias Wandelhttps://woodgears.ca/bandsaw/build.html), which he wants to use for building a guitar.

author: Jidis
author_rank: Regular Contributor
timestamp: September 14, 2017, 05:13:29 pm
content: Thanks ziqquratu- that's cool stuff!Been building "lathe-like" things myself over the past couple years to spin drum shells and stuff, and restored/modded my first wood lathe last year (a 1931 model). I'm way too low tech for such elaborate speed control though, and dependent on standard 1700rpm universal motors and multiple cast pulleys. I've been wondering about finding something smaller and variable speed (or just slower speed) recently, as I'm trying to rig up something to sharpen drill bits with one of those side-of-the-wheel grinder jigs. Got the disc half of a belt/disc combo sander doing it now, but it's too fast and usually has coarse paper and a table mounted to it. I'm figuring most small hand held power tool motors could probably spin a disc large enough for this, but I need one which can safely be driven at a lower speed.Thanks (and sorry for the off-topic)