Repstrap using HP840c’s
With the StarLC10 matrix repstrap ending up as pizza plotter, a start has been made building a new 3D machine using only the parts of 3 HP deskjet 840c printers.
The printers contain many useful parts, the casing is made almost entirely out of ABS (printing material, hurray!)
Especially the sliders come in nice, rectangular frame’s which make mounting them easy. For the first tests a frame has been assembled using standard aluminum X-beams (boikon).
Using the cleaner bin (which normally brushes and seals the cartridge) a Z-axis has been made which has at least 8cm of travel:
Arduino-based control of a DC motor using incremental encoder and PID is not much more difficult than controlling a stepper motor. See the wiki for full documentation.
[sourcecode language=”c”]
void setup(){
int oldposition;
Serial.begin(9600);
attachInterrupt(0, encoder, RISING);
pinMode(10,OUTPUT);
pinMode(12,OUTPUT);
setMotor(-150);
delay(50);
while(position!=oldposition) {
oldposition=position;
delay(50);
}
setMotor(0);
position=0;
}
void loop(){
if(millis()>time+1)
{
float setpoint = 1000+400*sin(n/200)+200*sin(n/50); // 1890 positions
float error = setpoint – position;
setMotor((int)(limit((Kp*error + Kd*(error-oldError) + limit((Ki*sumError),antiWindup)),255)));
oldError = error;
sumError+=error;
n++;
time=millis();
}
}
void encoder() {// encoder service routine
if (digitalRead(4)>0) position++;
else position–;
}
void setMotor(int value){ // set PWM of motor, value may range from -255 to 255
if (value>=0) {
digitalWrite(12,LOW);
analogWrite(10,value);
}
if (value<0) {
digitalWrite(12,HIGH);
analogWrite(10,value);
}
}
[/sourcecode]
next up: including the extruder head, interfacing, making connections, shredding abs, making a scrap-2-3mm-wire extruder system, etc.. etc…
Comments