• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Newbie

Scheduled Pinned Locked Moved
Firmware developers
3
6
980
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Trampas
    last edited by 20 Oct 2017, 15:21

    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.

    thanks
    Trampas

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by 20 Oct 2017, 17:25

      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.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • undefined
        Trampas
        last edited by 20 Oct 2017, 17:35

        Have you picked out an RTOS?

        1 Reply Last reply Reply Quote 0
        • undefined
          dc42 administrators
          last edited by 20 Oct 2017, 18:55

          It will almost certainly be FreeRTOS.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • undefined
            Captain_sq
            last edited by 6 Jan 2018, 07:50

            @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?

            Custom made Kossel Mini - Duet WiFi / Modded Tronxy X5S - Duet WiFi / Prusa i3 MKIII


            Embedded systems designer, RC Pilot, maker and Gadget-o-holic

            1 Reply Last reply Reply Quote 0
            • undefined
              dc42 administrators
              last edited by 6 Jan 2018, 08:11

              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.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA