You are not logged in.

#1 2016-08-16 14:54:44

Elnagdy
Member
Registered: 2016-08-16
Posts: 2

X-direction Stepper Motor

Hello,

I am using another stepper motor in my printer to move the vat in X-direction during printing. I want the vat to move in one direction immediately before the build platform moves upward and return back before the build platform moves again downward. I wrote two python codes for each movement of the X-direction stepper motor and called one under "Syscall Before Each Layer" and called the other under "Syscall After Each Layer", but it didn't work with the sequence I need. I am not using arduino; only raspberry pi. I would appreciate any advice.

Last edited by Elnagdy (2016-08-16 14:56:57)

Offline

#2 2016-08-16 15:48:23

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: X-direction Stepper Motor

Is your python codes generates movement pulses?

Offline

#3 2016-08-17 12:09:43

Elnagdy
Member
Registered: 2016-08-16
Posts: 2

Re: X-direction Stepper Motor

Yes

this is the code for forward X-direction :

from gpiozero import LED
from time import sleep

pulse=LED(2)
direction=LED(3)

direction.on()
pulse.off()

pulses=0

while(pulses < 50):
    pulse.on()
    sleep(0.004)
    pulse.off()
    sleep(0.004)
    pulse.on()
    sleep(0.004)
    pulse.off()
    sleep(0.004)
    pulses= pulses+1

and the same for backward X-direction except that the direction is reversed

Offline

#4 2016-08-18 06:00:04

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: X-direction Stepper Motor

Before syscall, runs just before start of layer view and after syscall start just after layer view. It is bit hard to implement but you probably could achieve the result you want by forking process and make it wait...

Currently for these case scenarios, people are using GPIOHigh and low keywords with the help of external hardware. One thing which we could add to nanodlp to handle these cases, instead of putting numerous syscalls for different positions is to have net request keyword or syscall keyword as additional gcode command. I am against syscall as it make nanodlp process unreliable.

Offline

#5 2016-08-23 14:27:18

Mahmoud10
Member
Registered: 2016-08-15
Posts: 7

Re: X-direction Stepper Motor

Hello Shahin,
I am working on the same project. As you know, some people use sweeping/tilting mechanisms in their 3d printers in order to get satisfactory outputs.I am fairly new at using the pi, so it is bit difficult to implement this solution. I tried using syscall and it is working fine. If you could just add the syscall (to execute a python code before and after the z platform movement) in your next build, my printer should work as intended, and I would be very thankful for your help. I would try using an arduino if it would solve this problem?

Offline

#6 2016-08-23 14:43:52

Mahmoud10
Member
Registered: 2016-08-15
Posts: 7

Re: X-direction Stepper Motor

This is a video of my printer working. https://www.youtube.com/watch?v=hMzIZhoaJUg
Please note the sequence of the x and z axis movement.

Offline

#7 2016-08-23 16:38:53

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: X-direction Stepper Motor

I will try come up with better solution. Adding lots of new inputs making people new to nanodlp very confused.

Offline

#8 2016-09-12 14:14:14

color
Member
From: Bulgaria
Registered: 2016-03-19
Posts: 84

Re: X-direction Stepper Motor

I am also curious how to connect X stepper motor, but I am using patched mUVe 3D firmware and RAMPS board. Is it possible to control additional stepper motor by just adding G codes for X in printer profile G code section? Or there are something in the firmware which must be changed?

Offline

#9 2016-09-12 16:19:10

Xmike
Member
Registered: 2016-03-25
Posts: 97

Re: X-direction Stepper Motor

@color
I do it that way. I control my X-axis only with G-code and add each to a  [[WaitForDoneMessage]

Offline

#10 2016-09-12 16:35:12

color
Member
From: Bulgaria
Registered: 2016-03-19
Posts: 84

Re: X-direction Stepper Motor

Xmike wrote:

@color
I do it that way. I control my X-axis only with G-code and add each to a  [[WaitForDoneMessage]

Which firmware do you use?

Offline

#11 2016-09-12 19:24:38

Xmike
Member
Registered: 2016-03-25
Posts: 97

Re: X-direction Stepper Motor

Offline

#12 2016-09-13 06:01:18

color
Member
From: Bulgaria
Registered: 2016-03-19
Posts: 84

Re: X-direction Stepper Motor

Thanks Xmike,
Could you post a screenshot of your G code section?

Offline

#13 2016-09-13 18:01:05

Xmike
Member
Registered: 2016-03-25
Posts: 97

Re: X-direction Stepper Motor

Although it is a different issue , but here you can see my G-Codes:
http://www.nanodlp.com/forum/viewtopic.php?id=57

Offline

Board footer

Powered by FluxBB