Results 1 to 9 of 9
-
06-21-2015, 11:35 AM #1
- Join Date
- May 2015
- Posts
- 6
Z axis controlled by stepper motor
I dont know any programming I just picked up a board and I am trying to learn to program it for this use.
Arduino controlled stepper motor for z-axis
(Trying to use arduino UNO)
in short :
1)in setup printer - setup options, turn on the serial driper feature
2)Attach an arduino that listens on the serial port
3)when the arduino recives a 1, turn the motor on and emulate drips on the mic line
4)when the arduino recives a 0 stop the motor and the emulated drips. Maybe?
- Serial Communication (USB)
- 1 from serial communication causes stepper motor to move
- Motor Driver
- Big Easy Driver stepper (sparkfun)
- 1 to 1/16 microstepping
- Nema 17 motor. geared vs non-geareed
- http://www.phidgets.com/
- non geared 200 steps per revolution (1.8 degrees per step)
- or something in between
- 99.51:1 gearbox 20,000 steps per revolution (.018 degrees per step)
- Leadscrew and pitch
- Trapezoid leadscrew from openbuilds
- TR8*8, 8 mm travel distance per revolution of stepper motor
- Without microstepping 8mm/revolution, 200 steps/revolution, or 0.04 mm per step
- With 1/16 microstepping (200*16) or 3,200 steps/revolution, or 0.0025 mm/step
- With 1/16 microstepping and 99.51:1 gearbox 320,000 steps/revolution or 0.000025 mm/step
- Theoretical z axis travel distance 0.000025 mm to 0.04 mm per step
- Ideal travel distance would be 0.01 mm to .1 mm
- With 99.51:1 gearbox 400 steps to travel .01 mm
- With 99.51:1 gearbox 40 steps to travel .001 mm
- Movement would be down .1 mm pause than up .09 mm than pause or what every distance you would want.
- Audio output to peachy program to tell the program current z level is complete
- Use (mic in) on motherboard?
- 5V digital output from arduino board
- Fire laser for given z height than loop cycle
- May not require 0 output from program to restart the arduino
Example Code for Serial CommunicationVoid setup()
{
pinMode(13,OUTPUT); //initiates pin 13 to output digital siginal on or off
digitalWrite(13,LOW); // sets the initial state of pin 13 to off
Serial.begin(9600); //starts the serial communication at baud rate 9600 or whatever baud rate
}
Void loop()
{
If (Serial.available() >0)
{
Char letter = Serial.read();
if(letter == ‘1’)
{
digialWrite(13,HIGH);
}
Else if(letter == ‘0’)
{
digitaWrite(13,LOW);
}
}
}
Instead of having the LED turn on and off it will be the stepper motor movement in its place
// Stepper motor controller for Big Easy Driver
//Declare pin functions on Arduino
const int step_pin = 2; // This PIN pulses the Motor
const int dir_pin = 3; // Tells you what direction to move the motor H or L
const int MS1 = 4; // See Microstep Table
const int MS2 = 5; // See Microstep Table
const int MS3 = 6;// See Microstep Table
const int EN = 7;// See Microstep Table
// //
//////////////////////////////////////////////
//Microstep Select Resolution Truth Table
// MS1 L, MS2 L, MS3 L = Full step
// MS1 H, MS2 L, MS3 L = Half step
// MS1 L, MS2 H, MS3 L = Quarter step
// MS1 H, MS2 H, MS3 L = Eight Step
// MS1 H, MS2 H, MS3 H = Sixtennth Step
// EN H diable and the IC will not drive the motor
// EN L enable allowing motor control
int direction; // Variable to determine the sense of the motor
int steps = 4000; // Number of steps that you want to execute (for 1/16 steps, movement down 0.1 mm)
void setup() {
pinMode(MS1, OUTPUT); // Configures "MS1" as output
pinMode(MS2, OUTPUT); // Configures "MS2" as output
pinMode(dir_pin, OUTPUT); // Configures "dir_pin" as output
pinMode(step_pin, OUTPUT); // Configures "step_pin" as output
digitalWrite(MS1, LOW); // Configures the steps division (see above)
digitalWrite(MS2, LOW); // Configures the steps division (see above)
digitalWrite(dir_pin, LOW); // Sense (HIGH = anti-clockwise / LOW = clockwise) - It can be also changed
}
void loop() {
while(steps>=0) { // While the steps value is greater or equal zero
digitalWrite(step_pin, HIGH); // Sends logic level 'high' to the steps pin of the motor
delayMicroseconds(100); // 1ms = 1000 microseconds
digitalWrite(step_pin, LOW); // Sends logic level 'high' to the steps pin of the motor
delayMicroseconds(100); //100 microseconds = 0.1 ms
steps--; // Decrements the "steps" variable
}
}
I don’t know how to add the change of direction upward to this program and reset the count and to add the digital output to MIC in.
I am assuming you can use a free digital pin and ground for this and pulse it like a LED for a unit of time. OUTPUT from digital pin would be at 5V might need a transistor in the circuit to drop the current.
If anybody has suggestions it would be appreciated.Last edited by littleone; 06-21-2015 at 09:35 PM.
-
06-21-2015, 12:02 PM #2
- Join Date
- May 2015
- Posts
- 6
-
06-21-2015, 12:09 PM #3
- Join Date
- May 2015
- Posts
- 6
-
06-21-2015, 02:09 PM #4
Hey littleone,
As far as I know, they have switched over to a digital circuit and will provide an easier way to report the current height than by emulating drips.
You will probably even get the current height directly.
On question from my side:
How do you want to physically connect the moving platform to the PP?
I haven't yet been able to think of any way to use a stepper motor driven platform with the Peachy setup.
Have a nice day,
quertz
-
06-21-2015, 08:31 PM #5
- Join Date
- May 2015
- Location
- Near Seattle
- Posts
- 23
We've been talking about using an Arduino with peristaltic pump and interrupt sensor, or a fuel injector and pump in the "Mount and Reservoir Discussion" thread. (and there's some other relevant info in the "With two way digital communication what are your modding plans" thread as well.
The digital circuit has enough I/O pins that it could have a pin to signal z level raise directly (when they add that feature in software), and also has a pin for detecting the drips.
Since the Peachy passively detects the drips, you could basically program the arduino to step down at whatever rate you want, and signal drip with each step *(or down-up step sequence). When they get around to adding controlled z level to the peachy software, you could take that as input on a digital pin.
Rylan posted some sample source for simulating drips with an arduino as well. Peachy is designed to be easily modifiable.
-
06-21-2015, 09:35 PM #6
- Join Date
- May 2015
- Posts
- 6
Here is a link to a top down SLA resin printer. Just attach the peach printer to the frame and have it pointed downward. I was thinking of using 2020 aluminum extrusions from openbuilds or another vender.
http://www.instructables.com/id/Litt...proj/?ALLSTEPS
Here is another example of a plywood frame just attach the peach printer on the top of the frame.
http://www.instructables.com/id/Buil...t-Ho/?ALLSTEPS
It would be a lot easier if we could use the rambo board or ramps board and use the existing firmware to control the z axis like Creation Workshop does for DLP resin printers. If that is the direction of the peachy software is going it would make hacking easier for the novice. The Creation Workshop software uses the existing boards to control the z axis and projects the image with a DLP projector as the UV source. There is also another hack using laser shark controller board for controlling a laser galvo system (buy the laser and galvo from china) and the ramps board along with the Creation Workshop software controlling both. If not than someone has to write some code to control the z axis through an arduino and stepper controller. A serial single from the peachy software (USB) or other to arduino to initiate z axis movement and a single back from the arduino that the z axis movement is complete so the laser can fire and cycle the process until the print is done.Last edited by littleone; 06-21-2015 at 09:54 PM.
-
06-23-2015, 11:43 PM #7
- Join Date
- May 2015
- Posts
- 6
// Stepper motor controller
//Declare pin functions on Arduino
const int stp = 2; //
const int dir = 3; // Tells you what direction to move the motor H or L
const int MS1 = 4; //
const int MS2 = 5; //
const int MS3 = 6;//
const int EN = 7;//
//Microstep Select Resolution Truth Table
// MS1 L, MS2 L, MS3 L = Full step
// MS1 H, MS2 L, MS3 L = Half step
// MS1 L, MS2 H, MS3 L = Quarter step
// MS1 H, MS2 H, MS3 L = Eight Step
// MS1 H, MS2 H, MS3 H = Sixtennth Step
// EN H diable and the IC will not drive the motor
// EN L enable allowing motor control
//run once, when the sketch starts
void setup()
{
pinMode(stp, OUTPUT); //sets the digital pin as output
pinMode(dir, OUTPUT); // sets the digital pin as output
digitalWrite(stp, LOW); // sets the initial digital state
digitalWrite(dir, LOW); // sets the initial digital state
}
//run over and over again
void loop()
{
// x steps of motor 5000
for (int x=0; x<5000; x++)
{
digitalWrite(dir, LOW); //change direction of motor
digitalWrite(stp,HIGH); //makes 1 step
delayMicroseconds(100); //wait for 100 microseconds
digitalWrite(stp,LOW); //makes 1 step
delayMicroseconds(100); // wait for 100 microseconds
}
delay(2000); //wait 2 seconds
// x steps of motor 4000
for (int x=0; x<4000; x++)
{
digitalWrite(dir, HIGH); // change direction of motor
digitalWrite(stp,HIGH); //makes 1 step
delayMicroseconds(100); //wait for 100 microseconds
digitalWrite(stp,LOW); //makes 1 step
delayMicroseconds(100); // wait for 100 microseconds
}
delay(5000); wait 5 seconds
}
-
06-24-2015, 11:16 PM #8
- Join Date
- May 2015
- Posts
- 6
This simple program seems to work
// Stepper motor controller
//Declare pin functions on Arduino
const int stp = 2; //
const int dir = 3; // Tells you what direction to move the motor H or L
const int MS1 = 4; //
const int MS2 = 5; //
const int MS3 = 6;//
const int EN = 7;//
//Microstep Select Resolution Truth Table
// MS1 L, MS2 L, MS3 L = Full step
// MS1 H, MS2 L, MS3 L = Half step
// MS1 L, MS2 H, MS3 L = Quarter step
// MS1 H, MS2 H, MS3 L = Eight Step
// MS1 H, MS2 H, MS3 H = Sixtennth Step
// EN H diable and the IC will not drive the motor
// EN L enable allowing motor control
//run once, when the sketch starts
void setup()
{
pinMode(stp, OUTPUT); //sets the digital pin as output
pinMode(dir, OUTPUT); // sets the digital pin as output
digitalWrite(stp, LOW); // sets the initial digital state
digitalWrite(dir, LOW); // sets the initial digital state
Serial.begin(9600); //starts the serial communication at baud rate 9600
Serial.flush(); // clears up any communication through serial port which was left before
pinMode(13, OUTPUT); //example of MIC out siginal
digitalWrite(13,LOW);
}
void loop()
{
if(Serial.available() > 0)
{
char letter = Serial.read();
if(letter == '1')
{
//x steps of motor 10,000 steps
for (int x=0; x<10000; x++)
{
digitalWrite(dir, LOW); //change direction of motor
digitalWrite(stp,HIGH); //makes 1 step
delayMicroseconds(100); //wait for 100 microseconds
digitalWrite(stp,LOW); //makes 1 step
delayMicroseconds(100); // wait for 100 microseconds
}
delay(2000);
// x steps of motor 4,000 steps
for (int x=0; x<4000; x++)
{
digitalWrite(dir, HIGH); // change direction of motor
digitalWrite(stp,HIGH); //makes 1 step
delayMicroseconds(100); //wait for 100 microseconds
digitalWrite(stp,LOW); //makes 1 step
delayMicroseconds(100); // wait for 100 microseconds
}
digitalWrite(13, HIGH); //example of MIC out siginal
delay(5000); //output for MIC OUT for 5 secs
digitalWrite(13,LOW); // turns off the MIC OUT
Serial.flush();
}
else if(letter == '0')
{
digitalWrite(stp,LOW); //
Serial.flush();
}
}
}
-
07-05-2015, 04:49 PM #9
- Join Date
- Sep 2013
- Posts
- 308
Hey littleone
Great thread!
We will definitely make sure there is an easy way to do what you are trying to accomplish.
in fact a while ago I built a similar setup. I built a rather large stepper controlled z printer.
The hardware is done now but ive never printed with it, and the code iv written is rather unfinished, all it dose right now is find home via a limit switch.
When I have it all set up and working ( which may be quite some time from now)
I will be sure to post everything, but for now know that your far from alone on this hack, many including me will join your efforts.
Here is a pic of my stepper z Axis printer:
IMG_3619.jpg
Holes and pockmarks in print walls
06-04-2024, 09:14 AM in General 3D Printing Discussion