Problem with Duet3D 1HCL+Duet3D Magnetic encoder V0.3+MSR5000
-
- Yes
- Yes, I did this yesterday when I was trying to run just the Duet encoder motor on the shaft without the MSR5000 (M569.1 T3)
If I try now this is the result.
21/5/2023, 16:47:02: M596.6 P40.0 V1: Warning: M596.6: Command is not supported 21/5/2023, 16:47:05: M596.6 P40.0 V2: Warning: M596.6: Command is not supported
-
@Italiano85 I tried restarting the printer and entering the code M569.6 P40.0 V2 I got this response.
21/5/2023, 16:51:33 M569.6 P40.0 V2 Error: M569.6: Drive is not enabled 21/5/2023, 16:51:29 M569.6 P40.0 V1 Error: M569.6: Drive is not enabled
Then I tried to press the Home button which just blocked the engine, then I tried to send the command M569.6 P40.0 V2
within a few seconds the printer started to calibrate the axis and once finished it sent the Z axis carriage at full speed in the opposite homing direction.
I had to press the emergency button.
-
@Italiano85 @dc42
After many tests, and having found a calibration for the nema 23 motor, I managed to make the calibrations with two separate macro files.Macro 1
M569 P40.0 D0 M98 P"homez.g" G4 S2 G1 Z100 F2000 M569.1 P40.0 T3 R30 I2000 D0 E2:4 M569 P40.0 D4 G4 S2 M569.6 P40.0 V2
Macro 1 does the calibration only with the magnetic encoder on the shaft, and is successful with this result:
Driver 40.0 calibration succeeded, measured backlash is 0.135 step Original encoder reading errors: min -13.1, max 15.2, rms 6.4 Corrections made: min -8.9, max 10.9, rms 6.2
Macro 2 which calibrates the direction of the linear encoder is successful with the result attached below, but as soon as I have finished the calibrations and I try to move the Z axis the machine goes out of control, making jerky movements.
Macro 2
M569 P40.0 D0 M98 P"homez.g" G4 S2 G90 G1 Z100 F500 M569.1 P40.0 T1 C2000 R30 I2000 D0 E2:4 M569 P40.0 D4 G4 S2 M569.6 P40.0 V1 G1 Z0
Result
M98 P"0:/macros/T1_LREnc" Driver 40.0 basic tuning succeeded, measured backlash 0.509 step
Test Result
Diagnostics for board 40: Duet EXP1HCL firmware version 3.5.0-beta.3 (2023-04-14 13:08:48) Bootloader ID: SAME5x bootloader version 2.4 (2021-12-10) All averaging filters OK Never used RAM 23536, free system stack 184 words Tasks: EncCal(nWait,0.0%,474) Move(nWait,0.0%,156) HEAT(nWait,0.0%,82) CanAsync(nWait,0.0%,63) CanRecv(nWait,0.0%,77) CanClock(nWait,0.0%,70) TMC(nWait,58.9%,336) CLSend(nWait,0.0%,152) MAIN(running,39.3%,271) IDLE(ready,0.1%,29) AIN(nWait,1.7%,267), total 100.0% Last reset 00:20:53 ago, cause: power up Last software reset data not available Closed loop enabled: yes, pre-error threshold: 2.00, error threshold: 4.00, encoder type linearComposite, position -155 Shaft: Encoder reverse polarity: yes, full rotations -1, last angle 12012, minCorrection=-8.9, maxCorrection=10.9, agc 0, mag 4757, no error Lin: Encoder reverse polarity: yes, raw count 155 Tuning mode: 0, tuning error: 0, collecting data: no Control loop runtime (us): min=6, max=44, frequency (Hz): min=8523, max=16304 Driver 0: pos 0, 80.3 steps/mm,position tolerance exceededMoves 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 -6/5, peak Rx sync delay 223, resyncs 0/0, next timer interrupt due in 7 ticks, enabled, next step interrupt due in 3354668361 ticks, disabled VIN voltage: min 24.2, current 24.2, max 24.2 V12 voltage: min 12.1, current 12.2, max 12.2 MCU temperature: min 28.4C, current 29.0C, max 29.2C Last sensors broadcast 0x00000030 found 2 18 ticks ago, 0 ordering errs, loop time 0 CAN messages queued 15066, send timeouts 0, received 11287, lost 0, free buffers 37, min 37, error reg 0 dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 0 Accelerometer: none I2C bus errors 12, naks 0, other errors 0
Anyone have any suggestions?
-
@Italiano85 please try running using the magnetic encoder only, to see whether the magnetic encoder calibration. You can leave the linear encoder connected, just change the encoder mode in the M569.1 command from T1 to T3.
Which firmware version are you running, on the main board and on the 1HCL boards?
-
Used Firmware
Calibration result T3 only
M98 P"0:/macros/T3_REnc" Driver 40.0 calibration succeeded, measured backlash is 0.138 step Original encoder reading errors: min -14.4, max 14.5, rms 6.0 Corrections made: min -8.4, max 9.3, rms 5.7
1HCL board diagnostics
m122 b40 Diagnostics for board 40: Duet EXP1HCL firmware version 3.5.0-beta.3 (2023-04-14 13:08:48) Bootloader ID: SAME5x bootloader version 2.4 (2021-12-10) All averaging filters OK Never used RAM 23392, free system stack 178 words Tasks: EncCal(nWait,0.7%,184) Move(nWait,0.0%,115) HEAT(nWait,0.0%,82) CanAsync(nWait,0.0%,63) CanRecv(nWait,0.0%,43) CanClock(nWait,0.0%,70) TMC(nWait,57.0%,318) CLSend(nWait,0.0%,152) MAIN(running,40.3%,289) IDLE(ready,0.3%,29) AIN(nWait,1.8%,267), total 100.0% Last reset 00:01:31 ago, cause: power up Last software reset data not available Closed loop enabled: yes, pre-error threshold: 2.00, error threshold: 4.00, encoder type rotaryAS5047, position 11552 Encoder reverse polarity: yes, full rotations 0, last angle 11552, minCorrection=-8.4, maxCorrection=9.3, agc 0, mag 4757, no error Tuning mode: 0, tuning error: 0, collecting data: no Control loop runtime (us): min=4, max=40, frequency (Hz): min=5137, max=17442 Driver 0: pos -21438, 80.3 steps/mm,ok, SG min 0, mspos 520, reads 36075, writes 13503 timeouts 0, steps req 3 done 161Moves scheduled 7, completed 7, in progress 0, hiccups 0, step errors 0, maxPrep 17, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0 Peak sync jitter -4/6, peak Rx sync delay 219, resyncs 0/0, next timer interrupt due in 11 ticks, enabled, next step interrupt due in 4269949897 ticks, disabled VIN voltage: min 24.1, current 24.2, max 24.2 V12 voltage: min 12.1, current 12.2, max 12.2 MCU temperature: min 20.2C, current 24.0C, max 24.2C Last sensors broadcast 0x00000030 found 2 38 ticks ago, 0 ordering errs, loop time 0 CAN messages queued 1292, send timeouts 0, received 1008, lost 0, free buffers 37, min 37, error reg 0 dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 285, adv 37081/37199 Accelerometer: none I2C bus errors 12, naks 0, other errors 0
In T3 mode with only one encoder it works, where could be the problem?
-
This post is deleted! -
@Italiano85 said in Problem with Duet3D 1HCL+Duet3D Magnetic encoder V0.3+MSR5000:
M569.1 P40.0 T1 C2000 R30 I2000 D0 E2:4
- Set the I term to zero until you have movement working. An excessively large I term can cause instability.
- How did you determine that C2000 was the correct value?
-
- OK,i had pulled that value there from the closed loop plugin by running the autotune
- I put that value there because the numbers close to 2000 ± (~50)
they work, others give errors
Error: Driver 40.0 basic tuning failed, the measured motion was more than expected, measured counts/rev is about 1963.4 Warning: Driver 40.0 warning: tuning/calibration failed
With the value I=500 now it seems that it works, in these days I will try to find the best calibration.
I'll keep it updated.
Thanks a lot for your support.
-
@dc42 ;
I have another question to ask, if I wanted to activate the brake of the 1HCL board so that when the motor moves it is deactivated and when the motor stops in a position of the Z axis an electromagnet along the carriage is activated, it is possible to do it using the config file?
The way the 1HCL is currently configured the 24V always goes out even when the engine is running, so I can't use it.
; Drives M569.1 P40.0 T1 R30 I50 D0 E2:4 C1985 M569.7 P40.0 C"out0" S500 M569 P40.0 S1 D4 ; physical drive 40.0 goes forwards
-
@Italiano85 said in Problem with Duet3D 1HCL+Duet3D Magnetic encoder V0.3+MSR5000:
I have another question to ask, if I wanted to activate the brake of the 1HCL board so that when the motor moves it is deactivated and when the motor stops in a position of the Z axis an electromagnet along the carriage is activated, it is possible to do it using the config file?
The brake solenoid will be automatically activated (to release the brake) when you enable the motor either by using M17 or implicitly by commanding movement, and automatically deactivated (to engage the brake) when you use M18 or M84 to turn off the driver. There is no facility to engage the brake simply because the motor stops moving; but you should not need to do that because the motor should hold position, if in open loop mode you have a suitable standstill current fraction, and in closed loop mode you have a suitable I parameter in the M569 command I typically use 200).
BTW we have substantial improvements coming to the 1HCL firmware in 3.5beta4.