[ Log In ]
[ Register ]
NEW: CNC Router PLANS Available for all of our Newest CNC Models!! Click here to "Design Your CNC".

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.

Respond:

Other Possible Solutions to this Question

  • Can LinuxCNC EMC2 control the spindle?

    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.

    Click the link to respond:
    Can LinuxCNC EMC2 control the spindle?

  • Can the spindle be controlled with a PWM signal or analog signal? Which pin do I assign the spindle control to in LinuxCNC?

    The Spindle can be controlled with either analog (Like with a DAC card) or PWM.

    If your spindle speed is controlled by an analog signal, (for example, by a VFD with a 0 to 10 volt signal) and you’re using a DAC card like the m5i20 to output the control signal:

    First you need to figure the scale of spindle speed to control signal. For this example the spindle top speed of 5000 RPM is equal to 10 volts.

    10 volts / 5000 RPM = .002 volts / 1 RPM

    If you need a spindle enable signal, link your output pin to motion.spindle-on. To link these pins to a parallel port pin put something like the following in your .hal file (net spindle-enable motion.spindle-on => parport.0.pin-14-out), making sure you pick the pin that is connected to your control device.

    Click the link to respond:
    Can the spindle be controlled with a PWM signal or analog signal? Which pin do I assign the spindle control to in LinuxCNC?

  • If I am cutting 18mm MDF with 6mm cutting bit (so 6mm pass), what can be the maximum speed rate of cutting and spindle speed of router?

    The best way to determine the cutting speed is to determine this with respect to the edge quality you desire. This recommendation generally comes from the major end mill manufacturers.

    The feedrate (travel speed) should be determined by the chip load of the end mill, the number of flutes, material of the end mill (Solid Carbide, HSS - High Speed Steel, Cobalt, etc.) and the RPM of the spindle. You will need to see the manufacturer's specifications of the end mill to determine this information.

    Formula:
    Chip Load = (feed rate IPM)/(Spindle RPM x Number of Flutes)

    or

    Feed Rate IPM = Chip Load x Spindle RPM x Number of Flutes

    Once you find this information, apply this to the material at the full depth of the end mill. If you find that your edge condition is aberrant, pull back on either the speed, or the depth per pass. If the edge condition is acceptable, then push the speed higher until the edge condition starts to deteriorate in quality and then pull back to the accepted level.

    Using this method, you will be able to reduce the wear on the end mil which will be the most expensive consumable on the machine.

    Additional Information:

    Click the link to respond:
    If I am cutting 18mm MDF with 6mm cutting bit (so 6mm pass), what can be the maximum speed rate of cutting and spindle speed of router?

  • I can't seem to find information on spindle control via the breakout board. Can someone point me in the right direction?

    We currently can only control the On/Off of the spindle via Mach 3 and through our Parallel Interface Board. We have the listed instructions on our Parallel Interface Board webpage, will be a easy job that will included 2 wires (18-24g wire will be fine) from your inverter(VFD) to the location of your Parallel Interface Board.

    Parallel Interface Board webpage: https://buildyourcnc.com/item/electronicsAndMotors-parallel-breakout-relay

    In regards to our USB Interface Board, we are currently working on a prototype board that will allow the same On/Off capability with Planet-CNC. Prototype Board currently not available as of yet.

    Click the link to respond:
    I can't seem to find information on spindle control via the breakout board. Can someone point me in the right direction?

  • What settings does I use for controlling the spindle in StepCon/Linuxcnc?

    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.

    Click the link to respond:
    What settings does I use for controlling the spindle in StepCon/Linuxcnc?

  • How can I make LinuxCNC control a spindle?

    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.

    Click the link to respond:
    How can I make LinuxCNC control a spindle?

  • can I control the speed of a 2.2 spindle through your 5 axis breakout board with relay?

    Yes, you can control the speed of the 2.2 kW spindle, and the other spindles we sell, through Mach3 software. It requires making some changes to the settings in Mach3 and in your inverter. It also requires an additional part, which is called a USB to Serial Converter, found on our site here:

    https://www.buildyourcnc.com/item/Interfaces-newbiehack-Interfaces-TTL232R-USB-UART-Serial

    I have some additional instructions, that I will send upon request, by email. I will also be adding a complete tutorial and video, to the website, on how to do this soon.

    Additional Information:
    20

    Click the link to respond:
    can I control the speed of a 2.2 spindle through your 5 axis breakout board with relay?

  • Can the USB CNC Controller be used with LinuxCNC?

    The USB Interface can only be used with the Planet-CNC software which runs under the windows operating system.

    Click the link to respond:
    Can the USB CNC Controller be used with LinuxCNC?

  • Hello, I bought your 110v 2.2kw spindle and vfd. When I turn it on it reaches the full 24000 rpm, but will not let me decrease the speed. How Can I fix this?

    Are you using the control panel (front panel with the speed control knob known as he potentiometer)? Or are you attempting to use the computer to control the speed?

    Additional Information:
    I am using the control panel, however there is no knob on mine, just buttons.

    Click the link to respond:
    Hello, I bought your 110v 2.2kw spindle and vfd. When I turn it on it reaches the full 24000 rpm, but will not let me decrease the speed. How Can I fix this?

  • Can you tell me what gauge wire is needed for limits switches and the spindle?

    The hookup wires you will need is 22 to 24 AWG stranded and shielded for the wiring of the limit switches and E_Stop. Our kit customers select various places for these switches, so we don't supply the wiring. If you don't use shielded cable, you will need to change the debounce setting in Mach3 (if that is the control program you are using).

    We typically use 14 AWG stranded wire for the VFD to Spindle (U, V, W) connections.

    Click the link to respond:
    Can you tell me what gauge wire is needed for limits switches and the spindle?

  • What is the benefit to using a spindle over a standard router?

    This solution will refer to the water cooled spindles that we sell. Generally, routers are air cooled which push air downwards through the router to cool the router motor. This has an undesirable effect for CNC machines that will blow the dust and chips into the air. The water cooled spindle will not blow since it uses water to cool the spindle motor. This allows the chips and dust to be confined within the dust shoe and get removed by the vacuum. Additionally, standard routers have a sound level that far exceeds that of the spindle.

    Click the link to respond:
    What is the benefit to using a spindle over a standard router?

  • What is the runout on the 2.5 KW spindle and how many bearings?

    The runout on our 2.2kW spindle and number of bearings are:
    Radial runout: 0.01mm - 0.000393701 inches, 3 Bearings

    Click the link to respond:
    What is the runout on the 2.5 KW spindle and how many bearings?

  • What kind of wire should I use between the invertor and the spindle?

    The type of wire that should be used between the spindle and the VFD (Variable Frequency Driver also called the inverter) should be of stranded type and we use between 18 and 16 AWG.

    The total current is divided among the three coil wires, therefor a wire gauge of 16 should be sufficient.

    Currently we use 20AWG 4 conductor.

    Additional Information:

    Click the link to respond:
    What kind of wire should I use between the invertor and the spindle?

  • Can you provide configuration setting for the 110v Huangyang VFD and 1.5 kw spindle?

    The configuration settings for our VFD's are these: VFD Setup:
    Change PD001 to '0' (source of run commands)
    Change PD003 to 300 (main frequency - Hz)
    Change PD004 to 300 (base frequency - Hz)
    Change PD005 to 400 (max operating frequency - Hz)
    Change PD006 to 2.5 (intermediate frequency - Hz)
    Change PD008 to 220 (max voltage - V)
    Change PD009 to 15 (intermediate voltage - V)
    Change PD010 to 8 (minimum voltage - V)
    Change PD011 to 100 (frequency lower limit - Hz)
    Change PD142 to 7 (rated motor current - Amps)
    Change PD143 to 2 (motor pole number)
    Change PD144 to 3000 (rated motor revolution)
    For further info please refer to (https://www.buildyourcnc.com/item/spindle-inverter-2!2kw-spindle-novfd#prettyPhoto) for wiring and other specifications.

    Click the link to respond:
    Can you provide configuration setting for the 110v Huangyang VFD and 1.5 kw spindle?

  • Can the leangreen vertical laser be adapted to attach a spindle as well?

    At this current time we only have the laser hybrid available for the greenBull. Due to the weight that is on the z-axis for the greenLean and the spring load, we have not tried retrofitting it just yet.

    However, with enough skill and patience anything is possible. Please let us know if you try this and any lessons learned along the way.

    Click the link to respond:
    Can the leangreen vertical laser be adapted to attach a spindle as well?

  • Can the 2.2 KW water cooled spindle be fitted with a 1/2" chuck/collet ?

    Absolutely. You can have 1/2" collets used in 2.2kW spindles.

    Here is a link for the ER-20 1/2"ID Collet:
    https://www.buildyourcnc.com/item/spindle-collet-!5-er20-spindle-collet

    Click the link to respond:
    Can the 2.2 KW water cooled spindle be fitted with a 1/2" chuck/collet ?

  • I'm considering buying the 4 axis cnc combo. I have metal lathe with variable speed spindle. Can i somehow control the spindle with the gcode. like s values and ,m03,m04, m05?

    Our spindle VFD's, have a multitude of different connectors that can be used for different operations. There is a manual that comes with each VFD, and you can refer to page 11 for different functions and descriptions.

    We currently have a PWM, working with our machine, however it is connected via USB, and setup through Mach 3.
    Also if you may have misplaced or lost the manual here is a link to the pdf:

    (https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCAQFjAAahUKEwibxaaIndTHAhXQlogKHZVyDFE&url=http%3A%2F%2Fwww.c-n-c.cz%2Fdownload%2Ffile.php%3Fid%3D42252&ei=_cHkVdvSC9CtogSV5bGIBQ&usg=AFQjCNHTQcxs-KhJkvkhMdxVFPzkoYJtsA&sig2=JAcZawTGMuC-t4wmn1z-rA)

    Click the link to respond:
    I'm considering buying the 4 axis cnc combo. I have metal lathe with variable speed spindle. Can i somehow control the spindle with the gcode. like s values and ,m03,m04, m05?

  • Can you control the spped of the 2.2 KW spindle using the breakout board and Mach3 soft ware?

    Yes, you can control the speed of the 2.2 kW spindle, and the other spindles we sell, through Mach3 software. It requires making some changes to the settings in Mach3 and in your inverter. It also requires an additional part, which is called a USB to Serial Converter, found on our site here:

    https://www.buildyourcnc.com/item/Interfaces-newbiehack-Interfaces-TTL232R-USB-UART-Serial

    I have some additional instructions, that I will send upon request, by email. I will also be adding a complete tutorial and video, to the website, on how to do this soon.

    Additional Information:
    20

    Click the link to respond:
    Can you control the spped of the 2.2 KW spindle using the breakout board and Mach3 soft ware?

  • Can I wire in a 5vdc relay board to the spindle relay for my router. Gnd would be negative and the arrow would be positive right?

    Yes, a 5v relay board can be connected to a spindle. Relays generally have terminals labeled S, O and P and you will want to pass one of your main wires "through" the P and S terminals or the P and O terminals depending if you want normally closed or normally open function.

    Refer to Step #8 on this page to get the full instructions on how to use a relay to control the spindle or router.

    https://buildyourcnc.com/item/electronicsAndMotors-parallel-breakout-relay#prettyPhoto

    User response:
    I have the USB board. I was thinking of wiring a 5v relay board to the breakout board labeled (spindle) using the GND and (arrow) which i think is 5vdc. I will need this relay board to operate my router. Thanks

    Buildyourcnc response:
    Yes, those terminals are to control the relay (engage the relay). On the switch part of the relay, the router main poser wire (say, the live, black, wire) would pass through this switch portion of the relay.

    Click the link to respond:
    Can I wire in a 5vdc relay board to the spindle relay for my router. Gnd would be negative and the arrow would be positive right?