No encoder specified for closed loop drive mode ERROR
-
Hello All,
I just upgraded my firmware to 3.5.0Cr2, I'm getting an error at the startup for my 1HCL Driver board running with a closed-loop system
with no movement at all. Error in macro line 29 while starting up: No encoder specified for closed-loop drive modeM122
m122 === Diagnostics === RepRapFirmware for Duet 3 MB6XD version 3.5.0-rc.2 (2023-12-14 10:33:00) running on Duet 3 MB6XD v1.0 (standalone mode) Board ID: 08DLM-956DA-M2NS4-6JKD6-3S86T-1B32S Used output buffers: 3 of 40 (19 max) Error in macro line 29 while starting up: No encoder specified for closed loop drive mode === RTOS === Static ram: 153284 Dynamic ram: 117380 of which 0 recycled Never used RAM 72472, free system stack 204 words Tasks: NETWORK(1,ready,34.2%,182) ETHERNET(5,nWait,0.1%,321) HEAT(3,nWait,0.0%,369) Move(4,nWait,0.0%,340) CanReceiv(6,nWait,0.0%,797) CanSender(5,nWait,0.0%,334) CanClock(7,delaying,0.0%,343) MAIN(1,running,65.6%,128) IDLE(0,ready,0.1%,30), total 100.0% Owned mutexes: === Platform === Last reset 00:03:50 ago, cause: software Last software reset at 2023-12-23 03:10, reason: User, Gcodes spinning, available RAM 75408, slot 0 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0x00000000 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x00 Aux0 errors 0,0,0 MCU temperature: min 34.5, current 34.8, max 35.0 Supply voltage: min 24.9, current 24.9, max 24.9, under voltage events: 0, over voltage events: 0, power good: yes 12V rail voltage: min 12.0, current 12.1, max 12.2, under voltage events: 0 Heap OK, handles allocated/used 99/2, heap memory allocated/used/recyclable 2048/60/0, gc cycles 0 Events: 0 queued, 0 completed Driver 0: ok Driver 1: ok Driver 2: ok Driver 3: ok Driver 4: ok Driver 5: ok Date/time: 2023-12-23 03:14:19 Slowest loop: 11.57ms; fastest: 0.07ms === Storage === Free file entries: 20 SD card 0 detected, interface speed: 25.0MBytes/sec SD card longest read time 3.7ms, write time 0.0ms, max retries 0 === Move === DMs created 125, segments created 0, maxWait 0ms, bed compensation in use: none, height map offset 0.000, max steps late 0, ebfmin 0.00, ebfmax 0.00 no step interrupt scheduled Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0 === DDARing 0 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === DDARing 1 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null, null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 SBC is idle in state(s) 0 Daemon is idle in state(s) 0 Aux2 is idle in state(s) 0 Autopause is idle in state(s) 0 File2 is idle in state(s) 0 Queue2 is idle in state(s) 0 Q0 segments left 0, axes/extruders owned 0x0000000 Code queue 0 is empty Q1 segments left 0, axes/extruders owned 0x0000000 Code queue 1 is empty === CAN === Messages queued 1185, received 1873, lost 0, errs 949, boc 0 Longest wait 1ms for reply type 6018, peak Tx sync delay 1218, free buffers 50 (min 49), ts 1152/1150/0 Tx timeouts 0,0,1,0,0,0 last cancelled message type 30 dest 127 === Network === Slowest loop: 5.65ms; fastest: 0.03ms Responder states: MQTT(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) Telnet(0) HTTP sessions: 1 of 8 = Ethernet = Interface state: active Error counts: 0 0 0 1 0 0 Socket states: 5 2 2 2 2 0 0 0 === Multicast handler === Responder is inactive, messages received 0, responses 0
M122 B50
m122 B50 Diagnostics for board 50: Duet EXP1HCL rev 1.0a or earlier firmware version 3.5.0-rc.2 (2023-12-14 08:55:39) Bootloader ID: SAME5x bootloader version 2.4 (2021-12-10) All averaging filters OK Never used RAM 75936, free system stack 198 words Tasks: Move(3,nWait,0.0%,182) CLSend(3,nWait,0.0%,150) HEAT(2,nWait,0.0%,120) CanAsync(5,nWait,0.0%,67) CanRecv(3,nWait,0.0%,80) CanClock(5,nWait,0.0%,70) TMC(2,nWait,19.8%,359) MAIN(1,running,77.7%,413) IDLE(0,ready,0.4%,30) AIN(2,nWait,2.1%,265), total 100.0% Last reset 00:05:04 ago, cause: software Last software reset data not available Driver 0: pos 0, 80.0 steps/mm, standstill, SG min n/a, mspos 8, reads 56517, writes 32 timeouts 0, steps req 0 done 0 Moves scheduled 0, completed 0, in progress 0, hiccups 0, segs 0, step errors 0, maxLate 0 maxPrep 0, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0, ebfmin 0.00 max 0.00 Peak sync jitter -7/5, peak Rx sync delay 185, resyncs 0/0, next timer interrupt due in 9 ticks, enabled, next step interrupt due in 4066589403 ticks, disabled VIN voltage: min 48.5, current 48.6, max 48.6 V12 voltage: min 12.1, current 12.1, max 12.2 MCU temperature: min 26.3C, current 26.3C, max 26.6C Last sensors broadcast 0x00000000 found 0 135 ticks ago, 0 ordering errs, loop time 0 CAN messages queued 2480, send timeouts 0, received 1557, lost 0, errs 0, boc 0, free buffers 38, min 38, error reg 0 dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 0 Closed loop driver 0 mode: open loop, pre-error threshold: 2.00, error threshold: 4.00, encoder type none Accelerometer: none I2C bus errors 12, naks 0, contentions 0, other errors 0
M98 P"config.g"
12/23/2023, 3:20:40 AM Error: No encoder specified for closed loop drive mode Error: Encoder counts/rev must be at least two times steps/rev Warning: Sensor number 1 has not been defined 12/23/2023, 3:20:39 AM M98 P"config.g" HTTP is enabled on port 80
Config.g
; Configuration file for RepRapFirmware on Duet 3 Main Board 6XD ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.5.0-rc.2 on Fri Dec 22 2023 21:48:41 GMT-0600 (Central Standard Time) ; General M550 P"Duet 3-CNC" ; set hostname ; Accessories M575 P1 S0 B57600 ; configure PanelDue support ; Network M552 P0.0.0.0 S1 ; configure Ethernet adapter M586 P0 S1 ; configure HTTP ; Wait a moment for the CAN expansion boards to become available G4 S2 ; Motor Idle Current Reduction M906 I30 ; set motor current idle factor M84 S30 ; set motor current idle timeout ; External Drivers M569 P0.1 S1 R0 T5:5:10:0 ; driver 0.1 goes forwards and requires an active-low enable signal (Y axis) M569 P0.2 S1 R0 T5:5:10:0 ; driver 0.2 goes forwards and requires an active-low enable signal (Z axis) M569 P0.3 S1 R0 T5:5:10:0 ; driver 0.3 goes forwards and requires an active-low enable signal (Y axis) ; Smart Drivers M569 P50.0 S1 D4; driver 50.0 goes forwards (X axis) ; Closed-Loop Drivers M569.1 P50.0 T2 C5 I0 D0 ; driver 50.0 has a quadrature encoder with 5 CPS ; Axes M584 X50.0 Y0.1:0.3 Z0.2 ; set axis mapping M350 X16 Y16 Z16 I0 ; configure microstepping without interpolation M906 X3000 ; set axis driver currents M92 X80 Y80 Z400 ; configure steps per mm M208 X0:2000 Y0:200 Z0:200 ; set minimum and maximum axis limits M566 X900 Y900 Z12 ; set maximum instantaneous speed changes (mm/min) M203 X20000 Y6000 Z180 ; set maximum speeds (mm/min) M201 X500 Y500 Z20 ; set accelerations (mm/s^2) ; Kinematics M669 K0 ; configure Cartesian kinematics ; Endstops M574 X1 P"!50.io0.in" S1 ; configure X axis endstop M574 Y1 P"io1.in+io2.in" S1 ; configure Y axis endstop M574 Z1 P"io3.in" S1 ; configure Z axis endstop ; Heaters M950 H1 C"out1" T1 ; create heater #1 M143 H1 P0 T1 C0 S285 A0 ; configure heater monitor #0 for heater #1 M307 H1 R2.43 D5.5 E1.35 K0.56 B0 ; configure model of heater #1 ; Heated beds M140 P0 H0 ; configure heated bed #0 ; Spindles ;M950 C"io4.out+io2.out+io3.out" Q500 L60:10000 ; configure spindle #0 ; Fans M950 F0 C"out0" ; create fan #0 M106 P0 S0 L0 X1 B0.1 ; configure fan #0 ; Tools ;M563 P0 D0 H1 F0 ; create tool #0 ;M568 P0 R0 S0 ; set initial tool #0 active and standby temperatures to 0C ; Miscellaneous M453 ; select CNC mode
I ran M564 S0 H0
the only motor response is my external driver which is ( M569 P0.1 S1 R0 T5:5:10:0) when I remove the closed loop feature the stepper motor
does move under M564 S0H0 Command but it is very noisy like running it on Sh*ty driver.Thank you
-
@moe-adams9093 if you are upgrading from 3.4 then the M569.1 parameter to specify the encoder resolution has changed. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m5691-stepper-driver-closed-loop-configuration.
-
the problem at first was on line 27
M569 P50.0 S1 D4; driver 50.0 goes forwards (X-axis)
I removed the D4 value then the error went away, but now I have this error
12/23/2023, 1:03:31 PM Error: Encoder counts/rev must be at least two times steps/rev
how can I overcome this step?
M122
m122 === Diagnostics === RepRapFirmware for Duet 3 MB6XD version 3.5.0-rc.2 (2023-12-14 10:33:00) running on Duet 3 MB6XD v1.0 (standalone mode) Board ID: 08DLM-956DA-M2NS4-6JKD6-3S86T-1B32S Used output buffers: 1 of 40 (19 max) Error in macro line 32 while starting up: Encoder counts/rev must be at least two times steps/rev === RTOS === Static ram: 153284 Dynamic ram: 117380 of which 0 recycled Never used RAM 72472, free system stack 204 words Tasks: NETWORK(1,ready,34.5%,182) ETHERNET(5,nWait,0.1%,325) HEAT(3,nWait,0.0%,369) Move(4,nWait,0.0%,340) CanReceiv(6,nWait,0.0%,797) CanSender(5,nWait,0.0%,334) CanClock(7,delaying,0.0%,343) MAIN(1,running,65.4%,128) IDLE(0,ready,0.0%,30), total 100.0% Owned mutexes: === Platform === Last reset 00:07:52 ago, cause: software Last software reset at 2023-12-23 13:02, reason: User, Gcodes spinning, available RAM 72472, slot 1 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0x00000000 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x00 Aux0 errors 0,0,0 MCU temperature: min 33.7, current 34.6, max 34.8 Supply voltage: min 24.9, current 24.9, max 25.0, under voltage events: 0, over voltage events: 0, power good: yes 12V rail voltage: min 12.0, current 12.1, max 12.2, under voltage events: 0 Heap OK, handles allocated/used 99/2, heap memory allocated/used/recyclable 2048/68/0, gc cycles 0 Events: 0 queued, 0 completed Driver 0: ok Driver 1: ok Driver 2: ok Driver 3: ok Driver 4: ok Driver 5: ok Date/time: 2023-12-23 13:10:08 Slowest loop: 4.23ms; fastest: 0.07ms === Storage === Free file entries: 20 SD card 0 detected, interface speed: 25.0MBytes/sec SD card longest read time 3.4ms, write time 0.0ms, max retries 0 === Move === DMs created 125, segments created 0, maxWait 0ms, bed compensation in use: none, height map offset 0.000, max steps late 0, ebfmin 0.00, ebfmax 0.00 no step interrupt scheduled Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0 === DDARing 0 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === DDARing 1 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null, null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 SBC is idle in state(s) 0 Daemon is idle in state(s) 0 Aux2 is idle in state(s) 0 Autopause is idle in state(s) 0 File2 is idle in state(s) 0 Queue2 is idle in state(s) 0 Q0 segments left 0, axes/extruders owned 0x0000000 Code queue 0 is empty Q1 segments left 0, axes/extruders owned 0x0000000 Code queue 1 is empty === CAN === Messages queued 2388, received 3795, lost 0, errs 3923, boc 0 Longest wait 2ms for reply type 6041, peak Tx sync delay 13074, free buffers 50 (min 49), ts 2364/2359/0 Tx timeouts 0,0,4,0,0,0 last cancelled message type 30 dest 127 === Network === Slowest loop: 1.66ms; fastest: 0.03ms Responder states: MQTT(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) Telnet(0) HTTP sessions: 1 of 8 = Ethernet = Interface state: active Error counts: 0 0 0 0 0 0 Socket states: 5 2 2 2 2 0 0 0 === Multicast handler === Responder is inactive, messages received 0, responses 0
M122 B50
m122 B50 Diagnostics for board 50: Duet EXP1HCL rev 1.0a or earlier firmware version 3.5.0-rc.2 (2023-12-14 08:55:39) Bootloader ID: SAME5x bootloader version 2.4 (2021-12-10) All averaging filters OK Never used RAM 75936, free system stack 186 words Tasks: Move(3,nWait,0.0%,182) CLSend(3,nWait,0.0%,150) HEAT(2,nWait,0.0%,120) CanAsync(5,nWait,0.0%,67) CanRecv(3,nWait,0.0%,80) CanClock(5,nWait,0.0%,70) TMC(2,nWait,19.8%,359) MAIN(1,running,77.8%,385) IDLE(0,ready,0.2%,30) AIN(2,nWait,2.1%,265), total 100.0% Last reset 00:08:38 ago, cause: software Last software reset data not available Driver 0: pos 0, 80.0 steps/mm, standstill, SG min n/a, mspos 536, reads 51573, writes 27 timeouts 0, steps req 0 done 0 Moves scheduled 0, completed 0, in progress 0, hiccups 0, segs 0, step errors 0, maxLate 0 maxPrep 0, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0, ebfmin 0.00 max 0.00 Peak sync jitter -4/7, peak Rx sync delay 184, resyncs 0/0, next timer interrupt due in 10 ticks, enabled, next step interrupt due in 3905818431 ticks, disabled VIN voltage: min 48.5, current 48.5, max 48.6 V12 voltage: min 12.1, current 12.1, max 12.2 MCU temperature: min 26.8C, current 26.9C, max 28.6C Last sensors broadcast 0x00000000 found 0 194 ticks ago, 0 ordering errs, loop time 0 CAN messages queued 4186, send timeouts 0, received 2621, lost 0, errs 0, boc 0, free buffers 38, min 38, error reg 0 dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 0 Closed loop driver 0 mode: open loop, pre-error threshold: 2.00, error threshold: 4.00, encoder type none Accelerometer: none I2C bus errors 12, naks 0, contentions 0, other errors 0
Config.g
; Configuration file for RepRapFirmware on Duet 3 Main Board 6XD ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.5.0-rc.2 on Fri Dec 22 2023 21:48:41 GMT-0600 (Central Standard Time) ; General M550 P"Duet 3-CNC" ; set hostname ; Accessories M575 P1 S0 B57600 ; configure PanelDue support ; Network M552 P0.0.0.0 S1 ; configure Ethernet adapter M586 P0 S1 ; configure HTTP ; Wait a moment for the CAN expansion boards to become available G4 S2 ; Motor Idle Current Reduction M906 I30 ; set motor current idle factor M84 S30 ; set motor current idle timeout ; External Drivers M569 P0.1 S1 R0 T5:5:10:0 ; driver 0.1 goes forwards and requires an active-low enable signal (Y axis) M569 P0.2 S1 R0 T5:5:10:0 ; driver 0.2 goes forwards and requires an active-low enable signal (Z axis) M569 P0.3 S1 R0 T5:5:10:0 ; driver 0.3 goes forwards and requires an active-low enable signal (Y axis) ; Smart Drivers M569 P50.0 S1 ; driver 50.0 goes forwards (X axis) ; Closed-Loop Drivers M569.1 P50.0 S200 R100 I0 D0 A100 T2 C5; driver 50.0 has a quadrature encoder with 5 CPS ; Axes M584 X50.0 Y0.1:0.3 Z0.2 ; set axis mapping M350 X16 Y16 Z16 I0 ; configure microstepping without interpolation M906 X3000 ; set axis driver currents M92 X80 Y80 Z400 ; configure steps per mm M208 X0:200 Y0:200 Z0:200 ; set minimum and maximum axis limits M566 X900 Y900 Z12 ; set maximum instantaneous speed changes (mm/min) M203 X6000 Y6000 Z180 ; set maximum speeds (mm/min) M201 X500 Y500 Z20 ; set accelerations (mm/s^2) ; Kinematics M669 K0 ; configure Cartesian kinematics ; Endstops M574 X1 P"!50.io0.in" S1 ; configure X axis endstop M574 Y1 P"io1.in+io2.in" S1 ; configure Y axis endstop M574 Z1 P"io3.in" S1 ; configure Z axis endstop ; Heaters M950 H1 C"out1" T1 ; create heater #1 M143 H1 P0 T1 C0 S285 A0 ; configure heater monitor #0 for heater #1 M307 H1 R2.43 D5.5 E1.35 K0.56 B0 ; configure model of heater #1 ; Heated beds M140 P0 H0 ; configure heated bed #0 ; Spindles ;M950 C"io4.out+io2.out+io3.out" Q500 L60:10000 ; configure spindle #0 ; Fans M950 F0 C"out0" ; create fan #0 M106 P0 S0 L0 X1 B0.1 ; configure fan #0 ; Tools ;M563 P0 D0 H1 F0 ; create tool #0 ;M568 P0 R0 S0 ; set initial tool #0 active and standby temperatures to 0C ; Miscellaneous M453 ; select CNC mode
-
@moe-adams9093 see my previous reply. Your M569.1 command is wrong for RRF 3.5.
-
@dc42 I have read the document few times I found it somewhat confusing specially with the parameters. I was able to get the error off after I installed and switched to the Duet magnetic encoder. I have D4 on M569 and T 3 M569.1.
Aduring tuning no motor movement but I can hear the motor is getting current. -
@dc42I still have no movements on the closed loop even when I run m569
; Smart Drivers M569.1 P50.0 T2 C1000 H50 P30 I1000 D0.050 A150000 V400 E4:8; M569 P50.0 D4 S1 ; Configure the motor on the Duet 3 Expansion 1HCL controller at can address 50 as being in closed-loop drive mode (D4) and not reversed (S1)
m569.1 P50.0 Encoder type: rotaryQuadrature Quadrature encoder pulses/rev: 1000.00 PID parameters P=40.0 I=2000.000 D=0.000 V=400.0 A=150000.0, torque constant 1.00Nm/A Warning/error threshold 4.00/8.00
m569.0 P50.0 Driver 50.0 runs forwards, active low enable, mode direct (closed loop), ccr 0x08053, toff 3, tblank 1, thigh 200 (20.8 mm/sec), pos 8
m122 B50 Diagnostics for board 50: Duet EXP1HCL rev 1.0a or earlier firmware version 3.5.0-rc.2 (2023-12-14 08:55:39) Bootloader ID: SAME5x bootloader version 2.4 (2021-12-10) All averaging filters OK Never used RAM 75704, free system stack 186 words Tasks: Move(3,nWait,0.0%,110) CLSend(3,nWait,0.0%,143) HEAT(2,nWait,0.0%,112) CanAsync(5,nWait,0.0%,67) CanRecv(3,nWait,0.0%,78) CanClock(5,nWait,0.0%,70) TMC(4,nWait,32.0%,347) MAIN(1,running,65.5%,375) IDLE(0,ready,0.1%,30) AIN(2,nWait,2.3%,265), total 100.0% Last reset 00:18:45 ago, cause: power up Last software reset data not available Driver 0: pos 8816, 180.0 steps/mm, not tuned/calibrated, SG min n/a, mspos 8, reads 33162, writes 37 timeouts 0, steps req 0 done 0 Moves scheduled 19, completed 19, in progress 0, hiccups 0, segs 6, step errors 0, maxLate 0 maxPrep 56, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0, ebfmin 0.00 max 0.00 Peak sync jitter -6/7, peak Rx sync delay 186, resyncs 0/0, next timer interrupt due in 29 ticks, enabled, next step interrupt due in 3450696376 ticks, disabled VIN voltage: min 48.5, current 48.5, max 48.6 V12 voltage: min 12.1, current 12.1, max 12.2 MCU temperature: min 24.0C, current 29.3C, max 29.5C Last sensors broadcast 0x00000000 found 0 143 ticks ago, 0 ordering errs, loop time 0 CAN messages queued 11244, send timeouts 0, received 5709, lost 0, errs 0, boc 0, free buffers 38, min 38, error reg 0 dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 317, adv 36896/37199 Closed loop driver 0 mode: closed loop, pre-error threshold: 4.00, error threshold: 8.00, encoder type rotaryQuadrature, position 1 Encoder reverse polarity: no, raw count 1 Tuning mode: 0, tuning error: 0x1, collecting data: no Control loop runtime (us): min=8, max=37, frequency (Hz): min=9146, max=19736 Accelerometer: none I2C bus errors 6, naks 0, contentions 0, other errors 0 even when I run a closed loop tuning doesn't respond or give accurate information and no movement.
do you have any example codes or a document that can explain or give more details regarding the parameters?
Thanks
-
@moe-adams9093 Can you confirm if you are using the Duet magnetic encoder for P50.0, or are you back to the other encoder?
Can you post your homing files (specifically homeall.g and homex.g)? Have you read through the calibration section here? https://docs.duet3d.com/User_manual/Tuning/Duet_3_1HCL_tuning