Skip to content

Commit

Permalink
Version 2.01/1.22 beta 2
Browse files Browse the repository at this point in the history
Bug fixes:
- Non-movement commands were not correctly synchronised with movement commands when there were more than 8 non-movement commands interspersed with more than 2 seconds of movement
- If M28/M29 was used in a macro file to then the commands between M28 and M29 were executed as well as being written to the target file
- If you used the jog buttons in DWC before homing the axes, and you didn't use M564 H0 in config.g, then as well as the "insufficient axes homed" error message, a stack underflow error message was produced
- Neither M561 nor G29 S2 adjusted the user Z coordinate if bed compensation was previously active (G29 S2 did if you ran it twice)
- Duet 06/085 only: fixed a buffer overflow in the Netbios responder code
- Duet 2 series: when an under-voltage event occurred, spurious driver status warnings/errors were sometimes reported
- Duet 2 series: when an under- or over-voltage event occurred, the VIN voltage reported was the current voltage, not the voltage when the event was recorded
- When an axis was made visible and later hidden, subsequent move commands sometimes sent step commands incorrectly to the driver(s) associated with that axis. This could cause unwanted movement if the axis was still mapped to a real driver. If it was mapped to a dummy driver, it could still cause step errors to be recorded and/or some movements to be slowed down.
- The longest loop time reported by M122 was distorted by the fact that M122 itself takes a long time to execute, due to the volume of output it produces and the need to synchronise with the Network task

New features/changed behaviour:
- On the Duet 2 Maestro, the 2 optional add-on drivers are now assumed to be TMC2224 with UART interface
- When the Z probe type is set to 9 for BLTouch, the probe output is no longer filtered, for faster response
- If an error occurs while reading or writing the SD card, the operation is retried. The M122 report includes the maximum number of retries that were done before a successful outcome.
- On the Duet WiFi/Ethernet, at startup the firmware does additional retries when checking for the presence of a DueX2 or DueX5 and/or additional I/O expansion board
- When a resurrect.g file is generated, it now includes G92 commands just before it invokes resurrect-prologue.g, to set the assumed head position to the point at which power was lost or the print was paused. This is to better handle printers for which homing Z is not possible when a print is already on the bed. Caution: this doesn't allow for any Z lift or other movement in the power fail script.
- RTOS builds only: added a separate software watchdog to monitor the Heat task
- RTOS builds only: in the M122 report, the software reset data now includes which task was active, and only owned mutexes are listed
- Upgraded compiler to 2018-q2-update
  • Loading branch information
dc42 committed Jul 14, 2018
1 parent 4a525ab commit d0505c8
Show file tree
Hide file tree
Showing 33 changed files with 558 additions and 453 deletions.
12 changes: 6 additions & 6 deletions .cproject
Expand Up @@ -7,7 +7,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -122,7 +122,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -232,7 +232,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -353,7 +353,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -473,7 +473,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -593,7 +593,7 @@
<stringMacro name="LinkFlags2" type="VALUE_TEXT" value="-Wl,--end-group -lm"/>
<stringMacro name="LinkFlags1" type="VALUE_TEXT" value="-mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group"/>
<stringMacro name="CoreName" type="VALUE_TEXT" value="CoreNG"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin"/>
<stringMacro name="GccPath" type="VALUE_TEXT" value="C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin"/>
</macros>
<externalSettings/>
<extensions>
Expand Down
50 changes: 29 additions & 21 deletions src/BugList.txt
Expand Up @@ -195,7 +195,7 @@ WiFi:
- [resolve library incompatibility] New ESP8266 SDK
- [done] check what's new in Arduino ESP 2.4.1

Bug fixes/investigations:
Done in 2.01beta1:
- [done, test] sqrt(2) error factor in extrusion-only moves, see Michael's email
- [done] Homing wrong if axes not labeled sequentially, see Christian's email of 18/6/18
- [done, test] Fix "2dtstc2diva=u" in debug printout, https://forum.duet3d.com/topic/3139/high-level-of-steperrors-what-can-cause-them/5
Expand All @@ -212,30 +212,42 @@ Bug fixes/investigations:
- [done] Add SW_ENC pin on CONN_SD to available GPIO ports
- [done] Increased M999 delay to 1 second
- [done] If M911 resume threshold is set too high, save-on-power-off never primes itself
- [done] display mutex owners in task diagnostics

Bug fixes/investigations for 2.02beta2:
- [done, test] GCode queue overflow, see https://forum.duet3d.com/topic/5821/major-performance-problem. Suspend processing until queue space is available.
- [done, test M28/M29 and M559/M560 file uploads] M28 and M29 in a macro, https://forum.duet3d.com/topic/5642/filament-load-macro-writing-to-file-in-sys. Move fileBeingWritten to GCodeBuffer, get rid of writingFileDirectory.
- [done, test] we get a Pop underflow message when you send DWC jog commands and axes are not homed
- [done, test] clear bed compensation not working properly, https://forum.duet3d.com/topic/5978/dwc-ui-position-updates-are-behind-causing-leveling-problems/6
- [done] Duet Maestro default to TMC2224 drivers on expansion
- [done] bltouch now uses unfiltered digital probe mode
- [done] Reset/retry after SD card error - we have confirmation that fatfs is reporting a low-level error (error 1)
- [increased retries, test detection] Doesn't find DueX5 after M999 reset? https://forum.duet3d.com/topic/5713/duet2-with-2-0-rtos-looses-duex5-on-reset
- [made some changes] Test Duet 06/085 DHCP problem again, see https://forum.duet3d.com/topic/5572/it-s-out-reprapfirmware-2-0-and-1-21-1-released/16 for config.g files
- [done, test] resurrect.g to include G92 commands to set head position to the power fail position
- [done] Software watchdog to watch Heat task
- [done, test] When an under-voltage event occurs, spurious driver status warnings/error were sometimes reported
- [done, test] When an under- or over-voltage event occurred, the VIN voltage reported was the current voltage, not the voltage when the event was recorded
- [done, test] Software reset data now includes which task was active
- [done, test] Step errors on a drive corresponding to an invisible axis, https://forum.duet3d.com/topic/3139/high-level-of-steperrors-what-can-cause-them/5

- [awaiting reply] Step errors when usimng Numbe and pressure advance, https://forum.duet3d.com/topic/3139/high-level-of-steperrors-what-can-cause-them/5
- [awaiting reply] GCode file that pauses between parts, https://forum.duet3d.com/topic/5702/printer-keeps-pausing-during-print/15
- [looks like it was a temperature sensing error] Is there a kink during auto tuning? https://forum.duet3d.com/topic/5582/hot-end-auto-tuning-failed-due. Could explain oddly low dead times from auto tuning.
- Pressure advance, see https://www.duet3d.com/forum/thread.php?pid=38036#p38036 and https://forum.duet3d.com/topic/1935/more-strange-pressure-advance-behaviour/95
- Stuck in spin loop, https://forum.duet3d.com/topic/5674/damned-crash-stuck-in-spin-loop
- Report that if you use FileZilla to upload several short files, some of them are written blank, https://forum.duet3d.com/topic/5992/files-uploaded-over-ftp-occasionally-blank

- Test gcode file that pauses between parts, https://forum.duet3d.com/topic/5702/printer-keeps-pausing-during-print/15
- Doesn't find DueX5 after M999 reset? https://forum.duet3d.com/topic/5713/duet2-with-2-0-rtos-looses-duex5-on-reset
- stuck in spin loop, https://forum.duet3d.com/topic/5674/damned-crash-stuck-in-spin-loop
- step errors, see https://forum.duet3d.com/topic/3139/high-level-of-steperrors-what-can-cause-them/5
- Investigate failed .BMP conversion, https://forum.duet3d.com/topic/5623/boot-logo-corruption-in-1-21/2
- Duet Maestro default to TMC2224 drivers on expansion? How to detect them?
- M28 and M29 in a macro, https://forum.duet3d.com/topic/5642/filament-load-macro-writing-to-file-in-sys. Move fileBeingWritten to GCodeBuffer, get rid of writingFileDirectory.
- Is there a kink during auto tuning? https://forum.duet3d.com/topic/5582/hot-end-auto-tuning-failed-due. Could explain oddly low dead times from auto tuning.
- Does bltouch need a default recovery time to allow it to deploy? (probably not)
- Should bltouch use digital probe mode? Some users having problems with P25 in G31 command.
- Test Duet 06/085 DHCP problem again, see https://forum.duet3d.com/topic/5572/it-s-out-reprapfirmware-2-0-and-1-21-1-released/16 for config.g files
- Retry after SD card error?

Other:
- @wilriker PR for M106 PWM limit
- [done, test] display mutex owners in task diagnostics

Planned for 2.02:
- WiFi continuous auto reconnect, or extra M552 parameter? See https://forum.duet3d.com/topic/5765/wifi-module-auto-reconnect
- @wilriker PR for M106 PWM limit
- WiFi continuous auto reconnect in client mode, or extra M552 parameter? See https://forum.duet3d.com/topic/5765/wifi-module-auto-reconnect
- Better dead time measurement during auto tuning. Measure both turn-on and turn-off?
- Bezier speed curves or other S-curve acceleration, e.g. look at https://github.com/MarlinFirmware/Marlin/pull/10373/files
- Option to send M280 servo commands just a few times instead of continuously, for E3D
- Recovery from SD card errors during a print (Dan)
- Danny's modified SCARA kinematics (workpiece is on a plate, extruder is fixed)
- Laser support via G1 S parameter, see https://forum.duet3d.com/topic/4702/laser-cnc-support-in-rrf-gcode-semantics/4
- Look at pushover notification support, https://forum.duet3d.com/topic/169/notification-via-pushover-or-other-service/45
Expand All @@ -244,11 +256,10 @@ Planned for 2.02:
- M584 when assigning a drive, unmap any existing assignment. Also allow an axis to be mapped to driver -1.
- Add S4 option to G1 command, like S1 but no endstop checks (needed for CoreXY, CoreXZ)
- CNC: look at G17/18/19, see https://forum.duet3d.com/topic/4669/ooznest-workbee-screw-driven
- M569 command to allow selection of smart/dumb driver, also allow all 12 drivers to be smart
- M569 command to allow selection of smart/dumb driver (including on Duet M), also allow all 12 drivers to be smart
- M569 TOFF parameter, https://forum.duet3d.com/topic/5392/does-m906-set-rms-or-peak-current/28
- Apostrophe in quoted filename: can we make apostrophe special in SSIDs/passwords but not filenames?
- If wifi module gets stuck in starting or changing mode state, reset it again
- If wifi disconnects when in client mode, keep retrying the connection
- M140 command to set default bed heaters for M140 S commands (e.g. M140 P0:1:2)

Other (some of these may be in 2.02):
Expand All @@ -260,7 +271,6 @@ Other (some of these may be in 2.02):
- support M205 for setting jerk
- support G12 clean tool?
- Add fan PWM limit, https://forum.duet3d.com/topic/5370/m106-feature-request-limit-max-pwm-parameter/4
- M116 extra "close enough" parameter
- after homing, warn if outside M208 movement limits on SCARA, polar etc.
- Unexpected heaters off/tool selection behaviour, https://www.duet3d.com/forum/thread.php?pid=43059#p43059
- warn when using : where ; was probably meant
Expand All @@ -271,7 +281,6 @@ Other (some of these may be in 2.02):
- Auto mount main SD card when inserted
- Workplace offsets are supposed to be persistant (check NIST), https://www.duet3d.com/forum/thread.php?pid=43755#p43755
- At the end of a simulation, restore the original workplace coordinate selection
- looks like we get a Pop underflow message when you send DWC jog commands and axes are not homed
- Add warning message when print exceeds bounds
- When uploading while a file is being printed, don't allow the currently-printing file to be replaced

Expand All @@ -288,7 +297,6 @@ Other (some of these may be in 2.02):
- laser control, https://www.duet3d.com/forum/thread.php?pid=37891#p37891
- slow DWC but fast FTP, https://www.duet3d.com/forum/thread.php?pid=38345#p38345
- no stall detect on Z axis, https://www.duet3d.com/forum/thread.php?pid=38504#p38504, https://www.duet3d.com/forum/thread.php?pid=39484#p39484
- Pressure advance, see https://www.duet3d.com/forum/thread.php?pid=38036#p38036
- check that we never enable the drivers before we set vsense

- [don't do] Don't report the motor current for a non-existent extruder
Expand Down
6 changes: 6 additions & 0 deletions src/Configuration.h
Expand Up @@ -154,6 +154,8 @@ static_assert(MaxCalibrationPoints <= MaxProbePoints, "MaxCalibrationPoints must

// SD card
constexpr uint32_t SdCardDetectDebounceMillis = 200; // How long we give the SD card to settle in the socket
constexpr unsigned int MaxSdCardTries = 3; // Number of read or write attempts before giving up
constexpr uint32_t SdCardRetryDelay = 10; // Number of milliseconds delay between SD transfer retries

// Z probing
constexpr float DefaultZDive = 5.0; // Millimetres
Expand All @@ -177,8 +179,10 @@ constexpr size_t PASSWORD_LENGTH = 20;
#if SAM4E || SAM4S || SAME70
// Increased GCODE_LENGTH on the SAM4 because M587 and M589 commands on the Duet WiFi can get very long
constexpr size_t GCODE_LENGTH = 161; // maximum number of non-comment characters in a line of GCode including the null terminator
constexpr size_t SHORT_GCODE_LENGTH = 61; // maximum length of a GCode that we can queue to synchronise it to a move
#else
constexpr size_t GCODE_LENGTH = 101; // maximum number of non-comment characters in a line of GCode including the null terminator
constexpr size_t SHORT_GCODE_LENGTH = 61; // maximum length of a GCode that we can queue to synchronise it to a move
#endif

constexpr size_t MaxMessageLength = 256;
Expand Down Expand Up @@ -207,6 +211,8 @@ constexpr size_t RESERVED_OUTPUT_BUFFERS = 2; // Number of reserved output buf
# error
#endif

const size_t maxQueuedCodes = 16; // How many codes can be queued?

// Move system
constexpr float DefaultFeedRate = 3000.0; // The initial requested feed rate after resetting the printer, in mm/min
constexpr float DefaultG0FeedRate = 18000; // The initial feed rate for G0 commands after resetting the printer, in mm/min
Expand Down
4 changes: 4 additions & 0 deletions src/Duet/Lwip/contrib/apps/mdns/mdns_responder.c
Expand Up @@ -544,7 +544,11 @@ static void setup_hostnames(struct mdns_state *ms, struct netif *netif)
sprintf(ms->hostnames[1], "%c%s-%02X%s", hostlen+3, netif->hostname,
netif->hwaddr[5], dotlocal);

#if 1 // DC42
char macaddr[13];
#else
char macaddr[12];
#endif
sprintf(macaddr, "%02X%02X%02X%02X%02X%02X",
netif->hwaddr[0], netif->hwaddr[1], netif->hwaddr[2],
netif->hwaddr[3], netif->hwaddr[4], netif->hwaddr[5]);
Expand Down
12 changes: 9 additions & 3 deletions src/Duet/Network.cpp
Expand Up @@ -160,8 +160,11 @@ static void ethernet_rx_callback(uint32_t ul_status)

static void conn_err(void *arg, err_t err)
{
// Report the error to the monitor
reprap.GetPlatform().MessageF(UsbMessage, "Network: Connection error, code %d\n", err);
if (reprap.Debug(moduleNetwork) && !inInterrupt())
{
// Report the error to the monitor
reprap.GetPlatform().MessageF(UsbMessage, "Network: Connection error, code %d\n", err);
}

// Tell the higher levels about the error
ConnectionState *cs = (ConnectionState*)arg;
Expand All @@ -179,7 +182,10 @@ static err_t conn_recv(void *arg, tcp_pcb *pcb, pbuf *p, err_t err)
{
if (cs->pcb != pcb)
{
reprap.GetPlatform().Message(UsbMessage, "Network: Mismatched pcb in conn_recv!\n");
if (reprap.Debug(moduleNetwork) && !inInterrupt())
{
reprap.GetPlatform().Message(UsbMessage, "Network: Mismatched pcb in conn_recv!\n");
}
tcp_abort(pcb);
return ERR_ABRT;
}
Expand Down
39 changes: 21 additions & 18 deletions src/DuetM/TMC22xx.cpp
Expand Up @@ -268,6 +268,7 @@ class TmcDriverState
void AppendDriverStatus(const StringRef& reply);
uint8_t GetDriverNumber() const { return driverNumber; }
bool UpdatePending() const { return registersToUpdate != 0; }
bool UsesGlobalEnable() const { return enablePin == NoPin; }

float GetStandstillCurrentPercent() const;
void SetStandstillCurrentPercent(float percent);
Expand Down Expand Up @@ -640,24 +641,27 @@ inline void TmcDriverState::TransferDone()
}
lastIfCount = currentIfCount;
}
else if (sendData[2] == ReadRegNumbers[registerToRead] && ReadRegNumbers[registerToRead] == receiveData[6] && receiveData[4] == 0x05 && receiveData[5] == 0xFF)
else if (driversState != DriversState::noPower) // we don't check the CRC, so only accept the result if power is still good
{
// We asked to read the scheduled read register, and the sync byte, slave address and register number in the received message match
//TODO here we could check the CRC of the received message, but for now we assume that we won't get any corruption in the 32-bit received data
const uint32_t regVal = ((uint32_t)receiveData[7] << 24) | ((uint32_t)receiveData[8] << 16) | ((uint32_t)receiveData[9] << 8) | receiveData[10];
readRegisters[registerToRead] = regVal;
accumulatedReadRegisters[registerToRead] |= regVal;

++registerToRead;
if (registerToRead == NumReadRegisters)
if (sendData[2] == ReadRegNumbers[registerToRead] && ReadRegNumbers[registerToRead] == receiveData[6] && receiveData[4] == 0x05 && receiveData[5] == 0xFF)
{
registerToRead = 0;
// We asked to read the scheduled read register, and the sync byte, slave address and register number in the received message match
//TODO here we could check the CRC of the received message, but for now we assume that we won't get any corruption in the 32-bit received data
const uint32_t regVal = ((uint32_t)receiveData[7] << 24) | ((uint32_t)receiveData[8] << 16) | ((uint32_t)receiveData[9] << 8) | receiveData[10];
readRegisters[registerToRead] = regVal;
accumulatedReadRegisters[registerToRead] |= regVal;

++registerToRead;
if (registerToRead == NumReadRegisters)
{
registerToRead = 0;
}
++numReads;
}
else
{
++readErrors;
}
++numReads;
}
else
{
++readErrors;
}
}

Expand Down Expand Up @@ -903,7 +907,6 @@ namespace SmartDrivers
if (powered)
{
// Power to the drivers has been provided or restored, so we need to enable and re-initialise them

for (size_t drive = 0; drive < numTmc22xxDrivers; ++drive)
{
driverStates[drive].WriteAll();
Expand Down Expand Up @@ -938,11 +941,11 @@ namespace SmartDrivers

if (driversState == DriversState::initialising)
{
// If all drivers have been initialised, set the global enable
// If all drivers that share the global enable have been initialised, set the global enable
bool allInitialised = true;
for (size_t i = 0; i < numTmc22xxDrivers; ++i)
{
if (driverStates[i].UpdatePending())
if (driverStates[i].UsesGlobalEnable() && driverStates[i].UpdatePending())
{
allInitialised = false;
break;
Expand Down

0 comments on commit d0505c8

Please sign in to comment.