I've been wanting to get into CNC for a while now and I've finally found the time to play. Since steppers are expensive and hard to find in Australia I though I'd have a crack at making a DC servo.
My test motor is just a 6v low current one I got in a cheap $10 gearbox set from Jaycar [www.jaycar.com.au]. Initially I was used a 20CPR encoder but I just moved up to a 60CPM and couldn't be bothered retuning it because it worked well enough. The pic I used is a 16F628A running at 1 MIPS which is a little slow. The max RPM I could run at is about 200 without losing encoder steps but bumping up the frequency of the controller would increase this alot. I just used the internal oscillator to keep it simple.
The encoder was printed on a transparency sheet and cut out. I used two photo interrupters to get the signal. off the encoder. The motor is driven by a 4 amp H bridge which uses bipolar transistors which don't even break a sweat with this motor. It turns out P FETs and MOSFET drivers are quite rare in Aus also so I couldn't use them
A short video can be seen here -
The big gear is being driven at 4:1 which gives a 1.5 degree resolution (6 degrees at the encoder). The overshoot is usually about 2 steps but the motor is very lightly loaded and the PID loop isn't tuned to the new encoder.
The video looks a little jumpy because of the camera and the way I was issuing motion commands. It was only getting commands every 1/4 of a second so it looks a little erratic because its snapping to position, stopping and waiting for the next command.
The plan from here is to build a little CNC router and use from larger motors. Hopefully that will produce something that can mill light aluminum so I can make some inrunner style brush less DC motors so I can move onto a brush less controller and be one step closer to the 5 axis CNC mill idea thats been sitting in my head the last year
If you got any questions just ask. I'm going to release the full code and circuit once I get my website sorted. I'm still coding that one.