586,000 active members*
4,891 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > Script S / Spindle speed via SPI / I2C / UART
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2021
    Posts
    1

    Question Script S / Spindle speed via SPI / I2C / UART

    Hi,
    is there a way to script the S g-code?

    To set the spindle speed, normally the speed is converted to a frequency or PWM, which is then converted to 0-10V, which is then converted back to the speed by the VFD.
    But many VFDs also have a digital inteface, e.g. UART or RS-485. So: Why not skip all the conversion, and send the speed directly to the VFD? (via UART, or e.g. an I2C-to-RS485-converter)

    So: Is there any way to catch PlanetCNC's spindle-speed-changes / S-words -- e.g. with a script like for M-codes or via a callback in the API?

  2. #2
    Join Date
    Jun 2017
    Posts
    143

    Re: Script S / Spindle speed via SPI / I2C / UART

    This is very possible. I know this because I have built and I2C to RS485 converter and written the scripts (for a Nowforever vfd). The scripts get rather complicated as the serial comms requires the use of crc's to validate commands.
    You don't need to intercept the S commands, you do it all in the M3/M4 scripts (ie. set the speed for the vfd only when you are starting the VFD). The rest of the time it doesn't matter since the actual speed is zero!

Similar Threads

  1. Spindle warm up script
    By bobmagnuson in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 10-26-2018, 01:00 AM
  2. Replies: 1
    Last Post: 08-02-2013, 10:07 PM
  3. Port B UART Err
    By Tom_Moody in forum Mastercam
    Replies: 7
    Last Post: 05-08-2011, 02:09 PM
  4. Port B UART Err
    By Tom_Moody in forum Bridgeport / Hardinge Mills
    Replies: 0
    Last Post: 05-03-2011, 07:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •