This should explain the main functions of the Mill.
The axis description is realized by applying the (machinery) “right hand rule”:
*positive x axis is from the left to the right
*positive y axis is from the front to the back
*positive z axis is from the bottom to the top
The hardware setup:
-the Tetrix controllers are plugged in at NXT port 1
-z axis motor is on the first controller
-x&y axes are on the second controller
On every axis we have a LEGO encoder
x: NXT port 2
y: NXT port 3
z: NXT port 4
x&y have additional Tetrix encoders.
The LEGO encoders are mainly for the safety-control.
Then on the software site we have also 2 different types of vis: the difference is between the encoder type (Lego or Tetrix).
At first, I only worked with the Lego encoders, because I wanted to spend less money as possible. But after a while, I wanted to find out if the mill would be working better with higher resolution encoders. The second cause to use Tetrix encoders was to use the constant speed mode on the Tetrix vis.
At the beginning, I measured the “power to speed curve” of the motors and approximate a mathematical curve to this curve. I was able to run the motors in a proportional way so that the motions are getting smoother. About this proportional controller you can read in an earlier post.
With the Tetrix encoders the speed control is easier to manage, because the vi has the constant speed mode with allowed you to run the motors at the exact speed you need.
With the Tetrix encoder you can run the motors in two different ways: distance move or read the encoder like the Lego encoders. The main problem of the distance vi is that the controller tries in alternating the directions to reach the real encoder positions until the watchdog (which one you can setup manually) cut the motors off. This is very annoying so I decided to write the vis like the Lego encoders.
After hitting several times the borders or the end of one axis, I wrote a safety program. This program allows the different axis only to run in a box of 4"x 4"x 2". This box is controlled by the Lego encoders, which are very good for this job, because you cannot reset them during the program. The program has to run if you want to move an axis; flags control this. You have to start each time at the initial position, which is at the left for side point on the desk and at the maximum height. On the front panel of the safety program is a back to initial position switch, hitting this button the mill goes back to the beginning point.
The border control switch is, if you have to run to a position, which is out of the safety box, you have to push this button; if not the safety program is running back to his initial position.
After running the safety program you can start the B-code or the manual move vi.
This program is similar to the G-code (CNC programming) only that it is written in a spreadsheet and not text-like.
You have 7 fields to fill in: x;y;z;r;a1;a2;power.
X,y and z are the different axis in the desired inch length; r is the radius (also in inch) of the desired circle and a1 and a2 are the begin and end angle if you want an arc.
All the axis have to be 0 if you want to draw an arc or a circle. A positive radius gives you the arc in clockwise direction and the negative radius in counterclockwise.
You can combine the different programs with "build an array" like you want. Here is an example of the program “draw a circle” and above CEEO. Don't forget to choose "concatenate Inputs" on the "build an array" vi.
With setting up the flag #1 the mill move back to the initial positions.
This is the movie of the program above.
No comments:
Post a Comment