[ Log In ]
[ Register ]

Question #: 13273

Question: Can the spindle speed and direction be conrolled by LinuxCNC?

Current Solution

LinuxCNC has excellent documents; however, I would like to offer our help in case you don't understand the information on that page. So, please use this FAQ (Question #: 13233) to state your questions by submitting additional information below.

The LinuxCNC spindle control page is found here: http://linuxcnc.org/docs/html/examples/spindle.html

Additional Information:
After reading the LinuxCNC page my first questions would be can the spindle be controlled by PWM signal? Also, what pin on the parallel port would I set to Spindle Enable and FRW?

Additional Information:
To connect your computer to the VFD, use a USB to RS-485 interface. RS-485 is just a serial interface protocol that uses standard 0 to +5 voltage TTL signal levels for communication (as opposed to RS-232 which uses -12v and +12 for signal level changes).

Get a high quality interface to reduce any issues during the process. The VFD should have two terminals labeled RS+ and RS-. The USB to RS-485 adapter should have this labeled on it as well so the connections should be relatively straight forward.

In the VFD parameters:
PD001: 2 to accept RS485 commands
PD002: 2 to accept frequency comands
PD163: 1 to RS485 slave address:1
PD164: 1 RS485 baud rate 9600
PD165: 3 8bit, no parity, 1 stop bit

Make sure LinuxCNC is also set accordingly:

The PIN14 and PIN16 in the stepconf wizard should be set to unused because you don't want LinuxCNC to be outputting unnecessary signals.

In the options step of the stepconf wizard:
- Check the Include Halui user interface component.
- Check the Include custom PyVCP GUI panel.
- Check Spindle speed display

You will want to edit the custom.hal text file located in the folder that was created from the stepconf wizard. Add these following lines:
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

The dev folder in linux is typically used for interfacing devices and peripherals to the computer as these devices are communicated by simple memory addresses and these files are linked directly to these addresses.

Under the custom_postgui.hal file, change this line:

from: sets spindle-at-speed true
to: net spindle-at-speed => cfd.spindle_at_speed

and add the line:

setp vfd.enable 1

When you start LinuxCNC, you will a spindle section with the reverse and forward buttons, a stop button and - and + buttons. Use these buttons to conform that the spindle is functioning properly. The spindle speed indicator in LinuxCNC will show the spindle speed and you can confirm that this is equal to the speed indicated on the VFD.


Credit for this helpful information goes to:


Additional information was also added by us to provide a better understanding.

Additional Information:
linuxcnc利用MACH3 接口板 BL-MACH-V1.1的一路经光耦隔离的 0-10V 模拟电压输出,可以控制具有相应模拟接口的变频器,控制主轴转速。输出口为 P1 口,如何利用这个p1口与变频器进行接线来控制主轴转速,并对hal文件配置代码进行书写

Respond:

Other Possible Solutions to this Question

  • MOTOR GOING TWO DIRECTION WHEN JUST PUSH UP. IT WILL GO DOWN AND THEN GOES AGAIN UP WITH THE SAME BUTTON.

    Try slowing your feedrate down and increasing spindle RPMs. End-mills will leave a poor finish if you go too fast. Make sure your cutting depth isn't too much. Maybe the endmill or cutter is blunt? Could it be the feed direction of the cutter? Some materials need to be fed in a certain direction.

    Click the link to add information to this solution:
    MOTOR GOING TWO DIRECTION WHEN JUST PUSH UP. IT WILL GO DOWN AND THEN GOES AGAIN UP WITH THE SAME BUTTON.

  • I HAVE THE REDFLY SYSTEM AND A 2.2KW SPINDLE - 110V HOW DO CONNECT SPINDAL?

    It is not necessary to connect the spindle VFD (Variable Frequency Drive also called an Inverter) to the computer or CNC motion electronics. The VFD can be controlled independently using the control panel on the VFD. The control panel has the ability to control all aspects of the spindle including Speed, Torque, limits, etc. However, you can connect the VFD to the computer so the CNC control program can control the spindle during the CNC Machine operation. You will need to connect the VFD to the computer via a serial conection (in this case, it is the RS-485 protocol).

    The following are instructions on how to connect the VFD to Mach3 via this RS-485 serial connection.

    The first thing you will need is the dynamic link library to pair with mach3 called the Huanyang VFD Mach3 PlugIn. You can find this file at the mach3 support forum here: http://www.machsupport.com/forum/index.php/topic,14182.0.html

    You will also need to download the Microsoft .net 3.5 framework and install it: https://www.microsoft.com/en-us/download/details.aspx?id=21

    Follow the pdf that comes with the library file, but here is a synopsis of what you need to do (I also added a lot more information that may be useful during this process as the manual does not cover the main connections that need to be done):

    You will need to program your VFD so that it knows how to communicate with mach3 and the computer (go into the programming mode of the VFD and change these parameters):
    - PD001 - value 2 - Enables with communication aspect of the VFD
    - PD002 - value 2 - Enables frequency control from the communcations port
    - PD163 - value 1 - VFD address
    - PD164 - value 1 - Baud rate of 9600 (speed of the communication)
    - PD165 - value 3 - 8N1 RTU - 8 bits (that's the size of the word that gets communicated), N (No parity or no error checking) and 1 (1 stop bit)

    Copy the dll file to the PlugIns folder of mach3.

    Connect the RX and TX lines to your computer. There are a couple ways you can do this, but the recommended way would be to use an FTDI USB device which converts a USB to a serial com port. The device will have Rx and Tx connectors to connect to the VFD terminals with the same labels. This method is recommended since serial ports are not as common in computers these days.

    Next, you will need to configure mach3 to use the plugin library. Start mach3 and click on Menu -> config ->Config Plugins. Enable the new plugin by clicking on the red cross on the left column next to the plug in. Restart mach3 after doing this.

    No you need to configure mach3 to use the HuanyangVFD plugin. Go to the ports & pins configuration and select the spindle setup tab. Make sure that the Disable Spindle Relays checkbox is unchecked. We don't want mach3 to output a signal for a relay since the spindle will start up and turn off within the VFD and not from an external relay.

    Next, go to the HuanyangVFD settings by clicking on Menu -> plugin control -> HuanyangVFD. Set the parameters to the same settings you put into the VFD programming. The com port will be shown as new hardward when you plug in the USB FTDI device. A little bubble will be displayed at the bottom right where it will notify you that a new device is being installed (be patient while windows assigns a com port). Alternatively, you can use the windows device manager to see which port was set for the new USB FTDI device). You may need to restart mach3 several times until you get the correct information displayed in the PD001 and PD002 fields. When the com port is correct and the other parameters, like baud and VFD address is the same as you entered in the programming, then the PD001 and PD002 will show the number 2, otherwise, a 99 will appear which means that communication was not successful.

    You can now control the on/off and RPM of the spindle using the RS485 communication between mach3 and the VFD.

    Additional Information:
    The question was how to connect the spindle to the redfy. I did not receive a VFD.
    I have the redFly system and a 2.2kW Spindle - 110V how do i connect the spindle?

    Additional Information:
    If you received a spindle without a VFD, please contact us asap. Our spindle will not work without a VFD.

    Additional Information:
    Hi, how is this setup in mach4?

    Click the link to add information to this solution:
    I HAVE THE REDFLY SYSTEM AND A 2.2KW SPINDLE - 110V HOW DO CONNECT SPINDAL?

  • CAN YOU GIVE ME SOME HELP OR POINT IN THE RIGHT DIRECTION TO INCORPORATE MK 7 EXTRUDER WITH BOOK PLANS FOR 3D PRINTER?

    Mounting the extruder to the whiteAnt can be done a couple of ways. One is to take the 4 mounting holes located at the lower portion of the z-axis rail support and use long screws protruding out. Take a thinner material and drill the four holes matching the locations of the 4 screws and screw on nuts to hold it in place. The other option would be to use the metal bracket and fasten to the edge of the rail support.

    Click the link to add information to this solution:
    CAN YOU GIVE ME SOME HELP OR POINT IN THE RIGHT DIRECTION TO INCORPORATE MK 7 EXTRUDER WITH BOOK PLANS FOR 3D PRINTER?

  • I’M LOOKING TO PURCHASE SPINDLE AND VFD WAS CURIOS IF THE SPINDLES COME WITH COLLETS SO WHICH ONES?

    Yes, all of the spindles come with collets. The collets have a 1/4" (6.35mm) bore for end mills that have a 1/4" shank. The ER specification is different for the 1.5kW (ER-11) and the 2.2kW (ER-20).

    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    I’M LOOKING TO PURCHASE SPINDLE AND VFD WAS CURIOS IF THE SPINDLES COME WITH COLLETS SO WHICH ONES?

  • WHAT ARE THE OUTPUT INVERTER (VFD) CONNECTIONS TO SPINDLE?

    U - Pin1
    V - Pin2
    W - Pin3
    Pin4 Dead

    Additional Information:
    My home made cnc is a big problem with my NC connection. When in start my spindle it will be gone wrong. It will be limith switch problem anytime. Need help thanks.

    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    WHAT ARE THE OUTPUT INVERTER (VFD) CONNECTIONS TO SPINDLE?

  • HOW MUCH SILICONE TUBE DO I NEED FOR A GREEN LEAN TO CONNECT THE SPINDLE

    The greenlean requires 56 feet of 1/4 Inside Diameter and 3/8 Outside Diameter silicon tube for the spindle.

    Additional Information:
    20

    Additional Information:
    20

    Click the link to add information to this solution:
    HOW MUCH SILICONE TUBE DO I NEED FOR A GREEN LEAN TO CONNECT THE SPINDLE

  • WHAT ARE THE SPINDLE INVERTERS (VFD) INPUT AC CONNECTIONS FROM WALL OUTLET?

    Input to VFD:
    240V Active - R
    240V Neutral - S
    Ground - E

    Additional Information:

    Click the link to add information to this solution:
    WHAT ARE THE SPINDLE INVERTERS (VFD) INPUT AC CONNECTIONS FROM WALL OUTLET?

  • HOW CAN THE ROUTER BE CONTROLLED BY COMPUTER?

    The parallel breakout board has a relay that can turn the router on and off according to the control software in the computer. The router will turn on automatically prior to the machine moving (a time frame can be set so the router is up to speed). When the machine is finished and is not moving, the router automatically turns off. This is with the m3, m4, and m5 codes in the g-code.

    If you are interested in the USB breakout board, you will need to get an independent relay board.

    Click the link to add information to this solution:
    HOW CAN THE ROUTER BE CONTROLLED BY COMPUTER?

  • DOES THE SPINDLE RUN ON A 50HZ POWER SOURCE?

    The spindle inverter (VFD) will run on a 220V (or between 170V-250V) power source with either 50Hz or 60Hz.

    Click the link to add information to this solution:
    DOES THE SPINDLE RUN ON A 50HZ POWER SOURCE?

  • HOW DO YOU HOOK UP THE SPINDLE TO INVERTER?

    U - Pin1
    V - Pin2
    W - Pin3
    Pin4 Dead

    Additional Information:
    My home made cnc is a big problem with my NC connection. When in start my spindle it will be gone wrong. It will be limith switch problem anytime. Need help thanks.

    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    HOW DO YOU HOOK UP THE SPINDLE TO INVERTER?

  • LENGTH OF THE BRUSH STRIP FOR SPINDLE 2.2KW

    The total length of the brush strip for a 2.2kW spindle would be 17 1/4" inches.

    Additional Information:
    20

    Click the link to add information to this solution:
    LENGTH OF THE BRUSH STRIP FOR SPINDLE 2.2KW

  • HOW DO YOU SETUP THE SPINDLE INVERTER VFD?

    Change PD001 Source of Run Commands to '1'
    Change PD005 Max operating frequency to 400hz
    Change PD004 base frequency to 400hz
    Change PD003 Main frequency to 400hz
    Change PD006 Intermediate frequency to 2.5
    Change PD008 max voltage to 220v
    Change PD009 Intermediate voltage to 15v
    Change PD010 Min voltage to 8
    Change PD011 frequency lower limit to >100hz (120hz to start)
    Change PD142 7 Amps
    Change PD143 2
    Change PD144 3000

    Note: PD001 had to be changed back to 0 to allow for keypad control.
    Note2: I had to reverse U and V to get the spindle to go forward in FWD. (reverse any two wires, u&v or w&v for example)

    Additional Information:

    Click the link to add information to this solution:
    HOW DO YOU SETUP THE SPINDLE INVERTER VFD?

  • HOW DO YOU HOOK UP THE VFD TO SPINDLE?

    U - Pin1
    V - Pin2
    W - Pin3
    Pin4 Dead

    Additional Information:
    My home made cnc is a big problem with my NC connection. When in start my spindle it will be gone wrong. It will be limith switch problem anytime. Need help thanks.

    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    HOW DO YOU HOOK UP THE VFD TO SPINDLE?

  • HOW DO YOU SETUP THE SPINDLE INVERTER?

    Change PD001 Source of Run Commands to '1'
    Change PD005 Max operating frequency to 400hz
    Change PD004 base frequency to 400hz
    Change PD003 Main frequency to 400hz
    Change PD006 Intermediate frequency to 2.5
    Change PD008 max voltage to 220v
    Change PD009 Intermediate voltage to 15v
    Change PD010 Min voltage to 8
    Change PD011 frequency lower limit to >100hz (120hz to start)
    Change PD142 7 Amps
    Change PD143 2
    Change PD144 3000

    Note: PD001 had to be changed back to 0 to allow for keypad control.
    Note2: I had to reverse U and V to get the spindle to go forward in FWD. (reverse any two wires, u&v or w&v for example)

    Additional Information:

    Click the link to add information to this solution:
    HOW DO YOU SETUP THE SPINDLE INVERTER?

  • I PURCHASED A VFD AND SPINDLE FROM FRIEND, HIS SET UP IS 220. DON'T HAVE 220 IN MY SHOP. QUESTION CAN USE YOUR 110 WITH THIS SPINDLE??

    Depending if the spindle can work with this specific VFD, it might be possible. However we would not like to risk you working unit, with a possible match so we would like more details on your specific model and any information available on the spindle itself.

    Response
    The only info on the spindle is 2.2KW 400HZ 220V. Made by Zhong Hua Jiang.

    Was originally on a Delta C200 vfd. That is 220 single phase.

    Click the link to add information to this solution:
    I PURCHASED A VFD AND SPINDLE FROM FRIEND, HIS SET UP IS 220. DON'T HAVE 220 IN MY SHOP. QUESTION CAN USE YOUR 110 WITH THIS SPINDLE??

  • HOW TO CONNECT THE SPINDLE INVERTER?

    U - Pin1
    V - Pin2
    W - Pin3
    Pin4 Dead

    Additional Information:
    My home made cnc is a big problem with my NC connection. When in start my spindle it will be gone wrong. It will be limith switch problem anytime. Need help thanks.

    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    HOW TO CONNECT THE SPINDLE INVERTER?

  • WHY SHOULD I BUY THE SPINDLE?

    The spindle is quieter and has more consistent torque (It doesn't get "bogged down" when it starts cutting into material). It can be used with collets of varying sizes (not restricted to imperial sizes). It is water cooled and so it does not blow air downward to cool the spindle like the router does. The spindle is also machined with much higher precision than typical routers and will have a much longer life.

    Click the link to add information to this solution:
    WHY SHOULD I BUY THE SPINDLE?

  • WHAT SOFTWARE CAN BE USED WITH THE BLACKTOOTH LASER CUTTER?

    If you take the standard parallel cable BoB (Break Out Board), then you will need control software (Mach 3 or EMC2) and CAM software to make your G-Code (such as CamBam). Personally I use CamBam and Mach 3, they work beautifully but don't expect to turn them on and know how they work out of the box. Give yourself a few weeks to get familiar with the basics. CamBam is VERY powerful software for it's price. I'm surprised how much I keep learning on what I can do with it...I highly recommend it if you want as much control as possible.

    Mach 3 + CamBam as a bundle costs $310. EMC2 will give you a free replacement for Mach 3 and is exclusively for Linux.

    If you use the USB BoB, it will cost an extra $75 + $75 for the software. This is an all-in-one package so no need for Mach 3 or CamBam.

    For etching rasters (jpeg, bmp, tiff, non-vectors, photos), I highly recommend PicEngrave. It has been a labor of love for the past 9 years and John has done a wonderful job with it. It easily compares in quality compared to software that is in the $200-$300 range. John's software runs $40 and can be found here: http://picengrave.com/ (don't let the modest website fool you, this stuff can do amazing things). DotG and the Mach3 engrave plugin are two other options and instructions can be found on Dustans page in the gallery on buildyourcnc.com website.

    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    WHAT SOFTWARE CAN BE USED WITH THE BLACKTOOTH LASER CUTTER?

  • I WOULD LIKE TO KNOW IF THERE IS A STORE OR SHOP WHERE CAN SEE THE PRODUCT AND BUY IT?

    If you are located near Houston, Texas area you can stop by our shop. If you are not near us, you can check in our forums, and see if you can find someone in your area that has one of our machines, and would be willing to let you come see it in action.

    Click the link to add information to this solution:
    I WOULD LIKE TO KNOW IF THERE IS A STORE OR SHOP WHERE CAN SEE THE PRODUCT AND BUY IT?

Get Help with:
This Product
Orders
Tech Support
Sales
This Product
Order Query
Tech Support
Sales
Not logged in. Log In Register
Track Order(s)
View Order(s)
I Want to Schecule a One-On-One Paid Tech Support Session
Book an Appointment Pertaining to a BuildYourCNC Product (Free)
Ask a Quesion Below (Free):
Book an Appointment Pertaining Other Equipment ($60/half hour)
Book an Immedite Appointment Pertaining Other Equipment ($120/half hour)
Ask a Quesion Below (Free):
Waiting for response... I may not answer immediately, but I was notified on my cellular phone so my response is forthcoming. If I don't respond immediately, you can always go to the [My Account] page to see all of our chats at any time.