Well, first lets make sure we're on the same page.
Servos come several varieties;
- Most widely known are the R/C hobby servos found in toy cars/boats/planes/etc. These are not as of yet supported. Why? Lack of precision, sloppy coupling to linkages makes them NOT the best choice for CNC control. Will I be including them? Yes, but its low on my ToDo list.
- Linear gear driven servos (aka Linear Actuators), used for load-lifting. (Think powered doors/hatches/jacks/etc.) Slow, powerful and when used with an encoder; are supported. But if you really need 500lbs of table force maybe you should re-compare the build costs vs. a used bridgeport/lathe/something else built for steelworking.
- Pneumatic linear servos, these ulta-fast lightweight actuators are used in many CNC machines today; where speed is more important than strength, one such example would be 'pick and place' machines, used widely in the electronics and packaging industries. Some move faster than the human eye can see. Supported.
- My favorite pick: Machine Servos (with quadrature feedback encoders) have been recently added to my latest version. (Version 0.5) These can even be obtained from the scrap-bin, old pen-based plotters commonly used in 80s/90s era engineering departments. They're quite common once you know to hunt for them. These type of servos work REALLY WELL for CNC machines and bigger units are still in industrial use today. These gems are often just tossed-out of dusty old company store rooms. If you find one, offer to buy it. Chances are they'll give it away for the hauling.
As far as plugging-in your own code. That should be pretty easy, just set your servo code to monitor the targetPos
= X axis position.
There are 9 axis variables. So, targetPos
A great place to put a call to your servo routine would be inside the doUrgentStuff()
That way it will get called as frequently as possible.
The axis list by letter designation are:
- The common: X (left/right), Y(near/far), Z(up/down).
- Less common: A (axial rotation of X), B (axial rotation of Y), C (axial rotation of Z).
- Robot "arms", all of the above plus: U (rotation perpendicular of A), V (rotation perpendicular of B), W (rotation perpendicular of C).