Script S / Spindle speed via SPI / I2C / UART

Results 1 to 2 of 2

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

  1. #1

    Join Date
    Feb 2021
    Posts
    1
    Downloads
    0
    Uploads
    0

    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?

    Similar Threads:


  2. #2
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default 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!



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Script S / Spindle speed via SPI / I2C / UART

Script S / Spindle speed via SPI / I2C / UART

Script S / Spindle speed via SPI / I2C / UART