--- Roman Black wrote: > > > Yes, you do need the negative feedback to get the > ball nice and stable. You can remove the bottom > light > sensor and just use one sensor, and for that matter > you only need one electromagnet. the lifting one. > > For the moment the biggest issue is the mechanics, > not the PID method. :o) > > If you try a constant magnetic field you find the > field strength needed to hold the ball weight > suspended > is VERY close to the field that will slam the ball > full upwards. To make it work in that way you need > VERY fine control of field strength which is a real > pain especially since you are using relatively slow > LDR sensors. > > A better technique is to use a strong field in an > on-off fashion, switched very fast based on a simple > comparator using the LDR. This will rely on the > relatively high inertia of the ball, so it never > has time to lift or fall too far. > > I think you can use something as simple as a LDR > + comparator that switches for a set (monostable) > off period whenever the ball gets too high, so when > the ball gets to set point it switches off, and > the off period and gravity are known so the ball > falls a known amount, then it switches back on. > > I have seen commercial desk toys using just a few > transistors, and noticed micro oscillation of the > load. Basically it is just a mechanical oscillator > regulated by ball position. :o) > -Roman Thanks for the ideas, I4ll give it a try and will tell you how did it go... * Carlos * _________________________________________________________ Do You Yahoo!? Informacisn de Estados Unidos y Amirica Latina, en Yahoo! Noticias. Vismtanos en http://noticias.espanol.yahoo.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads