M569 config.g help for 6XD and external drivers
-
I thought I'd give closed loop motors on the Duet 3 6XD a try. I just built the machine and have started working on the firmware though this flu might keep me from the workshop for now.
I have installed Lichuan LC60H2102 Nema 24 1000ppr closed loop motors with LDCA257S drivers which appear to be a CL57T cloned clone. I can't seem to find a config.g file in the forums for the 6XD and external drivers as most of the configs out there are for expansion boards.
I probably would have gone with 1XD expansion boards for these motors had I understood earlier that they could interface with common encoders. My loss.
My problem: I am having a hard time understanding what needs to be declared in the config file for the external drivers. I started with my working 6HC config and changed the following:
I commented out M906 for setting motor current as this is set by the ext. driver though the dictionary M906 states that all drives need this parameter. Not sure if it does.
I upped the M350 microstepping from 16 to 32 as was suggested in the documentation to cover what the encoder could do. I doubled the steps per mm to 1280 from 640. I believe this is correct.
For M569, I am not sure if I need the Taa:bb:cc:dd, Dnn, and Cnnn terms. Taa:bb:cc:dd seems needed because it controls the pulse widths for comms. Do I need to declare D4 for closed loop mode? Cnnn seem to be for specific chips. I don't know if I need these.
And what about M569.1? Not sure if I need this. However, also my ext. driver has an alarm optorelay, so I've wired that to the DX_error pin of the Driver connections. If I don't need M569.1, How else would I control how many lost steps it takes for a warning or error? The ext. drive has its own Position error limit and alarm blinking LED, but I would rather have the duet handle those events so I can read the error messages. I guess i need to set the error limit higher on the ext drive so it doesn't trip first. Kinda lost here.
Here is my config file so far.
; Drives M569 P0.0 S0 T5:5:5:5 D4 ; physical drive 0 goes backwards - X axis with 5us timings between pulses M569 P0.1 S1 T5:5:5:5 D4 ; physical drive 1 goes forwards - Y axis with 5us timings between pulses M569 P0.2 S0 T5:5:5:5 D4 ; physical drive 2 goes backwards - Z axis with 5us timings between pulses M569 P0.3 S1 T5:5:5:5 D4 ; physical drive 3 goes forwards - U axis with 5us timings between pulses M569.1 P0.0 T2 C5 E3:6 ;configure X closed loop driver T2 is quadrature encoder type C is encoder pulses/rev E is warning:error full steps M569.1 P0.1 T2 C5 E3:6 ;configure Y closed loop driver T2 is quadrature encoder type C is encoder pulses/rev E is warning:error full steps M569.1 P0.2 T2 C5 E3:6 ;configure Z closed loop driver T2 is quadrature encoder type C is encoder pulses/rev E is warning:error full steps M569.1 P0.3 T2 C5 E3:6 ;configure X closed loop driver T2 is quadrature encoder type C is encoder pulses/rev E is warning:error full steps M584 X0.0 Y0.1:0.3 Z0.2 U0.3 P3 ; set drive mapping - Y x:x sets Y and U together, P3 hides U axis M350 X32 Y32 Z32 U32 I0 ; configure microstepping without interpolation ;M906 X3100 Y3100 Z3100 U3100 I40 ; set motor currents (mA) and motor idle factor in per cent ; Set axis dynamic parameters M92 X1280 Y1280 Z1280 U1280 ; set steps per mm M566 X500 Y700 Z400 U700 ; set maximum instantaneous speed changes (mm/min), 500 may be conservative M203 X2200 Y2500 Z2200 U2500 ; set maximum speeds (mm/min) M201 X50 Y50 Z50 U50 ; set accelerations (mm/s^2) ; Set axis limits ;S0 set axis max and S1 set axis min M208 X0 Y0 Z-160 U0 S1 ; set axis min M208 X571 Y700 Z0 U700 S0 ; set axis max
-
@SDJ The only way to fully integrate a closed loop stepper motor with Duet 3/RepRapFirmware is using the 1HCL board (not the 1XD). See https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Expansion_1HCL
Using an external closed loop stepper motor and driver that isn't a 1HCL, the best you can do is use the alarm function to alert RRF that the stepper has lost position; it's just not possible to integrate any more feedback than that. So you will know as soon as the stepper loses position, and be able to pause, but you will not be able to recover from the loss of position. The 1HCL board is able to communicate the current position, and recover without loss of position (assuming the axis can still move).
You'll have to set up your existing drivers as, effectively, open loop (ie you can't use M569.1), and connect and configure the alarm to a suitable pin, and have RRF pause (or do whatever you want) when it is triggered. M350 is not configured for external drivers, because you set this on the external driver. Only the steps per mm (M92) matter. Otherwise, your config looks sensible, though you may have to
Ian
-
@SDJ the M569.1 command is only for EXP1HCL boards and other closed loop drivers that connect direct to CAN-FD. As you are using external closed loop drivers with step/dir inputs, you don't need them, and you should remove them from config.g.
Your plain M569 commands look OK to me. You will probably be able to reduce some of the T parameters when you have the system working.
The M350 command is not relevant when using external drivers. The steps/mm that you set in M92 will depend on the steps/rev value that the drivers provide, which is usually configured by switches.
-
@droftarts Hi Ian, thank you for the feedback. I think this makes sense to me now. It's closed loop between the motor and the external driver and it will attempt to return to the correct position but it is essentially open loop for the 6XD because the only info it has is whether or not the alarm function has gone off.
I will try to figure out how the alarm works in testing. Or just throw up my hands and go EXP1HCL.
@dc42 Thanks for the input. I will make those changes.
-
@SDJ Hi, did you figure it out to find the alarm function? Are you able to get the closed loop feedback with 6XD?
Or did you buy EXP1HCL?
I am in the same path like yours.
-
Hi selva, I'm working on this today. I just deleted another post trying to find out how to change the error pin pull up/down. Turns out there is a a spot to bridge it on the board itself. I will let you know how it goes. I am pretty close to finishing if this works.