grblHAL / Plugins_spindle

grblHAL plugins for spindle control
Other
8 stars 12 forks source link

AC Servo Spindle #29

Open ennio64 opened 6 months ago

ennio64 commented 6 months ago

Hi Terje Io after the Stepper Spindle do you intend to write a plugin for AC Servo controlled in Modbus to be used as a spindle? I attach you manual (see Chapter 9) and a code for Arduino Nano as an example (also a small video). Greetings

T3a_T3L_manual.pdf RS485_modbus_AC_servo_eng.ino.txt https://github.com/grblHAL/Plugins_spindle/assets/7964396/3866e889-1fd2-453d-ad5c-65b04d5a4fba

terjeio commented 6 months ago

This is a Modbus spindle just like the others, if MODVFD cannot be used modify one (this?), verify it and either create a PR for it or put the code in a comment so I can add it.

ennio64 commented 6 months ago

It’s not the same. A VFD works with frequency, whereas with a Servo Drive, you set the RPM directly. Moreover, the syntax of the commands is different.

list command VFD H100

01 05 00 49 FF (CRC) //run CW 01 05 00 4A FF (CRC) //run CCW 01 05 00 4B FF (CRC) //stop 01 06 02 01 H_val L_val (CRC) //set frequency to run 01 04 00 00 00 02 (CRC) //read instantaneous frequency 01 04 00 05 00 01 (CRC) //read max frequency set 01 04 00 11 00 01 (CRC) //read min frequency set

list command Servo Drive

01 44 01 (CRC) //run CW 01 44 02 (CRC) //run CCW 01 44 00 (CRC) //stop 01 06 00 4C H_val L_val (CRC) //set rpm to run 01 04 10 00 00 01 (CRC) //read instantaneous speed (address 10 00 register 01) // Comando Modbus per leggere la velocità istantanea (indirizzo 0x1000, registro 1) 01 03 00 CF 00 01 (CRC) //read max speed set (address 00 CF register 01) // Comando Modbus per leggere la velocità massima impostata (indirizzo 0x00CF, registro 1)

(CRC = LSB + MSB)

terjeio commented 6 months ago

Well, you can still use an existing VFD driver as a template - at least that is what I would do. Remove the RPM/frequency conversions and change the messages.

ennio64 commented 6 months ago

I used h100.c as a template, I made all the obvious changes but I can't do more because I don't have the general vision. There are some parts that I just don't know how to edit.

HL_T3D_L20A.c.txt