Notifications
Clear all

Electric adjustable standing desk.

15 Posts
5 Users
4 Likes
2,247 Views
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

I am working on putting together an electric adjustable standing desk and am trying to get a handle on the electric system first. I am a proper newbie to this type of design so I would appreciate any feedback on the configuration. I am sure there are glaring mistakes. 

This is an arduino uno with a Cytron MDD10A motor controller powered by a DC 12V 10A 120W Power Supply with some basic 12VDC actuators. I am hoping to control the actuators with this 5 button membrane switch.

The biggest hurdle for me in this project I think will be putting together the code to control this. It should be pretty basic, but for someone who hasn't done much coding ever, it will be a challenge. I will appreciate any tips on where to start. 

V1

   
Quote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@solitaryleaf

Just some observations for you, for what they're worth - maybe not too much, but my first thoughts were why use a motor controller and arduino for this task.   It reminds me of a woodworking router lathe I have in my workshop.  The motor to drive the carriage movement runs on 12 volts and has a switch, forward and reverse and a dial for the speed. It turns a screw that moves the router carriage back and forth and at both ends of the travel there is a limit switch to cut the power to the motor to keep the forward and reverse with limits.   

So maybe you are looking to overcomplicate what could be a simple electrical / mechanical solution, but granted maybe not a much fun as what you propose.  Have fun. 😀 


   
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@byron Thanks for the reply! Yeah, I should have added a disclaimer to the post, I had thought of this and heard the same suggestion from others. I want to be able to program the buttons for certain heights like you would see on a top-end standing desk. Plus I wanted an opportunity to get my hands dirty with an intro to Arduino etc. 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 
Posted by: @solitaryleaf

I wanted an opportunity to get my hands dirty with an intro to Arduino

Thats the spirit 😎.  If you are new to programming you will probably find doing your project with microcontroller that runs micropython or indeed a Raspberry Pi that runs full python will be an easier to get started with.  Not to put you off the Arduino route, which is just as fun, but if you are in the early stages its worth a consideration.  Whilst I started out in C way back when, and reacquainted myself with in when I started mucking about with the Arduino, about 4 years ago I got a Rpi and leaned Python and found I much preferred using python, but others will hold different opinions.  

Without the arduino et al you could have pre-set heights with momentary limit switches that you then override for the next height etc. , but your challenge is to do it with the Arduino so I think you are along the right lines with what you propose.   An another thought for your proposed project is do you need to drive both motors separately, would not it be better to wire them in parallel both from just one motor controller?


   
SolitaryLeaf reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

As you are proposing to use a matrix keyboard here are a couple of links to show how to use them in code.  They are not the same key thingy as yours, but the principles are the same.

First up do it in python 😀 

And do it in Arduino c

https://www.baldengineer.com/arduino-keyboard-matrix-tutorial.html

Happy programming


   
SolitaryLeaf reacted
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@byron

Thanks for the perspective on Arduino vs Rpi. This is something I had not yet considered. I may actually end up going with Rpi. 

The thing about momentary switches is that if I wanted to have switches to reach a destination in the middle of topmost height and bottom-most height, I would need a mom switch down and a mom switch up for each destination in between top and bottom. The mom switch idea would be great if I only wanted to reach top and bottom. Am I thinking about this correctly? 

On the motor controller, I suppose you're right, can you think of any side effects to using one motor controller? I guess as long as the amperage rating could handle it. I wonder which alternative would be better for feeding each motor power equally? 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 
Posted by: @solitaryleaf

Am I thinking about this correctly

Probably 😎 , though in my minds eye for a mid point I was thinking about a switch that cut the power at a certain point of travel, but that could be manually overridden sort of like a 2 way light switch.  If you go for a microprocessor controler or single board computer (SBC like the Rpi) I think you will still need limit switches for the beginning and end of travel for safety (programs have bugs 😮)

And thinking of your actuators I wonder if you could get by with just one in the middle and each side has an easy to move support such as you get in a full extension drawer runner.  Probably not an actual drawer runner but something similar, the whole mechanism would need to run without twist and slop of course.

And that then gets me thinking of just how much holding power your desk would have.  Extend it to full height, lean on it with a cup of coffee in hand, plonk on a pile of books, another person comes by and jumps up to sit on your desk...... will it all come tumbling down. 😩 

You need to give careful though to the engineering side and have probably thought about all this.  Have you studied how these rising desks are made.  At several places were I worked I did have one and did not give it much thought but from memory it was some sort of dampened spring arrangement with a lock off knob. Dear me, memory is failing me on just how they were operated.  It was all easy enough though and without any motors at all.


   
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@byron

I am trying to picture a switch that would cut power at a certain point without it being a timed switch(momentary limit) or without it being controlled with limit switch logic. Not that I don't think the solution is possible, I just don't have the EE background to even know what to search for. Good thing is that the actuators have limit switches in them. 

One in the middle is certainly an interesting alternative, I think I would prefer the two on either side just for a large safety factor there plus I would like to maybe mount a vice and other heavy stuff in the future. 

In terms of holding power, I think I will need to factor in a locking mechanism for each stage I plan to program it to. I don't quite understand the capability of the actuators to hold a certain amount of weight over time without being energized. 

Failing memory or not, your dialog is certainly helping me think through different aspects of this design. I thank you for that. 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@solitaryleaf

this link has some info on limit switches that may be of some use.

https://www.eaton.com/ecm/groups/public/@pub/@electrical/documents/content/pct_1549250.pdf

 


   
SolitaryLeaf reacted
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@solitaryleaf

Posted by: @solitaryleaf

In terms of holding power, I think I will need to factor in a locking mechanism for each stage I plan to program it to. I don't quite understand the capability of the actuators to hold a certain amount of weight over time without being energized. 

An actuator or just a simple motor may well fall short in this area.  I think you need a motor with a reduction gearbox that incorporates a worm wheel, that way when you reach your position and cut the power, the weight of the table will not be able to force the motor to rotate in reverse, due to the worm wheel configuration design.

 


   
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@frogandtoad Thank you for your reply. From a little research, I think this type of actuator should be pretty secure when extended because of the screw extension configuration. They also have limiting devices which are nice. This Is making me feel little better about the design. If I find out that the actuators don't hold well, I can add one of these clamps to the extension since I am making it out of 80/20. 


   
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

I have made some progress and adjustments to the project! I actually ended up buying a manually adjustable standing workspace made by husky because it was nice and affordable. Now the challenge is to find an electric motor for this. This is pretty specific but anyone have a recommendation on where to find a 12v around 60RPM 15in/lb torque rating electric motor? having a hard time finding something on McMaster or amazon that has the right torque rating that isn't overkill. 

IMG 20200515 123700

   
ReplyQuote
Ruplicator
(@ruplicator)
Member
Joined: 4 years ago
Posts: 127
 
Posted by: @solitaryleaf

On the motor controller, I suppose you're right, can you think of any side effects to using one motor controller? I guess as long as the amperage rating could handle it. I wonder which alternative would be better for feeding each motor power equally? 

If your back looking for a motor you may want to look also for one with an encoder wheel. It will be difficult to get the motors to turn at the same speed for a number of reasons eg., difference in motors, friction, weight on different ends of the table. An encoder wheel will tell you the revolutions each motor is turning and the speed. You can use this information to allow your software to adjust power and keep the table level during positioning.

Another way of doing this is with a stepping motor. This is how 3D printers and many other devices keep track of movement. Steppers also come in many different sizes and power output.

Have you decided the linear actuators you mentioned in your first post won't work?  I noticed that they only had a 12 in. stroke which is probably not enough for your application.


   
ReplyQuote
SolitaryLeaf
(@solitaryleaf)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

Good call on the encoder wheel. With the table I ended up getting pictured in my previous post, I will only need one motor since the crank included with the desk and lifting mechanism lifts both sides simultaneously. I just need to figure out how to turn the crank included with the desk. Hopefully with chain and sprockets? I am hoping to be able to specify a motor controller once I decide on a motor. 


   
ReplyQuote
(@tagivens)
Member
Joined: 4 years ago
Posts: 16
 

First off, I respect your decision to throw code at something that doesn't neeeeed it!  You'll learn a lot by over-engineering stuff like this. It's the best!

 

If I were converting the desk you have into a motorized one, I would look into using a windshield wiper motor from a car. I got a new one from the auto parts store for like $20.  And it has a warranty! Lol.  Wiper motors are geared and have incredible amounts of torque and lower RPM. They have a 'low speed' setting and a 'high speed' based on how you wire it up, and it loves 12 volts.  They're not too terribly big nor heavy, but they aren't little, either.  

 

First thought..

To control it, the biggest obstacle for me would be getting the arduino to know where the desk actually is. You'll want a stop switch at the lowest and highest points so the motor isn't trying to crank when the desk can't move any further.   Depending on the amount of positions you want the desk to stop in, you could add more switches for the back of the desk to trigger when it reaches them. Or if you're really itching to write some code, you could add some infrared/light sensors to the wall behind the desk and a infrared led to the underside of the desk pointing toward them. Same concept, just with light instead of physical contact.

For the code, you could store the last switch activated in a variable, so if position2 was triggered last and you hit the position3 button, it'd know which way to turn the motor. Or going from position3 down to position1, it'd turn the other way until the respective switches were triggered.

 

Second thought..

If you're using an arduino, you could go with a Mega and a motor driver shield that's made for it, then use a stepper motor for the sake of changing positions.  Still use bottom and top stop-switches for safety, but have the arduino lower the desk until the bottom switch is triggered when you first power up the arduino. It'll know where 'home' is at that point and you can have it set a variable for deskHeight to 0.  Then, figure out how many steps it takes to get between each position you want, and have the stepper motor move that exact amount to get where you tell it.  You should be able to find a NEMA17 stepper motor strong enough to spin that crank, but I'd recommend using a belt rather than a chain. If your stop-switches miss or fail, a belt is more likely to slip before damaging something. The chain will put a lot more stress on the system before something gives out (hopefully the chain!)

Also, if you're using a belt, you can just replace the crank with a homemade wooden pulley that bolts to where the crank is bolted. Bigger pulley would be slower with more torque, smaller would be faster with less. I'd recommend a V shaped belt over one with teeth so it'll slip easier if something goes wrong, then tension it enough to where it doesn't slip under normal operation. 

 

 

Nice project, keep us posted!

Tim


   
SolitaryLeaf reacted
ReplyQuote