Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    OnHomingSwitchTriggered

    Firmware developers
    2
    3
    75
    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.
    • niku
      niku last edited by

      I am trying to get OnHomingSwitchTriggered running while prototyping custom firmware and im having problems with getting the dda.SetDriveCoordinates working. Activating usb debug mode, the firmware log tells me that the cartesian values are always set to nan,nan,nan. Any idea of what I am doing wrong?

      Also, how do I save the homing position in to an array when the homing switch is triggered? How do I get my hands on the the machinePos and motorPos coordinates in the function OnHomeingSwitchTriggered?

      dc42 1 Reply Last reply Reply Quote 0
      • dc42
        dc42 administrators @niku last edited by

        @niku said in OnHomingSwitchTriggered:

        I am trying to get OnHomingSwitchTriggered running while prototyping custom firmware and im having problems with getting the dda.SetDriveCoordinates working. Activating usb debug mode, the firmware log tells me that the cartesian values are always set to nan,nan,nan. Any idea of what I am doing wrong?

        The Cartesian values are calculated by the kinematics class in use, and use the steps/mm values. What kinematics have you selected, and what steps/mm have you declared using M92 commands in config.g?

        Also, how do I save the homing position in to an array when the homing switch is triggered? How do I get my hands on the the machinePos and motorPos coordinates in the function OnHomeingSwitchTriggered?

        The DDA is passed as a parameter to OnHomingSwitchTriggered, and it contains the endPoint array (the motor positoins) and the endCoordinates array (that Cartesian position). The endPoint array can be read via function DriveCoordinates, and endCoordinate elements can be retrieved via function GetEndCoordinate.

        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
        • niku
          niku last edited by

          The kinematics selected is code modded from the hangprinterkinematics. The code is now includes some changed functionality for a 4 wire machine and other things I am experimenting with. For testing purposes, I added the new kinematics to position M669 K13.
          I will ask for instructions in how to add the kinematics to the repo when I get the code ready and tested 🙂 The machine seems to be moving as it should(not taking homing into account) and steps/mm is set to 100 at the moment. Homing mode is homeIndividualMotors.

          And cool thanks, I'll check the DDA endPoint array, I am trying to get the machine to automatically calculate its dimensions by using the stallguard functionality.

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