Welcome! Log In Create A New Profile

Advanced

SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP

Posted by jolipe 
SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 26, 2012 07:46PM
I got a professional x,y,z system including industry stepper drivers and a PCI stepper control card. So I want to build a 3D printer out of it.
I will not use the PCI card, instead I want to integrate an Arduino board driven by Sprinter firmware.
I don't need any stepper drivers on the arduino shield since stepper drivers are already included in the system I got.

BUT: I have to change the function of 2 I/Os: DIR has to be CW+ while STEP has to be CCW+ (For x,y and z)

Can someone give me a hint which parts of the firmware has to be changed ?

THx, Jo...
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 27, 2012 07:30AM
The code in sprinter.pde, function ISR(TIMER1_COMPA_vect) toggles the STEP and DIR bits. You will probably also need to increase the pulse length for external drivers.
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 27, 2012 06:43PM
Thank's Bobc,

that was exactly what I was searching for...
If successfull I will post the changes I've made to make it easier to use CW/CCW stepper drivers with Sprinter firmware.

greetz Jo..
VDX
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 28, 2012 04:53PM
Hi Jo,

check you data - CW or CCW are only the subscriptions for DIR+/- with "ClockWise" and "CounterClockWise" ... the STEP signal should be named CLK or CLCK for Clock.

I've done the same with my Isel-CNC-controller and a GEN3 and later with an RAMPS replacing the PC-interfacecard without any changes in the firmware ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 28, 2012 08:47PM
VDX Wrote:
-------------------------------------------------------
> Hi Jo,
>
> check you data - CW or CCW are only the
> subscriptions for DIR+/- with "ClockWise" and
> "CounterClockWise" ... the STEP signal should be
> named CLK or CLCK for Clock.
>
> I've done the same with my Isel-CNC-controller and
> a GEN3 and later with an RAMPS replacing the
> PC-interfacecard without any changes in the
> firmware ...

We should really ask the OP what stepper driver is being used, and if it has a data sheet. While researching my answer, I found drives with CW and CLK pins, being the same as DIR and STEP. However I also found a driver with CW and CCW pins, with the description that a pulse on CW steps clockwise, and a pulse on CCW steps counter-clockwise. Never seen that before, but clearly they are out there.

So I was assuming that the OP understands his driver correctly, even if I had never seen such a setup before.
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 29, 2012 04:32PM
Hi Bobc, Hi Viktor

first, thank's for your thoughts on my problem.

I spent quite some time to find an english documentation on the stepper drivers used in the X,Y,Z system I want to use, but since all parts are japanese it's hard to find readable datasheets or even any useful information.

Background: The x,y,z system is an old acoustic scanning microscope from Honda. It's in a perfect shape and all axis working well using the PCI card on Win98. But like I said I want to change to arduino due to all the existing open source software for 3D printing.

Below you find the stepper drivers used in the System:
x,y axis drivers are from melec-inc.com. The unit is called PD-5420 (it's old, but I don't care.) The datasheet is only available in japanese and I could not find any hint for a switch changing the stepper mode from CW/CCW to STEP/DIR. (Newer models of Melec-Inc have such a kind of switch to change the mode).
-> That's why I believe I have to change the firmware or build a simple logic circuit which translates STEP/DIR to C"/CCW mode (I will go for the software change).

z axis driver is from oriental motors...this one has a switch to change stepper mode, so I have nothing to develop for z....

If anybody can proof me wrong and finds a way how to switch the PD-5420 into STEP/DIR mode it's much appreciatedwinking smiley

at the moment I have to wait for all electronic parts, as soon as I have received them I will give an update here if I could make the system move on arduino/sprinter

Jo...
VDX
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 29, 2012 05:43PM
... bobc's assumption seems to be correct - you need a small logic for routing the STEP pulse to CW or CCW depending on HIGH or LOW of the DIR pin ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 30, 2012 07:20AM
Quote

If anybody can proof me wrong

Well, simply try. You can create step pulses by hand easily, just repeatedly touch the pin with a wire connected to 5V.

At least in Teacup firmware, changing the logic to use two Step signals would be possible. Steps are done with x_step(), y_step(), ... and direction changes with x_direction(), .... Both are defined in pinio.h. So, your task would be to make x_direction() changing the pin mapping of x_step() instead of changing a pin value.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
December 31, 2012 05:58PM
It's certainly possible by modifying code, but if it were me I'd just add a little logic in front of the drivers and do it in hardware, that way you can switch between firmwares without hacking each one. You could just get two 2-input and gates, and an inverter, and wire the outputs of the and gates to the CW and CCW wires, wire the step pin to one input of each gate. Then wire the dir pin to one of the and gates directly, and to the other through the inverter.

The processor is pretty limited for fast stepping I think, so be very careful if you choose the software approach to waste as few cycles as possible.
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
February 24, 2013 05:19PM
Long time no see....

Just to close this topic, I wanted to thank Bobc for his initial thoughts. I agree to James suggestion doing it in hardware has advantages, on the other hand I only had to change three lines of code in the ISR to change marlin firmware to cw/ccw mode and increase the pulse length so the stepper drivers didn't ignore the quite short pulses marlin sends.
The system is working fine, if anybody runs into the same issue, drop me a message and I can send the changes I made.

Regards Jo...
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
March 22, 2013 03:19PM
Arduin uploader says Sprinter sketch Has Error. and it is a Stock Sketch Downloaded from Get Hub..... Any Idea how I could get my Arduino to except a new Sprinter Sketch?? My stock one is Attached.
Version 1.0.4 of Arduino says there is an Error even though I know there is not one... my Arduino Mega 2560 Works ok but I still need to fine tune Again since I switched Nozzels I need to Reset my Extrusion steps per MM.
Has the chip had it or is it somthing I am doing wrong? also I would like to know it it is possible to Download the Sketch from the Arduino Mega 2560 chip and convert it Back to a Script from Binary code and Modify......
Attachments:
open | download - Sprinter-130321a.zip (113.4 KB)
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
August 21, 2014 10:21AM
Please Jo, I have the same problem... can you help me?.
Regards.
Gus.
Re: SPRINTER: Use CW+/- and CCW+/- instead of DIR/STEP
March 25, 2020 03:40AM
Hi Jolip

Please learn us how to you do it.
I have stepper driver with CW/CCW pins vs STEP/DIR.
I would like to modify the GRBL code to use my own stepper's driver.
I know that I have to modify the function "ISR(TIMER1_COMPA_vect)" in sprinter.pde, but I dont know how can I do it.
Please help me.

Thank you
Sorry, only registered users may post in this forum.

Click here to login