• First I want to thank you guys for all the hard work and excellent coding that was put into this project.

    I am looking through the source code, starting to understand what is going on, specifically with with respects to bed leveling. A

    As I understand the code for bed leveling a state machine runs in the Gcodes:Spin() function which handles the moves related to bed leveling. As I understand the code, please correct me if I am wrong:

    1. The GCodes class basically fills in a RawMove structure for the next move
    2. the Move class then consumes the RawMove structure and issues the movement

    For bed leveling the GCodes:Spin() state machine is used to handle the multiple moves required for bed leveling. I was wondering (again assuming my understanding is correct) if it would be cleaner to have middle layer, kind of a motion planner, which would do the bed leveling state machine. Again since I am a newbie to the code and based on the nice level of abstraction already done I assume this was thought of and was not done for some reason hence I wanted to understand more.


  • administrators

    The old 3, 4 and 5 point bed levelling used to be done by separate code, which behaved like a state machine but wasn't written like one. Having multiple state machines was confusing. So I reduced it to a single a state machine, which IMO is much clearer.

    I intend to migrate RRF to use a RTOS on the Generation 2 Duets and their successors. This will mean that every GCode source has its own thread, and the state machine will no longer be needed. So the code will be clearer. This was originally scheduled to happen in RRF 1.20, but various user demands for new features (e.g. stall detection) have postponed it to version 1.21.

  • Have you picked out an RTOS?

  • administrators

    It will almost certainly be FreeRTOS.

  • @dc42:

    It will almost certainly be FreeRTOS.

    Good choice, and very reliable. Richard Barry is also a very helpful and competent man. The manual is especially well written with example code.
    All my STM32L1xx/STM32L4xx products are based on it. Which version will you go for?

  • administrators

    Confirmed, it will be FreeRTOS. It's small, well-documented, and the source code is MISRA-compliant. I have started work on adapting RRF to use it already. I am using version 10.0.0.

Log in to reply