How to control the position of this elevator-like cabinet?  - Page 1
Forum section: electronics / beginners

author: Abstr7ct
author_rank: Regular Contributor
timestamp: November 21, 2014, 08:00:31 am
content: I'm working on this project of mine in which a DC motor linear actuator carries up/down three cube-shaped drawers as seen in the attached image. By default, the bottom two drawers should be hidden behind the surrounding wall, leaving the upper drawer exactly on ground level. Whenever the user calls the second drawer from the top, the actuator should move the structure up until the edge of the second drawer becomes exactly aligned with the edge of the surrounding wall. The same thing applies if user calls the lowest drawer. So, whichever drawer is called, its edge must align with the edge of the surrounding wall. It's like how it's done in passenger elevators in which the cabinet stops exactly at ground level.To solve the problem, I thought of using an infrared emitter and detector. I ended up experimenting on a breadboard with an IR LED and an IR light-t-voltage converter TSL267. This sensor gives an output voltage proportional to the amount of received infrared radiation, and it gives a maximum output voltage swing of 4.49 V with a 4.5V VDD and no load. I thought of using three different IR emitters, one for each drawer, and one TSL267 fixed at ground level of the wall. I had the idea that the TSL267 will give an output, that would be interpreted by the mcu as high, only if it has a face-to-face with the IR emitter. The breadboard experiment revealed the contrary, that's, even if the emitter and detector are considerably not facing each other, the detector would still output a voltage level that's comparable with that of them having a face-to-face contact.I've been thinking that to better control the position, some kind of an optical sensor that emits light in one direction can be considered. Given that I'm no sure what to do, I would like to see your suggestions. And by the way, the linear actuator doesn't have a built-in position sensor.

author: Yago
author_rank: Frequent Contributor
timestamp: November 21, 2014, 10:30:21 am
content: Photo-interruptors at each stop point, and a vane/tab on the car to do the interrupting?Or even the other way round, interrupter on car and vanes at the stop points.

author: Zero999
author_rank: Super Contributor
timestamp: November 21, 2014, 01:29:54 pm
content: You need an analogue input to do this properly.The problem is, there will be some momentum, so even if the motor is turned off when the draw's edge lines up with the edge of the surrounding wall, it will continue to move, due to the mechanical energy stored in the motor and mechanism.The speed of the motor needs to be gradually reduced, before it needs to stop, to make sure there's no overshoot.

author: Abstr7ct
author_rank: Regular Contributor
timestamp: November 21, 2014, 02:07:47 pm
content: Quote from: Yago on November 21, 2014, 10:30:21 amI looked for photo interrupters with separate emitter and detector and I found a few search results, but I'm not sure that they will provide a face-to-face detection only. If it does so, it may do the job.Quote from: Hero999 on November 21, 2014, 01:29:54 pmSo you suggest to ADC the output of the IR detector? this may reduce the positioning error, but it would still be unreliable due to the errors in reading ADC values. 1011 now may become 1010 a minute later, or not?Knowing how passenger elevators position themselves at ground level may be helpful. How is it done? I imagine that it wouldn't only involve electronics and sensors as there's a mechanical system that adjusts itself to stop at floor level, or not? if it's the case, then I imagine that it would nearly impossible to achieve a zero error ground-level positioning system using electronics only. If it's the case, then I look forward to achieve the least error possible using sensors only. I don't want to march into mechanics for this one.

author: Rudolfo
author_rank: Contributor
timestamp: November 21, 2014, 02:16:12 pm
content: Another option is to do it wil a Hall switch and a magnet. If the zero positioning has to be ajustable by software it would be smarter to use a linear Hall encoder, like the iC-ML:http://www.ichaus.com/product/iC-ML. The magnet is 5mm long and with 8-bit the position resolution is 5mm/256, or better than 0.02mm.

author: Yago
author_rank: Frequent Contributor
timestamp: November 21, 2014, 02:57:24 pm
content: I did some work on lifts decades ago, they used magnetic proximity switches, can't find the type on google.A vane of steel would be fixed in the shaft, as the lift travelled this slat of steel would slide through a slot in the detector and activate it.I think they were done as a binary count, so you see a row of them side by side.The top and bottom were also covered by mechanical limit switches.

author: SeanB
author_rank: Super Contributor
timestamp: November 21, 2014, 03:46:07 pm
content: You use magnetic proximity sensors and a vane, on the car or the shaft, to tell it that the car is approaching the level, then the controller slows down to low speed until a second sensor signals the car is at the stop position. Often you have a mechanical brake to lock the car at the floor for loading.In a shaft you typically have a long strip of woven strap with the magnets bolted to the strip and a trio of sensors on the car that detect the magnet as it approaches and then stops at level. To get position you have a single switch and at power on you simply travel down or up till you get the switch to trip, which then gives you a position that is at the end of the shaft, so now you know an absolute position and can simply count from there.

author: max_torque
author_rank: Super Contributor
timestamp: November 21, 2014, 08:34:38 pm
content: You can get linear actuators with linear potentiometers built in. That would make it very easy to control the position accurately, and you could even make the velocity of the actuator dependent upon position error, just like a lift!You would need to have a basic "learning" function, so you would manually "jog" the actuator to the correct height, and then have the system "learn" the potentiometer voltage that corresponds to each level etc

author: SL4P
author_rank: Super Contributor
timestamp: November 21, 2014, 10:31:24 pm
content: Quote from: Yago on November 21, 2014, 10:30:21 amFace-to-face is fine, but to reduce the chance of snagging or other damage to the flag - consider a reflective sensor on the side, or the drive mech)... or a pass-through detector on a protected part of the whole carriage.You could also consider an index strip on one edge - being read (counted) by the uC to determine position and accel/decel requirements.They are all the same complexity - suited to slightly differet requirements.

author: Abstr7ct
author_rank: Regular Contributor
timestamp: November 22, 2014, 07:11:24 am
content: Quote from: max_torque on November 21, 2014, 08:34:38 pmI thought of doing this. Basically, the output voltage of the built-in potentiometer varies according to the position of the actuator's stroke. ADCing that voltage gives binary combinations that correspond to the position of stroke. I imagine that it can be done by measuring the output voltage of each case, that's, measure the voltage when the lowest drawer is at ground level and so is the case for the second and upper drawer. Translate every voltage reading into a binary combination based on a 10-bit ADC resolution. In software, keep checking for these binary combinations. However, there would be still errors in ADC readings, and these errors can be overcome, as I imagine, using some form of PID control, or what you refer to as 'learning function'.Increasing the ADC resolution may even give less errors. If a 10-bit resolution is used for ADCing a 0-5V pot output, then for every +/-0.004V change approximately, there's a new binary combination. A 12-bit resolution would make it for every +/- 0.001 change approximately. Still, I still don't understand these built-in pot in linear actuators. When I supply the motor with 12V, does the pot output range falls between 0-12V? this means that its output must not be directly fed into an mcu pin as there should be a voltage divider to bring the range to 0-5V, or not?Quote from: SL4P on November 21, 2014, 10:31:24 pmAn index strip is interesting. I read that in some elevators, there's an optical sensor mounted at the car and it counts the number of holes in the guide rail to determine the current position of the elevator car. I may be able to set up something like this, but what kind of a sensor can do this?

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 22, 2014, 07:41:12 am
content: You could use a retro-reflective sensor like this:http://www.allelectronics.com/make-a-store/item/osu-79/retroreflective-photoelectric-sensor-used/1.htmlOr embed magnets under the surface of the structure and use a simple magnetic reed-switch.http://www.allelectronics.com/make-a-store/item/rsw-33/reed-switch-normally-open/1.htmlOr you could even put notches in the structure and use a simple roller microswitch like this:http://www.allelectronics.com/make-a-store/item/sms-319/0.1a-snap-action-switch-w/roller-lever/1.html

author: miguelvp
author_rank: Super Contributor
timestamp: November 22, 2014, 07:49:05 am
content: retro reflective sounds good, if it's good enough to project stereoscopic 3d images like in the castAR it should have no problem with this application.

author: pickle9000
author_rank: Super Contributor
timestamp: November 22, 2014, 08:07:23 am
content: string pothttp://www.unimeasure.com/

author: SL4P
author_rank: Super Contributor
timestamp: November 22, 2014, 08:10:59 am
content: Quote from: max_torque on November 21, 2014, 08:34:38 pmA valid proposition for a demo/non-critical application...It tells you where the positioned is... not the carriage.Tightly and reliably coupled - a good solution. Closed-loop it's not.

author: Mechatrommer
author_rank: Super Contributor
timestamp: November 22, 2014, 10:46:10 am
content: just simple (trimmable) copper strips at each level and spring contact on the other side is enough to tell the circuit where they are at. move up or down accordingly until the next level is reached. a technique used in many multi thousands (professional) equipments and pretty much all DMMs on earth with mechanical selectable mode.

author: Circlotron
author_rank: Super Contributor
timestamp: November 22, 2014, 11:26:24 am
content: Ultrasonic reflective distance measurement?http://www.pepperl-fuchs.com/global/en/classid_182.htmOne sensor for all stopping position.

author: max_torque
author_rank: Super Contributor
timestamp: November 22, 2014, 11:41:56 am
content: The built in linear position sensors in a typical linear actuator is completely separate from the motor/drive system. It's normally a 3wire device, although you can get some actuators with two potentiometers to give a level of redundancy / error checking etc.You feed it you analogue reference voltage (say 5V) and analogue ground ref, and it returns a ratiometric output voltage that varries linearly with actuator position. As this device isn't going to move very fast you can easily oversample that sensor voltage with you ADC to both get a higher resolution and also to remove noise. (you could easily have enough sampling speed on something like an AVR to get to 12b resolution) Depending on your control method, you want to avoid any dither in the position, so may want to include control deadbands etc. If you want completely autonomous position learning, you could include some of the other digital position indicator suggestions, like the LED/LDD sensors, and use these as flags to set the absolute position reference for each level. That way, you get the accuracy of true positioning and the speed/smoothness of linear control ;-)

author: SL4P
author_rank: Super Contributor
timestamp: November 22, 2014, 12:52:52 pm
content: Quote from: max_torque on November 22, 2014, 11:41:56 amUsed them a few times and they're great - no criticism other than being a bit slow, and limited in throw until you spend more $$I was just pointing out to the OP that integrated servo/position sensors are measuring the positioner's displacement - not the carriage position. The cap/bolt pops - and the actuator/cpu is 'Happy as Larry', while the carriage is nowhere to be seen.We don't know what he's making - so anything is acceptable until he chooses one strategy. My preference is a closed loop -bothin hardware and software.Personally - based on what we know so far, I'd go for reflective IR or visible markers. No flexi-cables to the carriage (to break or get snagged), no protrusions from the carriage to design around, 3-wire uC interface per sensor. Also speed-ramp, and approach/departure capable sensing, as opposed to position/limit-only.Motor depends on payload, speed and budget.No sensor connection to the carriage, and incredibly cheap to implement after the specific actuator has been identified. Servo, linear, pulley, pneumatic, hydraulic, gravity return... whatever he wants - islogically independentof the feedback circuit - hence can inform position independently of the actuator'sphysicalposition.

author: Circlotron
author_rank: Super Contributor
timestamp: November 22, 2014, 10:22:24 pm
content: How about a stepper motor with a single microswitch to find the home position on startup? No position feedback necessary.

author: SL4P
author_rank: Super Contributor
timestamp: November 22, 2014, 10:26:48 pm
content: OK - that certainly defines 'open-loop' control.Good for some things - maybe the OP requirements.Steppers don't 'usually' have a lot of torque at start and speed, and may miss-step occasionally - so encoders and position sensing / re calibration is frequently used - like in a disk drive (head positioner) and many other devices.

author: SL4P
author_rank: Super Contributor
timestamp: November 22, 2014, 10:33:07 pm
content: Quote from: Abstr7ct on November 21, 2014, 08:00:31 amCompletely aside/OT...That 'effect' of approaching the target, minor overshoot, and settling may be nice to consider if this is not an 'engineering' application. That 'organic' analog feeling may add considerably to the appeal for non-techies.e.g. I just added a 'breathing' LED to a project withnon-linear, asymmetric up/down fading cycle. It is much less 'aggressive' or distracting than the 'blinking or straight fade-up-fade-down which I had originally used.Still love to see the OP project when he's done!