@ Max. Ref your query on comparing motors. Change to a common system of measurements, I prefer metric in this case and N.m, Using Newtons work of Force= Mass x Acceleration (F=ma) convert 0.78kg to Newtons by muliplying by g (accelation due to gravity 9.81 m/s/s) this gives 7.65N-cm. Then convert cm to m by dividing by 100, 0.0765N-m then multiply by 1000 to get mN, hence 76.5mN-m, so motor 2 is better by 2.5%. I've been racking my brains to remember the formulae to calculate the speed/accelaration to weight section, but it currently escapes me.
These typically resolve the position of the magnet to at least 256counts , and usually use I2C or similar. You can daisy chain the chips with SPI too. These are good, but can be finicky about spacing above the magnet.
This magnet could go on the wheel.
Alternatively if you use a 2pole magnet, you can use a magnetic compass chip, and this can be about 10mm away from the magnet, which might help in your geometry, I've used a magnetic compass chip this way, as a proof of concept for retrofitting the Austria Microsystem chips as an upgrade to reed switches.
Off the shelf linear actuators almost always use a 2pole to 6pole ring magnet attached to the motor or a gear shaft with a screw through the middle. And then standard hall effect switches.
Note if making your own , you must use "Latching" hall effect sensors
I also did a batch of about 100 of gluing encoders to the back of a gear motor,
(insert picture here???? the upload image from computer button has dissappeared?)
This had a 4mm stub shaft sticking out the back of the motor. You take a "Diametrically polarised" disc magnet (about 5mm across) , pick it up with bamboo tweezers put a pinhead of polyurethane on the magnet, then place it on the slowly rotating motor shaft, give it a nudge with the tweezers and it will centralise. You then put two half-pea sized globs on the PCB and push it onto the rear of the motor, and secure with a rubber band while the PU sets. The power is on all the time, so you should see both LED's flashing.
These don't usually work on the type of gearmotor you have there, as the motor shaft is flush on this motor style.
You can just take some of the 3 leaded Hall effects, solder them to a bit of veroboard, and glue this on the motor, The magnet/hall effect combo is quite tolerant of positioning. (Unlike slotted disk optos)
Ok Doing the Quad encoder in Firmware
(a) There is a booby trap in the way Atmel do the pin change interrupts, while you can get a pin chnage interrupt on every single pin, in practice there are only 4 pin change interrupts, one for each port, i.e. A , B,C,D. So you must hook up the "A" channel of your first motor to say any of the A pins, and the "B" channel of your second motor to say any of the B pins, and the third one to any "C" pin. The "B" encoder channels can go aon any pin.
(b) The PCI is set up to go off for any change on hall effect A , so all the ISR has to do is add one if hall effect A and B are both the same , or subtract one if different.
Here is some sample code:
Ew_pulse_isr: If Ew_quad_b = Ew_quad_a Then Ew_position_long = Ew_position_long - Ew_step_long Else Ew_position_long = Ew_position_long + Ew_step_long Return
Note you also get a free "multiply by scaling factor" thrown into the above!
in my case Ew_position_long is a fixed point representation, where the top 16bits are the sun angle in minutes, and the bottom sixteen are the fraction, (so you just map the top 16 bits as an integer and ignore the fraction) the scale factor is embedded in Ew_step_long which equals 8509 with my particular gearing, this is basically a fraction i.e. 8509/65536 = 1/7.7019 , so in my case I move 1 minute (= 1/4 of a degree) with 7.7 counts , and as there are two counts per revolution, this is nearly 4 turns on the motor.
@David, Yes a limited bed size, but as a test bed for the idea it has everything going for it. Even the ability to put in the drill holes.
And it will also fit on my lathe and vertical drill so I get the best of both worlds if the idea is a failure. As luck would have it my Kistarter backing for Microduino presents me with a Microduino stepper kit for 3D printing, so the table can also work for small part printing.
I shall order the table today and wait for all the other bits to come together. Looks like much of the glue circuits will be on Veroboard which is always my fall back PCB.
Thinking about it, I can always put the table to work as a micro milling cutter and mill some circuit boards straight from the copper.
Will try everthing out with and up down fibre pen and paper before moving to a board.
I can see that this is going to turn into a Crusty Bits blog at some stage. Watch out Max!
Life got hectic when I started to rebuild my old UK101 in an FPGA, little did I think I would be looking at home PCB manufacture.
Blog Make a Frequency Plan Tom Burke 17 comments When designing a printed circuit board, you should develop a frequency plan, something that can be easily overlooked. A frequency plan should be one of your first steps ...