Lichtwerkstatt/XRTL_Hardware

Recover stepper positions after restart

Opened this issue · 1 comments

doomke commented

Right now the position of the stepper motors is only written to flash memory after setup, which means changes to the position made during operation are lost if the power is cut or a restart happens.

However, writing the position to flash for every movement is probably not a good idea as it would wear out the flash memory rather quickly. We need to find a solution that ensures the position is saved at least every now and then or when instructed, without negatively impacting the life span of our microcontrollers.

  • regularly, but not frequently save positions if they changed
    OR
  • add interface to save positions manually. Warn users about impact.
doomke commented

stepper motors now react on a "manualSave":true command, writing their current position to the flash. This command can in theory be extended to other modules like servo, macro and output.