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

Direction Control in RRF

Scheduled Pinned Locked Moved
CNC
5
8
585
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
    NineMile
    last edited by 17 Jun 2024, 11:26

    I've used my VFD for a while with only forward-run in RRF and it's worked great. Testing some things recently and now I realise direction control in RRF appears to be incompatible with my particular VFD (Inovance MD200-NC). As far as I can tell, a 3 pin configuration in RRF for the spindle will treat the second pin as ENABLE and the third pin as DIRECTION - where direction is pulled high or low depending on forward or reverse being selected.

    Unfortunately, my VFD doesn't appear to be configurable to allow this style of control - it expects either a FORWARD RUN or a REVERSE RUN signal, if it receives both it stops.

    I haven't seen a way to configure RRF output as FORWARD or REVERSE output, and likewise I also haven't found a setup on my VFD that allows it to take a 'direction' input in the way that RRF intends.

    Am I missing something? Or should this be a feature request on the RRF repo?

    undefined 1 Reply Last reply 17 Jun 2024, 20:21 Reply Quote 0
    • undefined
      hurzhurz @NineMile
      last edited by hurzhurz 17 Jun 2024, 20:21

      @NineMile Actually, it works in the way you need it, with separate run-pins for forward and reverse:

      M950 R0 C"pwm_pin+forward_pin+reverse_pin" Qfff Laa:bb
      

      (see example in the GCode dictionary under "M950 / Configuration examples and notes / Spindles")

      undefined undefined 2 Replies Last reply 17 Jun 2024, 20:40 Reply Quote 0
      • undefined
        gloomyandy @hurzhurz
        last edited by 17 Jun 2024, 20:40

        @hurzhurz Nope looking at the code: https://github.com/Duet3D/RepRapFirmware/blob/3.5-dev/src/Tools/Spindle.cpp#L127 I'd say that @NineMile is correct, the first pin is used as enable and the second pin is used as the direction.

        undefined 1 Reply Last reply 17 Jun 2024, 20:59 Reply Quote 0
        • undefined
          hurzhurz @gloomyandy
          last edited by 17 Jun 2024, 20:59

          @gloomyandy Oh ok, you are right. And now I see it is actually discribed that way in the documentation, dispite the pin-name examples suggest it is like the way I thought it is.
          Well, and my own VFD also has forward-run and reverse-run inputs... maybe it doesn't care if both are active and gives priority to the reverse input.

          Maybe the implementation in RRF is not that optimal?

          @NineMile maybe you can build a little circuit with a logic gate to convert the signal

          1 Reply Last reply Reply Quote 0
          • undefined
            droftarts administrators @hurzhurz
            last edited by 17 Jun 2024, 21:01

            @hurzhurz If you read the description right under the part you quoted, you'll see that's not the case. I've changed the pin names to:

            M950 R0 C"pwm_pin + on/off_pin + forward/reverse_pin" Qfff Laa:bb
            

            This was also discussed here, and I tested it: https://forum.duet3d.com/post/329316

            @NineMile As to why it's like this, I expect when it was implemented this was the way whoever requested it wanted it. Raise an issue for the alternative, though I can see a problem trying to switch two pins at the same time, or having to have a pause between switching one off and the other on.

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            undefined 1 Reply Last reply 18 Jun 2024, 08:38 Reply Quote 0
            • undefined
              NineMile @droftarts
              last edited by NineMile 18 Jun 2024, 08:38

              @droftarts Thanks, I'll put in a feature request.

              For what it's worth I think I'll modify a local build and see if the pin switching thing will be an issue in my particular use-case, but I suspect the timing is not an issue - if both forward and reverse are active then the spindle won't turn but it does not put the VFD into a fault state, and as soon as one of the directions are deactivated then the spindle will start spinning in the direction that is still active (and will decelerate to a stop before changing direction).

              ETA: Confirmed, on my VFD at least there is no timing concern if the pins are not switched at the same time / there is no set delay - the spindle will just stop if both are active at once.

              undefined 1 Reply Last reply 2 Jul 2024, 15:53 Reply Quote 1
              • undefined
                timschneider @NineMile
                last edited by 2 Jul 2024, 15:53

                @NineMile
                in the meantime you can try to use the 3-wire interface of most VFD's

                https://forum.duet3d.com/post/328945

                undefined 1 Reply Last reply 10 Jul 2024, 09:34 Reply Quote 0
                • undefined
                  NineMile @timschneider
                  last edited by 10 Jul 2024, 09:34

                  @timschneider Thanks for this - I haven't quite decoded how the 3-wire setup works on my particular VFD yet but when I do, I might give it a shot.

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