Saturday, January 02, 2010

CNC SPEED Control

Since then we talk about accurate control multiple axis, we should remember that all axis speed get together based in pitagoras equation in simple orthogonal system (XYZ system). Based in simple 3 axis in orthogonal system (90°), each one running at 30mm/sec, the final speed can be calculed as SRQT(X^2+Y^2+Z^2) and must be aprox. 51,96 mm/s. That is just a exemple... but show that the final speed must be corrected in all axis in a sincronized way.
So if you control just indidually each axis, you dont get the right speed.

Based in this "problem" I made a "algoritm" to control the final speed for use with simple microcontroller.
I think that was solved by many commercial and free softwares already, but for my CNC, i appreciate implement it.
It generate 4 simple data that can be user by any microcontroller easyly with fixed math to controll accurately the speed of all axis for each line it process, getting always the right speed for final movement as desired, and based in clock that microcontroller will drive the motors (INT clock!). I implement the initial idea using excel; so as I align and clean everything in the file, I will put the excel file here with formulas.
By the moment I just show to you the most precisous part of project.
The schematic of all thing! Its a huge image(3000 x 1500 px), so be patient!


I blend portuguese and english, but all we are smart enough to get the right understanding.
Basically, I get all the XYZ real data, and process it to get the the accurate speed and shift values. Green boxes represent the input data, by user or by stream of line to be processed. Blue boxes represents the simple data to be send to microcontroller. As inexpensive microncontroller work nice with fixed math, and there are lots of code for fixed math, its much more easy to use it, I make everithing thinking in that way. The output of algoritm use a fixed floating point for control each axis, based in microcontroller interrupt CLOCK, and with a Npassos amount of steps to be run by clock. I make the reverse calculus in Excel, based in rounds that pic will execute, to see if everything runs nice. The final data show great, with little error. Since we use more that 4 decimal places behind the dot. (0.xxxx)
The system to admits that we can use variable size step motors and variable speed reduction for each axis (like the screews of diferrent kinds). The final speed, given right values, will be garanted.
I dont make a analisys to get the MAX final speed supported by the system.
BUT have in mind, the X || Y || Z OUTPUT DATA must never be great that ONE; if this happen, some are wrong...
the desired speed are to HIGH for the choice CLOCK; you must put higher CLOCK (but you can get problems with frequency suported by your steep motors, it can hung); or you have to use a more fast XYZ transfer axis(screew); or fast step motor with little steps per revolution. It's your choice.
By now are too hot here, and I have to lunch. Soon as possible I will post the remaind of project.

No comments: