Pwdr / Pwdr-Model-0.1

A powder substrate rapid prototyping machine
131 stars 68 forks source link

Stepper Motors #20

Open Builder123 opened 11 years ago

Builder123 commented 11 years ago

I mistakenly purchased 1.9 degree stepper motors for the x and y axis. As such, I'm having trouble getting the gantry to move properly with the code as it is written (gantry crashes into the sides when attempting to print, gantry crashes into side of machine when returning to start position) Since my step angle is twice of that used in the Pwdr, I know that I must make changes to the Pwdr code below, but am not extremely savvy with coding.

Can someone kindly educate me as to what, for example, "StepX = 21" means in terms of actual distance traveled? Does the '21' indicate the number of steps? If so, would 21 steps translate to a distance traveled of 21*(.0943396mm)?

I also have a question regarding how the physical 'y' distance of the machine is defined in the above code.

Any suggestions would be greatly appreciated.

" // Size of steps for stepper motors const int stepX = 21; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepY = 500; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepZ = 95; // 0.1mm per full stap (10*0.01)

// Size of steps when jogging const int jogStepY = 1000; const int jogStepX = 500; const int jogStepZ = 250;

// Size of machine in steps. Type long because number of steps > int (2^15) const long build_piston_width = 11000/stepX; //2000/stepX; // total width: 14800 const long build_piston_length = 28000/stepY; // total length 76000 const long distance_roller_nozzle = 34000;
const long piston_depth = printfilesize[2]; // The depth of the part is defined by the preprocessor const long build_piston_end_stop = 76000; // Absolute end of the machine "

Pwdr commented 11 years ago

The stepX is the distance the gantry makes during printing when it moves one step (printer step, not stepper step) in the X direction. In your case, this value should be 10 (21/2).

The length of Y is split into a number of values; the buid_piston_length, distance_roller_nozzle, build_piston_end_stop, which should all be divided by 2 for your machine.

BTW, you're using the 'old' firmware. Firmware 2.0 is a bit more stable and offers real 3D printing.

On Tuesday, April 2, 2013 at 07:16 , Builder123 wrote:

I mistakenly purchased 1.9 degree stepper motors for the x and y axis. As such, I'm having trouble getting the gantry to move properly with the code as it is written (gantry crashes into the sides when attempting to print, gantry crashes into side of machine when returning to start position) Since my step angle is twice of that used in the Pwdr, I know that I must make changes to the Pwdr code below, but am not extremely savvy with coding.
Can someone kindly educate me as to what, for example, "StepX = 21" means in terms of actual distance traveled? Does the '21' indicate the number of steps? If so, would 21 steps translate to a distance traveled of 21_(.0943396mm)? I also have a question regarding how the physical 'y' distance of the machine is defined in the above code. Any suggestions would be greatly appreciated. " // Size of steps for stepper motors const int stepX = 21; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepY = 500; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepZ = 95; // 0.1mm per full stap (10_0.01)
// Size of steps when jogging const int jogStepY = 1000; const int jogStepX = 500; const int jogStepZ = 250;
// Size of machine in steps. Type long because number of steps > int (2^15) const long build_piston_width = 11000/stepX; //2000/stepX; // total width: 14800 const long build_piston_length = 28000/stepY; // total length 76000 const long distance_roller_nozzle = 34000;

const long piston_depth = printfilesize[2]; // The depth of the part is defined by the preprocessor const long build_piston_end_stop = 76000; // Absolute end of the machine "

— Reply to this email directly or view it on GitHub (https://github.com/Pwdr/Pwdr-Model-0.1/issues/20).

Builder123 commented 11 years ago

Thank you for the quick reply. I divided the above variables by 2 as suggested. However, when I attempt to print I'm having an issue. I first manually position the XY carriage to the far end of the machine (far end opposite of the 'Y' motor and closest to the end that catches the excess powder). The X axis is positioned all the way to the opposite end of the 'X' motor. When I load the GUI and click print, the machine immediately starts to print without centering the X axis, so the cartridge ends up printing against the top corner of the machine (not centered on the powder bin). After the machine prints the first layer like this, it will deposit a new layer and continue printing at the opposite end of the machine (the fill chamber). The machine also continues to try to move the gantry further than it should when spreading the new layer.

Any ideas? The only changes I made to the firmware were to the variables as suggested above. I appreciate your time.

Pwdr commented 11 years ago

To start printing, move the carriage in that corner and then push 'initial position' in the software, the machine will then move to the correct position above the building bed.

On Saturday, April 6, 2013 at 04:34 , Builder123 wrote:

Thank you for the quick reply. I divided the above variables by 2 as suggested. However, when I attempt to print I'm having an issue. I first manually position the XY carriage to the far end of the machine (far end opposite of the 'Y' motor and closest to the end that catches the excess powder). The X axis is positioned all the way to the opposite end of the 'X' motor. When I load the GUI and click print, the machine immediately starts to print without centering the X axis, so the cartridge ends up printing against the top corner of the machine (not centered on the powder bin). After the machine prints the first layer like this, it will deposit a new layer and continue printing at the opposite end of the machine (the fill chamber). The machine also continues to try to move the gantry further than it should when spreading the new layer. Any ideas? The only changes I made to the firmware were to the variables as suggested above. I appreciate your time.

— Reply to this email directly or view it on GitHub (https://github.com/Pwdr/Pwdr-Model-0.1/issues/20#issuecomment-15989541).

Builder123 commented 11 years ago

That worked. Thank you. However, when I start the print, it doesn't appear to be printing correctly. For example, when I hit 'Print' after clicking 'initial position', the 'X' axis begins to move as it should but no ink comes out at during the first few steps. Eventually ink starts to come out but it appears to only be printing part of the image. Any idea what would cause ink to not come out of the nozzles initially? Also there are small (~1mm) gaps between each 'swipe' of the ink cartridge All nozzles are getting the correct voltage. Appreciate the continued assistance. Thanks again.

Pwdr commented 11 years ago

Mmm, could you post an image of the print result and the stl file?

The gap between 'swipes' can be adjusted by lowering the StepX a bit more. Or are there missing nozzles?

On Saturday, April 6, 2013, Builder123 wrote:

That worked. Thank you. However, when I start the print, it doesn't appear to be printing correctly. For example, when I hit 'Print' after clicking 'initial position', the 'X' axis begins to move as it should but no ink comes out at during the first few steps. Eventually ink starts to come out but it appears to only be printing part of the image. Any idea what would cause ink to not come out of the nozzles initially? Also there are small (~1mm) gaps between each 'swipe' of the ink cartridge All nozzles are getting the correct voltage. Appreciate the continued assistance. Thanks again.

— Reply to this email directly or view it on GitHubhttps://github.com/Pwdr/Pwdr-Model-0.1/issues/20#issuecomment-16002959 .

Builder123 commented 11 years ago

Image of the print result is below. I'm attempting to print the letter 'A'. I'll have the stl uploaded in a minute. Thanks!

IMAG0932

Builder123 commented 11 years ago

Here is the stl file I'm using: http://www.filedropper.com/letterameshlab

Builder123 commented 11 years ago

Here is the edited firmware code I'm working with:

// SD card information File dataFile; int chipSelect = 53;

// Initilize stepper driver, 11 Direction and 12 Step AccelStepper stepperX(1, 35, 34);
AccelStepper stepperZ2(1, 47, 46); AccelStepper stepperY(1, 49, 48); AccelStepper stepperZ1(1, 41, 40); // Watch out, this one is wired different! AccelStepper stepperR(1, 44, 45);

// Stepper speed and accelaration float stepperMaxSpeed = 20000.0; float stepper_R_MaxSpeed = 22000.0; float stepperMaxAccelaration = 1000000.0;

// Size of steps for stepper motors const int stepX = 10; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepY = 250; // 0.09433962264 mm per step (5_9.6mm_PI/1600) const int stepZ = 120; // 0.1mm per full stap (10*0.01)

// Size of steps when jogging const int jogStepY = 1000; const int jogStepX = 500; const int jogStepZ = 250;

// Size of machine in steps. Type long because number of steps > int (2^15) const long build_piston_width = 5500/stepX; //2000/stepX total width: 14800 const long build_piston_length = 14000/stepY; // total length 76000 const long distance_roller_nozzle = 1000;
const long piston_depth = pwdrconfig[3]; // The depth of the part is defined by the preprocessor const long build_piston_end_stop = 18000; // Absolute end of the machine

// Variable for positioning long jogvar = 0; long jogvar2 = 0;

void setup(){

// Push button pinMode(5, INPUT); // LED pinMode(13, OUTPUT); // Pull up transistor pinMode(14, OUTPUT); // SPI pinMode(53, OUTPUT);

// Initilize the ink pins (22 to 33) and stepper pins (44-53) for (int i=22; i<=53; i++) { pinMode(i, OUTPUT); }

Builder123 commented 11 years ago

I tried using the first version of the PWDR firmware (with the pre-loaded print data) and was successful at getting the circle to print. So it must have something to do with the new GUI and or my STL files.

With the V3 GUI, I can get most stls to convert (after first importing them and re-exporting them in Meshlabs) with the stock settings (width = 120, heigh = 120, scale = .2), but as shown above, they do not print correctly (no ink coming out during the first 5-6 swipes of the cartridge). I was thinking that maybe the issue has to do with the settings tab (scale, width, height). However, when I attempt to change anything other than the scale, the model will not convert (program crashes with an "arrayindexoutofbounds" error).

Also was wondering what the "width" and "height" settings actually represent. Do they represent the width and height of print area?)

Any ideas? Appreciate your time.

Builder123 commented 11 years ago

Below is a picture of the print result using the version 1 firmware with the pre-loaded print data files.

IMAG0935

Pwdr commented 11 years ago

Looks like the wiring is not correct. It's printing some sections upsidedown.

On Monday, April 8, 2013 at 02:24 , Builder123 wrote:

Below is a picture of the print result using the version 1 firmware with the pre-loaded print data files.

— Reply to this email directly or view it on GitHub (https://github.com/Pwdr/Pwdr-Model-0.1/issues/20#issuecomment-16027659).

Pwdr commented 11 years ago

Do the first couple of swipes really contain any print information? Otherwise, the cartridge seems to be blocked. Try a new cartridge or clean the nozzles. You mentioned that the voltage was correct?

On Monday, April 8, 2013 at 02:11 , Builder123 wrote:

I tried using the first version of the PWDR firmware (with the pre-loaded print data) and was successful at getting the circle to print. So it must have something to do with the new GUI and or my STL files. With the V3 GUI, I can get most stls to convert (after first importing them and re-exporting them in Meshlabs) with the stock settings (width = 120, heigh = 120, scale = .2), but as shown above, they do not print correctly (no ink coming out during the first 5-6 swipes of the cartridge). I was thinking that maybe the issue has to do with the settings tab (scale, width, height). However, when I attempt to change anything other than the scale, the model will not convert (program crashes with an "arrayindexoutofbounds" error).
Also was wondering what the "width" and "height" settings actually represent. Do they represent the width and height of print area?) Any ideas? Appreciate your time.

— Reply to this email directly or view it on GitHub (https://github.com/Pwdr/Pwdr-Model-0.1/issues/20#issuecomment-16027461).

MatthiasWM commented 11 years ago

Print twelve individual lines, one from each nozzle. Once you know which bit controls what nozzle, sort them correctly and make a lookup-table in your software that converts a 12 bit word into the correct 12-bit word.

Builder123 commented 11 years ago

Sure enough, the layers are printing upside down. I was able to resolve with the above suggestions. Thank you.

The voltage going to the nozzles is correct. The problem seems to be with scaling/width/height adjustments. I think that the slice is printing too small due to the fact that I cannot change scaling from the default .2 and also adjust the width/height with the GUI locking up on me (shows as an array out of bounds error when I run directly from the Processing environment). The same stl files will convert if I leave all the default settings in place (.2 scale, width/height = 120).

Have any ideas why the GUI would lock up when changing these settings?

Pwdr commented 11 years ago

That shouldnt happen. Have you tried small increments? When this doesnt work, please try a simple stl file, for example a cube.

On Tuesday, April 9, 2013 at 05:24 , Builder123 wrote:

Sure enough, the layers are printing upside down. I was able to resolve with the above suggestions. Thank you. The voltage going to the nozzles is correct. The problem seems to be with scaling/width/height adjustments. I think that the slice is printing too small due to the fact that I cannot change scaling from the default .2 and also adjust the width/height with the GUI locking up on me (shows as an array out of bounds error when I run directly from the Processing environment). The same stl files will convert if I leave all the default settings in place (.2 scale, width/height = 120). Have any ideas why the GUI would lock up when changing these settings?

— Reply to this email directly or view it on GitHub (https://github.com/Pwdr/Pwdr-Model-0.1/issues/20#issuecomment-16092133).