Electronics and Software
Electronics Design
The system consists of three movements:
* Cartesian plane X-Y
* Z plane
* Extruder
Plane X-Y has the configuration CoreXY and uses Gestalts for control.
The Z plane is also controlled through the Gestalts.
The Extruder is controlled by an Arduino Uno board using a Shield for controlling stepper motors.
Firstable, we installed all the Python and Gestalt libraries needed, and tested configuration with Hbot model.
foto?
The Z plane is controlled by the Single Node configuration.
The extruder is controlled using a program that runs from Arduino IDE which is in turn a revolution stepper motor, according to the command received via serial communication, if not modified the order turns again and asks again if you receive a new order.
Command:
'1' - Forward
'2' - Stop
'3' - Backward
Code
//ExtruderControlShield
#include <Stepper.h>
const int stepsPerRevolution = 48; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(100);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
char switchState;
char moveExtruder;
switchState = Serial.read();
moveExtruder = switchState;
Serial.println("Ready to extrude");
// step one revolution in one direction and repeat the
//movement until choose another option
//Option '1': Forward
//Option '2': Stop
//Option '3': Backward
while(moveExtruder == '1'){
Serial.println("Forward");
myStepper.step(stepsPerRevolution);
switchState = Serial.read();
Serial.println(switchState);
if(switchState == '2'){
moveExtruder = '2';
Serial.println("Stop");
}
else{
moveExtruder = '1';
}
}
while(moveExtruder == '3'){
Serial.println("Backward");
myStepper.step(-stepsPerRevolution);
switchState = Serial.read();
Serial.println(switchState);
if(switchState == '2'){
moveExtruder = '2';
Serial.println("Stop");
}
else{
moveExtruder = '3';
}
}
}
Machine Design
For the automatization of the machine we will use the gestalt boards for controlling the stepper motors. Two boards will be used for controlling the 4 stepper motors of the base (2 steppers motors each) and the other to will control the motors for the XY frame. It is important to mention that for in order of one gestalt to control 2 stepper motor you have to move a small potentiometer inside the board. It can be done easily if you have an amperimeter of a electrical source that shows the current absorb by the system. For more information of electrical connections and how to make the fabnet, see the following site
What is significante to show in this section is where are going to be located the gestalt. It was decided to put them at the back of the machine, behind the wall of the base for two main reasons:
1. The cables are hidden in that way
2. The nodes are centralized so the cables are the shortest possible.
The following images exhibit the node places:
The general configuration of the nodes
The two base motor stepper board controller and their connections
Connections of the XY controllers
Extensions were needes. We used dupont cables, but the integrarion was pretty simple.
Now comes to real issue for this... the program for the machine. We had some examples to use as guides and, lucky me, I like to program... By comparing the file examples single_node.py and xy_plotter I could understand what functions were important to change and add more code.
Because we need to control 4 nodes, we change the following definitions:
1. initController: we add 2 more axis for the Z axis.
2. initCoordinate: it was change to ['mm','mm','mm','mm']
3. initKinematics: it is veeeeeery importante because stablish how many motors are goint to be controlled. The line of code kinematics.direct(2) was change to kinematics.direct(4).
With this a calibration program was written. To see how it works please check the next video.
The next issue to solve is to read a csv file were the movements of the machine are goint to be. There are to worthy comments about this coordinates:
1. The origin of coordinates is established when the program runs.
2. Because of the CORE XY configuration, the (X,Y) coordinates need to be transform to (A,B) coordinates. For more information please visit the web site
To read csv files with python is actually very, very, veeeeeeeeery simple. We just import the csv library and put the following commands:
f = open('prueba.csv')
csv_f = csv.reader(f)
Now we have a matrix where every row is a command for the machine.
Finally we develop a program that will read a csv file and move around the working bed. .