4
\$\begingroup\$

I have a circuit with a button and a motor. How would I make the motor gradually ramp up speed over 1-3 seconds when the button is pressed and gradually slow down over 0.5-1 seconds when the button is released, instead of the motor going full speed immediately? The circuit may be either 12V or -12V depending on the desired turning direction.

This is a simplified version of an old electric desk control circuit. The desk moves too suddenly when the button is pressed and I need to slow it down.

As a programmer, my go-to solution for stuff like this is often a microcontroller, but I'd like to try using analog components if possible.

Even though I've had education in electronics back in the day, I don't know if there is a name for what I'm trying to do and how to search for more information about it. I'm stuck googling with too broad keywords. If the analog solution isn't too much more complex than a microcontroller one, please point me to the right direction.

\$\endgroup\$
13
  • 1
    \$\begingroup\$ Everything makes sense when you are ignorant of what needs doing to get there. It seems simple to just say, "Why can't a robot recognize a book laying on a table by itself in plain sight?" But then when you try and do it and are no longer nearly as ignorant about the process, you've also got your answer too. Because now you know why it is hard, now that you aren't so ignorant about it. Your question is like that. Seems simple on its face and I'm sure it makes a lot of sense to you. But... to those informed this is more of a tar-baby than you are imagining, I think. \$\endgroup\$
    – jonk
    Jan 11, 2018 at 17:57
  • 2
    \$\begingroup\$ Speak with the desk supplier. \$\endgroup\$
    – Andy aka
    Jan 11, 2018 at 17:59
  • \$\begingroup\$ Custom? one of these ? upliftdesk.com \$\endgroup\$ Jan 11, 2018 at 18:07
  • 1
    \$\begingroup\$ It's a generic and old desk. Works well enough but needs fine tuning. No need to replace it with another for something like this. \$\endgroup\$
    – Pichan
    Jan 11, 2018 at 18:34
  • 2
    \$\begingroup\$ @jonk Seems a bit ignorant to assume I'm being ignorant for wanting to know more about a topic I presume to be relatively simple by my standards. I'm not an engineer but my education was a somewhat focused on electronics, in finnish and a long time ago. You seem to know how it is done, so instead of commenting on the nature of my question you could've provided the answer or even said that it's actually more complex than I'd think because x and y and z, in which case I'd have thanked you for your insight and started considering a microcontroller instead. \$\endgroup\$
    – Pichan
    Jan 11, 2018 at 18:44

2 Answers 2

2
\$\begingroup\$

Generically you may be able to do this by controlling a DC motor with PWM using and ramping the duty cycle from 0% to 100% over some time, and that will probably solve your problem.

The details are heavily dependent on the type and size (current/voltage) of motor- it may not be practical if the motor is of certain AC types for example.

I have retrofitted something that this and it worked well in the application (it happened to be gently lifting many millions of dollars worth of equipment rather than a desk top).

I used a cheap little microcontroller (PIC18F14K22) with a few lines of assembly code (less than 200 including comments and blank lines) to generate the timed 7.8kHz PWM signal to drive several large MOSFETs. A hardware overcurrent cutoff was included (probably why I picked that particular chip). I was able to leave all the original safety and other interlocks in place, just interrupting what was already present.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Thanks! I considered a microcontroller myself, but thought it could be simpler to do with analog components. \$\endgroup\$
    – Pichan
    Jan 11, 2018 at 18:50
  • 1
    \$\begingroup\$ Pretty much anything these days is simpler with a mico. They are dirt cheap and if you can invest a few days in the learning curve pretty easy to use. \$\endgroup\$
    – RoyC
    Jan 11, 2018 at 19:16
  • \$\begingroup\$ @RoyC I've some experience in microcontrollers and am a full time programmer. Not much learning curve there, luckily. I just thought that being a programmer, microcontrollers are very good hammers and every problem looks like a nail :D \$\endgroup\$
    – Pichan
    Jan 11, 2018 at 21:12
  • \$\begingroup\$ Accepted this answer. If it's not too much trouble, could you tell me more? Anything special to pay attention to? I was considering an ATMega chip because I'm most experienced with that and Arduino, and they're easily available. \$\endgroup\$
    – Pichan
    Jan 17, 2018 at 8:18
  • \$\begingroup\$ ATMega can certainly do it. MCU + 12-V capable gate driver (eg. MCP14A0602) + a biggish MOSFET, diode across motor. PWM at some kHz and ramp the duty cycle either with interrupts or delays if you use hardware PWM. If you want to drive the motor in both directions with software you would need a more complex circuit. Be sure to leave safety/limit switches in place. You can draw a schematic and ask another question here if you have concerns. \$\endgroup\$ Jan 17, 2018 at 13:25
1
\$\begingroup\$

Your desk circuit could indeed implement a slow attack and slow decay function for the key switch.

Adding one wouldn't be difficult in theory but may well be in practice as there's a warranty to invalidate, not to mention the violation of the current safety mechanisms that the manufacturer has guaranteed but won't afterwards.

But, answering your question, an electrical circuit to give the effect you want would be simple and straightforward.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thanks! Not really worried about the warranty. It's an old desk and I don't think I'm risking more than just burning some electronics which is about as unsafe as having it unplugged :) \$\endgroup\$
    – Pichan
    Jan 11, 2018 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.