Say Padre, that sounds good. Do you have a file you can send of a good circular pattern that I can work from? John Mullan Technical Manager O.L.G.C. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Thomas McGahee Sent: Thursday, November 16, 2000 9:25 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [EE]: More motor control. To compensate for the difference in rotation you first have to have some means of sensing the rate of rotation. You mentioned that your motors have built in gearboxes. If you have access to the motor shaft itself, then you can use a simple "rotation detector". This can be as simple as an addition to the shaft that has a single hole in it. An LED/phototransistor can then detect the shaft rotation. I have, on occassion, just slipped a short length of plastic or aluminum rod over the end of the shaft. A single hole drilled across the rod allows light to shine through twice per revolution. Because of the gearing, this still allows considerable accuracy in the control of the output shaft rotation. MOTOR- SHAFT ----------+ | | |------ -- _ | -- (_) | ROTATING HOLE | |------ | ----------+ Measuring the number of flashes of light detected per second would give you a good indication of motor speed. (You can also measure period instead of frequency). To keep the speed of two motors constant, use one as the reference, and adjust the other so that it matches the speed of the reference. PWM control works well. It is a good idea not to run the reference motor at full speed, just in case the other motor cannot achieve that speed. If you cannot put a rotation detector on the motor itself, then you can still put something on the output shaft. In that case you would probably want to generate as many pulses per revolution as possible. I sometimes make rotary slot patterns on high contrast printer's film. I first print the design larger than normal on my laser printer, and then have the print shop shoot the negative at reduced size so that I get a very crisp, clean negative. This is then cut to size and mounted on a thin sheet of plexiglass that helps hold it rigid. This in turn is mounted somewhere along the wheel axle and an LED/phototransistor pair is used to detect the movement of the slots as the wheel rotates. You can also use a reflective method instead of a transmissive method. In that case you don't need a film reproduction. Just print directly on white paper. Mount the paper on a rigid disk that then attaches to the shaft/axle. When using a reflective version, it is often useful to use a slit or small peephole in front of the phototransistor to limit the portion of the pattern that the phototransistor can see. This cuts down on false signals. Fr. Tom McGahee ----- Original Message ----- From: John Mullan To: Sent: Wednesday, November 15, 2000 8:43 PM Subject: [EE]: More motor control. > I've picked two seamingly identical motors with built in gearboxes that I > want to use for my small robot project. > > PROBLEM: When I hook both to the same power source, their rate of rotation > is not identical. One rotates a little faster than the other. It gains one > revolution in about 10-15 revolutions. > > Yes, I will have each motor under seperate 'H' Bridge control. And I > suppose, for distance measuring, I may use optical flaging. > > QUESTION: The circuit will be PIC enabled. Does anybody have > recommendations on the best way to compensate for the difference in > rotation? I don't want the robot forever moving in circles. > > John Mullan > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads