Changing motor direction with 1XD board external driver stepper
-
Hello,
I am having trouble changing the motor rotation direction that is connected to a 1XD board. The motor is bolted to a linear actuator (for a piston type extruder). The motor can move in both direction (when clicking "retract" and "extrude" button). The problem is that the "extrude" button makes the linear actuator goes backwards instead of foward.
I did try changing the S parameter in the M569 line from S0 to S1, but it doesn't change the motor rotation. The motor is a Stepservo TXM24S-1EG from Applied Motion. See below the drive section of the config.g file.
; Drives
M584 X0 Y1 Z2 E3:4
M569 P0.0 S1 ; physical drive 0.0 goes forwards
M569 P0.1 S1 ; physical drive 0.1 goes forwards
M569 P0.2 S1 ; physical drive 0.2 goes forwards
M569 P121.0 S0 R0 ; change enable polarity, active = disable driv
M569 P121.0 T7:7:7:7
M569 P0.3 S1 ; physical drive 0.3 goes forwards
M584 X0.0 Y0.1 Z0.2 E121.0:0.3 ; set drive mapping
M584 P3 ;show 3 axis
M350 E1 I0 ; configure microstepping without interpolation
M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
M92 X200 Y200 Z200 E3227.14:60.00 ; set steps per mm
M566 X1200.00 Y1200.00 Z1200.00 E100.00:1200.00 ; set maximum instantaneous speed changes (mm/min)
M203 X18000.00 Y18000.00 Z18000.00 E6000.00:20000.00 ; set maximum speeds (mm/min)
M201 X2000.00 Y2000.00 Z2000.00 E100.00:1000.00 ; set accelerations (mm/s^2)
M906 X2000 Y2000 Z2000 E800:1680 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeoutI don't understand why the S parameter works for the printer's XYZ axis but not for the extruder.
Olivier
-
@omiclette you've got 2 M569 lines for the same driver. it might be overwriting it with a default value. I suggest you merge the T timings with the line above e.g.
M569 P121.0 S0 R0 T7:7:7:7
-
@jay_s_uk Thanks for your response. I just tried merging the two lines together, but it still does the same thing.
-
I'm going to guess that the DIRection line from the Duet to the motor controller is not hooked up properly.
Can you describe how it's hooked up and maybe show images of the connectors?
-
@alankilian I will post an image shortly. I don't think the connection is wrong since the motor can turn in both direction. The problem is that reversing the motor direction using the S parameter doesn't work...
-
-
@omiclette I agree if the motor runs both way then its probably not a wiring issue.
What is reported when you send M569 P121.0 from the console (it should say if the driver runs forward or in reverse). then send M569 P121 S1 to reverse it (assuming you have it as in the config.g snippet above), then send M569 P121 again to report the new value. it should say its now in reverse. If that works see if the extrude and retract now work as expected.
-
@t3p3tony said in Changing motor direction with 1XD board external driver stepper:
M569 P121.0
So with the following line in config.g file :
M569 P121.0 S0 R0 T7:7:7:7 ; change enable polarity, active = disable driv
This is what is reported from M569 P121.0 :
I have just noticed that the step timing is somewhat wrong, I don't know why it doesn't stay 7:7:7:7 us.If I change for S1, I get this :
In both cases (S0 and S1), the "retract" jog command makes the actuator go in the direction to extrude and the "extrude" jog command makes the actuator go in the direction to retract.
Also, when I make changes in config.g, I need to shut down and turn back on the power of the Duet 3 6HC for the Stepservo to move. I don't understand why...
-
@omiclette post an output of M122 B121
-
@jay_s_uk said in Changing motor direction with 1XD board external driver stepper:
M122 B121
M122 B121
Diagnostics for board 121:
Duet EXP1XD firmware version 3.3 (2021-06-15 16:12:29)
Bootloader ID: SAMC21 bootloader version 2.0 (2020-10-15b1)
Never used RAM 5568, free system stack 2789 words
Tasks: Move(notifyWait,0.0%,153) HEAT(delaying,0.0%,117) CanAsync(notifyWait,0.0%,64) CanRecv(notifyWait,0.0%,77) CanClock(notifyWait,0.0%,64) MAIN(running,96.5%,443) IDLE(ready,0.0%,41) AIN(delaying,3.4%,142), total 100.0%
Last reset 00:03:42 ago, cause: power up
Last software reset data not available
Driver 0: position 0, 80.0 steps/mm, steps req 0 done 0
Moves scheduled 0, completed 0, in progress 0, hiccups 0, step errors 0, maxPrep 0, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0
Peak sync jitter 0/5, peak Rx sync delay 573, resyncs 0/0, no step interrupt scheduled
VIN: 23.1V
MCU temperature: min 24.2C, current 24.4C, max 24.7C
Ticks since heat task active 80, ADC conversions started 111411, completed 111411, timed out 0, errs 0
Last sensors broadcast 0x00000000 found 0 85 ticks ago, loop time 0
CAN messages queued 20, send timeouts 0, received 2016, lost 0, free buffers 37, min 37, error reg 0
dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 0 -
@omiclette said in Changing motor direction with 1XD board external driver stepper:
I have just noticed that the step timing is somewhat wrong, I don't know why it doesn't stay 7:7:7:7 us.
These are the timing values that are actually used, they are the closest ones possible on the 1XD larger than the one specified. They don't match exactly due to the requirement of a multiple of clock cycles to be between step/dir outputs.
as an aside you can just send the command in the console (e.g. M569 P121.0 S1) to test the differences, no need to upload config.g each time.
Can you try using G1 E10 F300 (feel free to substitute different movement amount and feedrate speed to suit your setup) and see if the direction change in M569 still makes no difference when sending G1 instead of using the UI.
-
@t3p3tony Thanks for the tip! When sending a G1 E20 F1000, the motor does change direction when M569 P121.0 S1 or M569 P121.0 S0 is sent. It appears that it is the UI that does not follow the S parameter changes.
-
@chrishamm any ideas here? the extrude/ retract buttons appear to be compensating for the change in M569 S0/1 for the extruder motor so the direction can't be changed.
@Omiclette can you confirm the firmware version you are running on the main board and the 1XD:
M115
M115 B121Also see in DWC what version that is.
Also if you can upgrade to 3.4b7 on both, and upgrade DWC at the same time that would be good.
-
@t3p3tony said in Changing motor direction with 1XD board external driver stepper:
M115
Ok I will try updating to 3.4b7 at the end of the day. -
@t3p3tony Hello, I just did the firmware update to 3.4b7. Changing the S parameter from S0 to S1 now changes the rotation direction of the motor controlled by the 1XD board. Thank you for your help, the issue is solved.
-
-