- Script S / Spindle speed via SPI / I2C / UART
-
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:
-
-
Member
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!
- Script S / Spindle speed via SPI / I2C / UART
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
-
Forum Rules