Skip to content

Commit d85d8a5

Browse files
authored
Merge pull request #2 from AFRL-ARES/PrusaFirmwareUpdate
2 parents 2e70f05 + 7179988 commit d85d8a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

PrusaMK4S/PrusaMK4s.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class PrusaMK4s : AresUSBDevice, IPrusaMK4S
2020
private readonly ISubject<HttpResponseMessage?> _stateSubject = new BehaviorSubject<HttpResponseMessage?>(default);
2121
private CancellationTokenSource _internalStateUpdaterTokenSource = new();
2222
private Task? _stateUpdater;
23+
private readonly string _inputShaperCommand = "M862.6 P\"Input shaper\"";
2324

2425
private string _stateRequestAddress = string.Empty;
2526

@@ -223,10 +224,10 @@ public async Task<MK4SRequestResponse> MovePrinter(int x, int y, int z, int dwel
223224
PrintDelay = dwell;
224225

225226
if(dwell > 0)
226-
movementCommand = $"G90 \n G1 X{x} Y{y} Z{z} F9000 \n G4 S{dwell}";
227+
movementCommand = $"{_inputShaperCommand} \n G90 \n G1 X{x} Y{y} Z{z} F9000 \n G4 S{dwell}";
227228

228229
else
229-
movementCommand = $"G90 \n G1 X{x} Y{y} Z{z} F9000";
230+
movementCommand = $"{_inputShaperCommand} \n G90 \n G1 X{x} Y{y} Z{z} F9000";
230231

231232
var movementRequest = CreateMovementRequest(Encoding.UTF8.GetBytes(movementCommand));
232233
var result = await _httpClient.SendAsync(movementRequest);
@@ -264,7 +265,7 @@ public async Task<MK4SRequestResponse> HomePrinter()
264265
return response;
265266
}
266267

267-
var request = CreateHomeRequest(Encoding.UTF8.GetBytes("G28"));
268+
var request = CreateHomeRequest(Encoding.UTF8.GetBytes($"{_inputShaperCommand} \n G28"));
268269
var result = await _httpClient.SendAsync(request);
269270

270271
while(IsPrinting || IsBusy)

0 commit comments

Comments
 (0)