[ Log In ]
[ Register ]

Question #: 13271

Question: Can LinuxCNC EMC2 control the spindle?

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

  • HOW TO CONTROL MY 2.2 KW SPINDLE VIA MACH3

    You can go to our instructions on for the breakout board here: http://www.buildyourcnc.com/item/electronicsAndMotors-parallel-breakout-relay to get the information on turning the spindle on and off from the computer and mach3. Alternatively, you can connect the computer using RS485 serial to the inverter and send control commands that way.

    Additional Information:
    HOW TO CONTROL MY 2.2 KW SPINDLE VIA MACH3 usb

    Additional Information:


    Additional Information:


    Additional Information:
    How should I wire the Mach3 card (red, 4 axis) and the vfd (Yl620-a)?

    Additional Information:



    Additional Information:



    Additional Information:

    Click the link to add information to this solution:
    HOW TO CONTROL MY 2.2 KW SPINDLE VIA MACH3

  • MACH3 CONTROL SPINDLE

    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:
    MACH3 CONTROL SPINDLE

  • CAN I USE A MAC TO CONTROL THE CNC?

    There are several CAD/CAM programs out there for MacOS. Here is a list of a few: http://www.macuser.de/forum/f53/3d-2d-cad-395058/#post4499316
    I've also read good things about punchCAD: http://www.punchcad.com/
    Of course, there is always SketchUp if you are in a pinch. There are a few CAM plugins for SketchUp as well, but I've never used them, so I can't vouch for them.

    CAD/CAM will get you as far as designing your parts and producing the g-code, but if you also want to run the CNC machine with your Mac, you will need a piece of software similar to Mach3 or EMC to run the g-code. I haven't been able to find anything like these programs that runs on Mac, so you may have to run Mach3 or EMC in Windows using Boot Camp or a virtual machine such as VMware or Parallels.

    Personally, I would use the Mac to do all the CAD/CAM, then use a cheap PC to run the CNC machine.

    Additional Information:


    Additional Information:
    EasyDNC for OSX
    www.dnc-x.com

    Additional Information:


    Additional Information:
    Hi guys I’m new to the cnc and I’m beginning to learn how to operate and cad-cam software also my cnc runs on Mach3 my questions is if I should use MacBook to do all designs if I can have all this software to run on Mac or I have to use windows software to operate it? I have separate small computer connected to the cnc table who have Mach3 on it please help. Also if you know any other software much easy for beginners please let me know thank you guys!
    My email if needed is r1jastrzebski@gmail.com

    Additional Information:


    Additional Information:
    Hi , thank you for your advise!

    Additional Information:
    Hi , thank you for your advise!

    Additional Information:
    Hi , thank you for your advise!

    Additional Information:
    Hi , thank you for your advise!

    Additional Information:

    Click the link to add information to this solution:
    CAN I USE A MAC TO CONTROL THE CNC?

  • HEY ! I HAVE PURCHASED A VFD WITH MATCHING SPINDLE 1.5KW AND CONTROL PROGRAM UCCNC. MY INTERFACE CARD IS DB25, THE QUESTION HOW DO CONNECT TO DB25 SO THAT CAN SPEED UCCNC? SINCERELY "CNC BEGINNERS"

    Identify the Control Signals: First, determine which control signals from the DB25 interface card are used for spindle speed control. Typically, these are PWM (Pulse Width Modulation) signals or analog voltage signals.

    VFD Configuration: Your VFD should be configured to accept the type of control signal your DB25 card provides. This involves setting parameters in the VFD that correspond to the type of input signal it will receive for speed control.

    Wiring: Connect the appropriate output pins from the DB25 card to the input terminals on the VFD. This usually involves connecting the PWM or analog output to the corresponding input on the VFD. Make sure to consult the manuals for both your VFD and interface card for specific wiring details.

    UCCNC Settings: Configure UCCNC to output the correct type of signal (PWM or analog) that matches your VFD's configuration. This is done through the software's spindle setup section.

    Test and Adjust: Run some tests to ensure that the spindle speed is being correctly controlled by UCCNC. You might need to tweak settings in either the VFD or UCCNC for optimal performance.

    Click the link to add information to this solution:
    HEY ! I HAVE PURCHASED A VFD WITH MATCHING SPINDLE 1.5KW AND CONTROL PROGRAM UCCNC. MY INTERFACE CARD IS DB25, THE QUESTION HOW DO CONNECT TO DB25 SO THAT CAN SPEED UCCNC? SINCERELY "CNC BEGINNERS"

  • 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?

  • 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?

  • 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 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?

  • HOW MANY AXES CAN MACH 3 CONTROL?

    Mach 3 CNC software can do the following:

    Converts a standard PC to a fully featured, 6-axis CNC controller
    Allows direct import of DXF, BMP, JPG, and HPGL files through LazyCam
    Visual Gcode display
    Generates Gcode via LazyCam or Wizards
    Fully customizable interface
    Customizable M-Codes and Macros using VBscript

    SET:

    Spindle Speed control
    Multiple relay control
    Manual pulse generation
    Video display of machine
    Touch screen ability
    Full screen eligibility

    EQUIPMENT:

    Lathes
    Mills
    Routers
    Lasers
    Plasma
    Engravers
    Gear cutting

    Additional Information:
    how to wire relay with mach board. I have mach interface board with one relay

    Click the link to add information to this solution:
    HOW MANY AXES CAN MACH 3 CONTROL?

  • 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

  • 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?

  • 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 IS THE SYSTEM PASSWORD FOR LASER CONTROL UNIT?

    The password is: 608

    Click the link to add information to this solution:
    WHAT IS THE SYSTEM PASSWORD FOR LASER CONTROL UNIT?

  • CAN THERE BE CLOSED LOOP CONTROL WITH STEPPING MOTORS?

    I haven't delved into using encoders with stepping motors too much. From my research, you need to have a controller that can provide the closed loop control, rather than software handling that process. I have also found from my research that using encoders on stepping motors is generally used to stop the machine in the case that the motor failed to achieve the commanded position for some reason and gives the user the chance to correct and continue with the job.

    If you want proper closed loop control, it may be best to go with servos and servo controller that provide the closed loop control within the real of those two components.

    Click the link to add information to this solution:
    CAN THERE BE CLOSED LOOP CONTROL WITH STEPPING MOTORS?

  • 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?

  • DO YOU SUPPLY THE MALE PORTION OF MOTOR CONTROL CABLES WITH REDLEAF?

    Yes and properly soldered.

    Additional Information:
    20

    Click the link to add information to this solution:
    DO YOU SUPPLY THE MALE PORTION OF MOTOR CONTROL CABLES WITH REDLEAF?

  • 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?

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.