Welcome! Log In Create A New Profile


Changing the direction of a motor

Posted by v1talogy 
Changing the direction of a motor
March 05, 2018 07:23AM
Hello fellow reprappers,


tl;dr - Problem solved, incorrect post.

I had a problem with changing the direction of a stepper motor. I was using firmware provided by the Lyman/Mulier project for filament extrusion on Thingiverse: [www.thingiverse.com].

The firmware used is based on the Marlin FW, and the motors responded as per Marlin configuration. After closer inspection I noticed that the stepper driver files are different. It is not the same as the original
Marlin FW. Then, after some more debugging I managed to solve this problem. Because it is a different FW varaition I will not add my solution here. It will be a lengthy explanation.

Apologies for the incorrect post.


I am working on a project where I am using the RAMPS1.4 board with marlin FW. One of the features I want to use is to drive a stepper motor (NEMA17) with a standard Stepstick or DRV8825 driver.
This I have achieved.

My problem is, I am not able to change the direction of the motor. I do not mean only once, I mean that I want to regularly change the direction of the motor. I thought I would be able to do this using the DIR pin on the driver itself, by just
pulling the pin high or low. But this does not seem to work. What I think it happening is that the direction as set in the Configuration.h file is overriding any changes I attempt to make while the program is running.
Is my thinking correct?

So for example, if I change this boolean:
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false

to true of false, the direction of the motor changes. But it remains in either of those directions at all times sad smiley

If I set this:


to any of the two values while the program is running, nothing happens. I have confirmed that the pin allocation is correct, at least as far as I can tell. I use the same pin as E0_DIR_PIN, which would be pin 28 for a MOTHERBOARD 34.

Do any of you know it it is possible to change the direction of the motor while the FW is running? I will not be sending the FW any GCODE, so I can not just send negative command to achieve this, ie "M92 X-160".

REV_E_DIR(); does not work either, although I am not entirely sure how that works.

Any advice would be appreciated.

Edited 2 time(s). Last edit at 03/05/2018 01:28PM by v1talogy.
Sorry, only registered users may post in this forum.

Click here to login