Remotely controlling the Huanyang VFD with LinuxCNC over RS485 Modbus

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • Get a Motor + VFD set: bit.ly/2IO0cP5
    1. Get a couple of those cheat RS485 USB Adapters
    2. Connect to VFD with a twisted pair cable
    3. Configure the VFD like this:
    PD001 = 2
    PD002 = 2
    PD163 = 1
    PD164 = 1
    PD165 = 3
    4. Make a fresh LinuxCNC config without any spindle pins
    5. Put into the custom.hal:
    loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600
    net spindle-cmd-rpm-abs =▷ vfd.speed-command
    net spindle-cw motion.spindle-forward =▷ vfd.spindle-forward
    net spindle-ccw motion.spindle-reverse =▷ vfd.spindle-reverse
    net on motion.spindle-on =▷ vfd.spindle-on
    7. Change the ▷to pointy brackets which youtube wont let me put in my description ...
    8. Put into the custom_postgui.hal:
    setp vfd.enable 1
    Seems like it's been a little bit foggy when these videos were shot...

ความคิดเห็น • 39

  • @eemaniac
    @eemaniac 3 ปีที่แล้ว +13

    Thanks for your video. This was great to get me started although I found that LinuxCNC v2.8 has change a little in that you can now have multiple spindles, so you need to specify which spindle to control. custom.hal changes as follows:
    loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600
    net spindle-cmd-rpm-abs => vfd.speed-command
    net spindle-cw spindle.0.forward => vfd.spindle-forward
    net spindle-ccw spindle.0.reverse => vfd.spindle-reverse
    net on spindle.0.on => vfd.spindle-on
    Hope this helps someone!

  • @billstrahan4791
    @billstrahan4791 4 ปีที่แล้ว +4

    Thanks so much! I just got my spindle working with LinuxCNC and this video made it very straightforward. I appreciate you taking the time to do this!

    • @johnross3752
      @johnross3752 4 ปีที่แล้ว

      ? Did you ave to conect Ground wire..Can it do fwr-rev , start-stop

    • @billstrahan4791
      @billstrahan4791 4 ปีที่แล้ว

      @@johnross3752 On mine the ground was wired to the 4th pin on the plug already. It has full control from Linuxcnc. Spindle on-forward on-reverse, and RPM. It's perfect.

  • @johnhopkins8716
    @johnhopkins8716 7 ปีที่แล้ว +2

    Great video, thanks for sharing. I can now control my 2.2kw spindle directly from Linux CNC.

  • @Jonas_Aa
    @Jonas_Aa 4 ปีที่แล้ว +2

    Tip is to use /dev/serial/by-id/foo so never have to worry if USB0 changes to something else.

  • @arno8312
    @arno8312 7 ปีที่แล้ว +1

    Awesome video with every needed tips. My new spindle was ready to work in less than 10mn. many thanks !

    • @odinfranklin2656
      @odinfranklin2656 3 ปีที่แล้ว

      i know im asking the wrong place but does anyone know a tool to log back into an instagram account?
      I was stupid lost the account password. I would love any help you can give me!

    • @finnesteban2313
      @finnesteban2313 3 ปีที่แล้ว

      @Odin Franklin instablaster :)

    • @odinfranklin2656
      @odinfranklin2656 3 ปีที่แล้ว

      @Finn Esteban Thanks for your reply. I found the site thru google and im trying it out now.
      I see it takes quite some time so I will reply here later when my account password hopefully is recovered.

    • @odinfranklin2656
      @odinfranklin2656 3 ปีที่แล้ว

      @Finn Esteban it worked and I actually got access to my account again. Im so happy:D
      Thanks so much, you really help me out :D

    • @finnesteban2313
      @finnesteban2313 3 ปีที่แล้ว

      @Odin Franklin Glad I could help xD

  • @matter9
    @matter9 ปีที่แล้ว

    Excellent I’m looking forward to trying this!

  • @daxur89
    @daxur89 6 ปีที่แล้ว +1

    Good day, I need to control a spindle speed from a CNC milling machine, the machine have a parallel port board for the stepper motors, and apparently that especific board does not emit an analog signal to use with the VFD, do you know how can I solve this problem without removing the board the machine already has?

  • @vladdaniel864
    @vladdaniel864 8 ปีที่แล้ว +1

    i get an error on the dev part. u change the ttyusb to /dev/ttyS0 because i have a rs232 to 485 converter.

  • @saldot79
    @saldot79 8 ปีที่แล้ว +2

    Thanks alot for the guide!
    I followed tour guide and while it worked in windows using spindle talker 2 it didn't work in LinuxCNC.
    Got an error message:
    ERROR Communication time out (-12)
    error reading settings from VFD, retrying
    WAIT_DATA(): comms timeout
    After a few nights of troubleshooting and watching your video about 10 more times I decided to replace the USB->rs485 adapter which solved the issue. (doh)

  • @randyluckini2866
    @randyluckini2866 7 ปีที่แล้ว

    Thanks for posting. I have 2.7.8 Linuxcnc, Mesa system. Trying to get a cnc mill up and running. I am running servo encoder system. I am new to linuxcnc. is there a copy of the files needed to run this VFD or do I need to somehow make the ini, hal files? I see you used stepconfig to generate your files. I am not sure if I need to use pncconf wizard (and if I do.. I am lost in the instructions). all my current files have been copied from a linuxcnc member with the same machine with postgui.hal

  • @MrStarTraveler
    @MrStarTraveler 2 ปีที่แล้ว +2

    The custom.hal script, as shown in the video, will not work for LinuxCNC 2.8+ (at least it didn't for me)
    This is how it should look now:
    loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600
    net spindle-cmd-rpm-abs => vfd.speed-command
    net spindle-fwd spindle.0.forward => vfd.spindle-forward
    net spindle-rev spindle.0.reverse => vfd.spindle-reverse
    net on spindle.0.on => vfd.spindle-on
    The main change is: "motion.spindle-forward/reverse/on" becomes "spindle.0.forward/reverse/on".
    The most shocking thing was that I couldn't actually control the speed before I changed spindle-cw/ccw to spindle-fwd/rev. I could only start and stop the spindle before that. It was a shot in the dark. I didn't believe it would change anything but it did.
    P.S. Always use filtered USB cables! (As shown in the video) Those USB-to-RS485 adapters glitch out even if you sneeze at them.

    • @MrStarTraveler
      @MrStarTraveler ปีที่แล้ว

      Ah! We're at it again! in 2.10.0 spindle doesn't fully work again. I can only turn it on and off, and control the direction. No speed control once more. I tried to return the spindle-fwd/rev back to spindle-cw/ccw but it didn't help. I'm at a loss again.

    • @MrStarTraveler
      @MrStarTraveler ปีที่แล้ว

      YESSSS !!! I GOT IT RUNNING !!!
      I used an ancient spell, called: Looking at the documentation. XD Gee, who knew the documentation might have some answers for me. XD
      So now that I got the self deprecating humor out of the way let me describe how I got it to work:
      Firs my old custom.hal:
      loadusr -Wn vfd hy_vfd -n vfd -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -p none -r 9600
      net spindle-cmd-rpm-abs => vfd.speed-command
      net spindle-fwd spindle.0.forward => vfd.spindle-forward
      net spindle-rev spindle.0.reverse => vfd.spindle-reverse
      net on spindle.0.on => vfd.spindle-on
      those net things are actually variables of type net. So lets take the second line: We have a variable of type net with name spindle-fwd and since net means connection the value of this variable is going to be two things: connecting what to what. In this case, the source signal spindle.0.forward to (=>) the VFD component vfd.spindle-forward. Notice however the first line does not follow this format. It seems that spindle-cmd-rpm-abs is both the name of the variable and the source signal?! I don't know how that worked before but apparently it doesn't any more. So after consulting with the documentation I tried replacing the first net with:
      net spindle-speed-cmd spindle.0.speed-out => vfd.speed-command
      this worked, the +/- buttons appeared and they were correctly controlling the speed. Also the spindle started responding to the MDI commands in linuxcnc. One small hick up was that the RPM panel that I've setup in linuxcnc didn't show the RPM. But I knew why. The GUI panel is an XML script that indirectly depends on the variable spindle-cmd-rpm-abs which in this case is replaced by spindle-speed-cmd so I either had to change the name of the variable in two different files or just:
      loadusr -Wn vfd hy_vfd -n vfd -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -p none -r 9600
      #type, name val: source -> destiantion
      net spindle-cmd-rpm-abs spindle.0.speed-out => vfd.speed-command
      net spindle-fwd spindle.0.forward => vfd.spindle-forward
      net spindle-rev spindle.0.reverse => vfd.spindle-reverse
      net on spindle.0.on => vfd.spindle-on
      As you can see I just plugged the spindle.0.speed-out at the appropriate place in the old line that was controlling the spindle speed.
      And that fixed it!
      Hope that helps!
      :)

  • @16siemon
    @16siemon 6 ปีที่แล้ว

    But you dont compare the actual rpm since the spindle will slow down under load from what i can see? Or am i missing something

  • @loiclecourtois1745
    @loiclecourtois1745 7 ปีที่แล้ว

    Bonjour es ce que c'est compatible avec linuxcnc2.5 ?
    Merci

  • @grantlesueur
    @grantlesueur 7 ปีที่แล้ว

    Gut gemacht. Does it mean that Linus cnc would pass M3 spindle on, M5 spindle off, and Snnn speed commands interpreted from GCode or is your implementation just to remote control from the screen.

    • @reps
      @reps  7 ปีที่แล้ว

      Interprets gcode too!

    • @grantlesueur
      @grantlesueur 7 ปีที่แล้ว

      ***** could you share the modbus registers you read and write and what each value means. VFD documentation is terrible. Or share PM me the data map.

  • @vladdaniel864
    @vladdaniel864 8 ปีที่แล้ว

    ok got to work. my fault wrong typing.now the rpm is off i type M3S1000 and it gives me 8007rpm.

  • @jthadcast
    @jthadcast 8 ปีที่แล้ว

    Thanks for posting will try it. I have 0 exp with linux coding so could you explain the $ 1s /dev/ttyUSB* that pops up at 3.00 mark, is the $ 1s the (Wn vfd hy_vfd -n vfd -d) is that a 'component' in the default linuxcnc with ubuntu 10.x? Linuxcnc fails to load and I get errors with line 4 loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0
    Works great with fresh wheezy install!

    • @reps
      @reps  8 ปีที่แล้ว

      Thats an L, not a 1 :)
      $ ls /dev/ttyUSB* lists all USB telecommunication devices such as RS485 adapters. If there are multiple, ttyUSB0 might the the wrong one.
      And I would recommend a fresh installation, because the ubuntu 10.04 image is too old.

    • @jthadcast
      @jthadcast 8 ปีที่แล้ว

      thanks I will try another as I just use a live disc, which "image" do you use ubuntu, someone told me linuxcnc 2.7 only works with 10.04?

    • @reps
      @reps  8 ปีที่แล้ว

      Debian Wheezyfrom the linuxcnc website: www.linuxcnc.org/linuxcnc-2.7-wheezy.iso

  • @andersmeiniche2746
    @andersmeiniche2746 ปีที่แล้ว

    At least you got some with the crystal in them ;) i bought 10 and not one of them got the crystal 12M :(

  • @JurassicLures
    @JurassicLures 7 ปีที่แล้ว

    Hey Will it work with Huanyang VFD HY01D523B ?

    • @reps
      @reps  7 ปีที่แล้ว

      Dunno, but I think it will! Why should they implement the RS485 differently for that unit

    • @JurassicLures
      @JurassicLures 7 ปีที่แล้ว

      Hey, can u help me with my VFD configure? drive.google.com/open?id=0B6mwFaph3DUmS1JueEZFZ1JaX2s link to my VFD ebook .

    • @reps
      @reps  7 ปีที่แล้ว

      Tried this? make-a-project.blogspot.de/2013/05/connecting-huanyang-hy01d523b-vfd-speed.html

  • @gacherumburu9958
    @gacherumburu9958 6 ปีที่แล้ว

    👍👍👍

  • @blejarodjaci
    @blejarodjaci 5 ปีที่แล้ว

    Everything you wanted to know about Modbus:
    www.chipkin.com/files/liz/MODBUS_2010Nov12.pdf