1.5kw vevor spindle skr pro 1.2 wiring and setup

You can zip the pdf and then upload the .zip file

Ok so I have ordered the vevor 1.5kw spindle and vfd.
This does have a 5v PWM.
I have the latest v1e firmware installed on my skr pro v1.2 and tft screen.

I’m not installing any e-stops etc. apart from power to the vfd. I want to connect everything else to the skr pro.
Below is a pic of the terminals, this is the 3phase input power version however mine is single phase.
I’d like to know how to get this connected to the skr pro, and also how to enable control via marlin to control rpm using the marlin command M03 S##### where ##### is rpm speed and M4/M5 commands as these commands are embedded in my PP for aspire.

My understanding is that the latest skr pro firmware already has spindle control enabled so it’s just a matter of connecting 5v of vfd to PC9? But ain’t PC9 allocated for laser control?
My 3 fan outputs are currently being used so I can’t use them. Is there any other alternative 5v pwm pin I can use on the skr pro board?
Wiring diagram would be helpful not just for me but probably a lot of makers wanting to do the same thing.

I don’t have practical experience with a VFD, but I’ve spent some time with laser control and poking round in the Marlin configuration files. In Marlin, you have to select your ‘S’ value representation. You can select from PWM, Percentage, RPM, and Servo. The V1 maintained firmware uses PWM, which works with lasers, but for spindle control, I believe you will want RPM. In practical terms, that means the same firmware (given your VFD) cannot be used for both laser and spindle. If you want to run both a spindle and laser on your machine it is highly likely you will have to reflash your firmware when you make a swap. Fortunately, that is easy on the SKR Pro.

To match up your VFD to Marlin, you will need edit the Spindle and Laser control section of configuration_adv.h. Here is my educated guess on what changes you will need to make.

First, you will need to enable spindle control (and perhaps disable laser control) by editing these two lines:

//#define SPINDLE_FEATURE
#define LASER_FEATURE

Then you will need to change what the S values represent in M03 and inline commands to RPM in this section:

/**
   * Speed / Power can be set ('M3 S') and displayed in terms of:
   *  - PWM255  (S0 - S255)
   *  - PERCENT (S0 - S100)
   *  - RPM     (S0 - S50000)  Best for use with a spindle
   *  - SERVO   (S0 - S180)
   */
  #define CUTTER_POWER_UNIT PWM255

And finally you will need to setup how the PWM values sent to your VFD map to RPM in this section:

  #if ENABLED(SPINDLE_LASER_USE_PWM)
      #define SPEED_POWER_INTERCEPT       0    // (%) 0-100 i.e., Minimum power percentage
      #define SPEED_POWER_MIN          5000    // (RPM)
      #define SPEED_POWER_MAX         30000    // (RPM) SuperPID router controller 0 - 30,000 RPM
      #define SPEED_POWER_STARTUP 15 // 25000    // (RPM) M3/M4 speed/power default (with no arguments)
    #endif

I think it works this way. In your CAM, you specify some RPM, say 22000. That value is then used in the ‘S’ values for M03 and/or inline commands when the postprocessor generates the g-code, so the g-code will have S2200. Marlin then uses the values in the previous section to calculate what PWM value it needs to send to the VFD for an RPM of 22000.

As for the PWM pin, you can use PC9 for both and simply reroute the signal between your laser and your spindle when you swap between them, or you can attempt to find an alternate PWM pin.

In searching, I could not find a definitive resource on which SKR Pro pins support PWM. I think PF7 and PF8 pins (which are on extension 1 along with PC9) are PWM pins. If it were me, I’d hookup a voltmeter to pins on the extension block and use M42 with an S value of 128 to see if I got half the voltage from a pin. I’m also clumsy, so I’d power down the board between each pin test to avoid inadvertently shorting pins.

1 Like

Thanks for that Robert.
Is the vfd mapping simply setting minimum rpm and max rpm? Or is this something I need specs from the vfd or spindle?
Also when using the m42 command for pc9.
Is is simply sending command “M42 PC9 S128” to get 50% voltage on this pin? So I should get 2.5Vdc

Pics of vfd specifications:

Pics of spindle specifications:

Ok so seem to have it working with voltmeter.
However pin pc9 is only a 3.3v pwm. I thought this was 5V?
The vfd uses a 5v pwm I believe

AHi,
If available check/verify peak value with an oscilloscope.

If not available set to, say, 50% and see if you get 2.5V.

yeah it works,
If i set spindle to 8000rpm i get 1.075V
if i set spindle speed to 12000rpm i get 1.623V.
If i set to 24000rpm i get 3.255V
I have it set in configuration_adv.h as:

#if ENABLED(SPINDLE_LASER_USE_PWM)
      #define SPEED_POWER_INTERCEPT       0    // (%) 0-100 i.e., Minimum power percentage
      #define SPEED_POWER_MIN          8000    // (RPM)
      #define SPEED_POWER_MAX         24000    // (RPM) SuperPID router controller 0 - 30,000 RPM
      #define SPEED_POWER_STARTUP 15 // 25000    // (RPM) M3/M4 speed/power default (with no arguments)
    #endif

so as for mapping it seems to work.
But my the Vevor 1.5kw VFD has a 5vdc for pwm.
So i was wondering if there is another pwm pin on the skr pro v1.2 that uses 5vdc for pwm, instead of 3.3vdc like PC9

Almost all devices that receive 5V PWM signals work fine with 3.3V signals since 3.3V is higher than the 2.5V threshold. Going the other way (5V into 3.3V decice) can be a problem. I can respond to your other questions when I return home.

1 Like

Is the vfd mapping simply setting minimum rpm and max rpm? Or is this something I need specs from the vfd or spindle?

For these values, you want the min and max RPM for the VFD/Spindle. I don’t know if it the same Vevor VFD you’re using, but in this topic the range for that VFD is 12000-24000 R/min. You could also calculate the range empirically. You could hookup your VFD to PC9, put the VFD in PWM mode, Send M42 g-codes to marlin with S0 and S255, and read the RPMs from the VFD display. Or, maybe it is documented in the manual.

So i was wondering if there is another pwm pin on the skr pro v1.2 that uses 5vdc for pwm

I could not find any reference for what pins support PWM. If you want an educated guess, take a look at the datasheet for the STM32 processor (used in the SKR Pro). The pin definitions start on page 42. PWM requires a timer, so any pin where the definition contains “TIM[something]” is a good candidate for a PWM pin. But, as mentioned in my previous post, I don’t see any reason to seek out a 5V pin. Devices that take PWM signals generally are interested in what percent of each cycle is high vs. low. They don’t care about the voltage as long as the incoming signal has a high voltge above the midpoint of the defined PWM voltage of the device.

I have the same vevor spindle and VFD but I never did try to hook it up to the SKR. Now all of my machines are on the Jackpot board. My full sheet LR3 runs a Huanyang VFD for its spindle and that supports RS485 so I went that route. I do have a 0-10v card to add to the jackpot on my smaller LR3 with the vevor spindle/VFD so once I get to that Ill know more.

1 Like

My core is printed petg. Do you know the temps you get with air cooled 1.5kw spindle and if petg would be ok for the temps?
I currently have the Makita router and I believe the spindle is 65mm so I can still use the same Makita holder on the core.

Mine do good. One machine has a PLA core on it the other a PETG core and either are fine. The limit you have with the vevor VFD is there isn’t any way to get it to display RPM, at least not that I have found anyways. So you have to do the conversion from HZ to RPM which is easy. 200=12000 and 400=24000

1 Like

ok so my gcode issues a M3 S14500 command,
However Marlin displays a message “Unknown Command MM3 S14500” on the tft screen.
Even though the gcode only shows the 1x M for M3 S14500.
im using Marlin latest version. anyone else have this issue?>
My PP for vectric is producing the gcode which shows correctly

Not sure on that one. I never tried to have marlin run the spindle. I just started getting the jackpot to run it and that’s been going well

Can you upload the g-code file that has the problem? Don’t paste it into a topic, use the upload button. I’d like to 1) view it in a tool that will see if there are any hidden characters, and 2) send it to my Marlin board to see if I get the same issue.

test.gcode (7.0 KB)
ok so this is gives me a error before it starts the toolpath.
It goes through the prompts (material secured, attach tool/touchplate, remove touchplate, click to start, then the M3 S14500 errors.
it does proceed on and not halt the system and goes to the tool3 onwards. there are other m3 S14500 commands during tool change but that doesnt error out. so it only errors the beginning of the gcode.

; test
; Minimum extent in X = 0.000 Minimum extent in Y = 0.000 Minimum extent in Z = -25.500
; Maximum extent in X = 430.000 Maximum extent in Y = 1820.000 Maximum extent in Z = 0.000
; Length of material in X = 430.000
; Length of material in Y = 1820.000
; Depth of material in Z = 25.500
; Home X = X0.000 Home Y = Y0.000 Home Z = Z20.000
; Safe Z height: 20.000
; Tools: 3 = 1/16" End Mill 2 Flute Downcut (1.59 mm)
; Tools: 1 = 1/8" End Mill 1 Flute UpCut (3.18 mm)
; Notes: 
; Generated Saturday December 09 2023 04:46 PM
 
M150 S0 R255 U0 B0
M150 S1 R21 U28 B235
G90
M400
M300
M117 Load 1/16" End Mill 2 Flute Downcut (1.59 mm)
M0 Load 1/16" End Mill 2 Flute Downcut (1.59 mm)
M118 P0 Load 1/16" End Mill 2 Flute Downcut (1.59 mm)
M84 S0
G21
G92 X0 Y0
M400
M300
G0 X100 Y100 F2520
M117 Is Material Loaded & Secured?
M00 Is Material Loaded & Secured?
M118 P0 Is Material Loaded & Secured?
M400
M300
M117 Attach Tool and Touchplate
M0 Attach Tool and Touchplate
M118 P0 Attach Tool and Touchplate
M400
G38.2 Z0
G92 Z0.5
G1 Z10 F500
M400
M300
M117 Remove Touchplate
M0 Remove Touchplate
M118 P0 Remove Touchplate
M400
G1 X0.000 Y0.000 F480
M400
M300
M117 Click to Start!
M00 Click to Start!
M118 P0 Click to Start!
M400
M150 S0 R255 U0 B0
M150 S1 R255 U255 B255
M3 S14500
M106 P0
M106 P1
M106 P2
; Tool 3: 1/16" End Mill 2 Flute Downcut (1.59 mm)
; Path: Drill Through Holes J:\test.gcode
; 
G0 X179.419 Y19.875 F3000
G0 Z20.000 F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X115.419  F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0  Y77.875 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X179.419  F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X170.690 Y133.958 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X125.690 Y133.958 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X170.690 Y208.958 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X125.690 Y208.958 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X342.157 Y259.244 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X392.157  F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0  Y357.244 F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
G0 X342.157  F3000
G0  F500
G1   Z-1.250 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-2.500 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-3.750 F180.0
G0   F3000
G0 Z5.000 F500
G1   Z-5.000 F180.0
G0   F3000
G0 Z20.000 F500
; Tool change:
; Tool 1: 1/8" End Mill 1 Flute UpCut (3.18 mm)
M150 S0 R21 U28 B235
M150 S1 R255 U255 B255
M400
M117 Tool Change in progress
M118 P0 Tool Change in progress
M400
G28 Z ;goto safe z
G1 X10 Y10 F3000 ;Move XY axis close to home rapid
G0 X0.0000 Y0.0000 F500 ;Move XY axis to home
M400
M5
M107 P0
M107 P1
M107 P2
M400
M300
M150 S0 R225 U245 B2
M117 Change Tool:1/8" End Mill 1 Flute UpCut (3.18 mm)
M00 Change Tool:1/8" End Mill 1 Flute UpCut (3.18 mm)
M118 P0 Change Tool:1/8" End Mill 1 Flute UpCut (3.18 mm)
M400
M300
M117 Is Material Loaded & Secured?
M00 Is Material Loaded & Secured?
M118 P0 Is Material Loaded & Secured?
M400
M300
G0 X100 Y100 F2520
M117 Add Touchplate
M00 Add Touchplate
M118 P0 Add Touchplate
G38.2 Z0
G92 Z0.5
G1 Z10.0000 F500
M400
M300
M117 Remove Touchplate
M00 Remove Touchplate
M118 P0 Remove Touchplate
M400
G1 X10 Y10 F3000 ;Move XY axis close to home rapid
G1 X0.000 Y0.000 F500 ;Move XY axis to home
M400
M300
M117 Tool Change Complete, Continue?
M118 P0 Tool Change Complete, Continue?
M400
M00 Tool Change Complete, Continue?
M150 S0 R255
M150 S1 R255 U255 B255
M3 S14500
M106 P0
M106 P1
M106 P2
; Path: Section Markings J:\test.gcode
; 
M150 S0 R255 U255 B255
M150 S1 R255 U255 B255
G1 X10 Y10 F3000 ;Move XY axis close to home rapid
G1 X0.000 Y0.000 F500 ;Move XY axis to home
M150 S0 R255
M150 S1 R255 U255 B255
M3 S14500
M106 P0
M106 P1
M106 P2
G0 X0.649 Y104.090 F3000
G0 Z20.000 F500
G1   Z-1.000 F180.0
G1 X322.469   F600.0
G1  Y125.910  F600.0
G1 X0.649   F600.0
G1  Y104.090  F600.0
G0   F3000
G0 Z20.000 F500
G0 X51.590 Y215.718 F3000
G0  F500
G1   Z-1.000 F180.0
G1 X248.410   F600.0
G1  Y412.538  F600.0
G1 X51.590   F600.0
G1  Y215.718  F600.0
G0   F3000
G0 Z20.000 F500
G0 X328.357 Y114.321 F3000
G0  F500
G1   Z-1.000 F180.0
G1 X405.177   F600.0
G1  Y511.141  F600.0
G1 X328.357   F600.0
G1  Y114.321  F600.0
G0   F3000
G0 Z20.000 F500
G0 X188.410 Y440.662 F3000
G0  F500
G1   Z-1.000 F180.0
G1  Y522.482  F600.0
G1 X51.590   F600.0
G1  Y440.662  F600.0
G1 X188.410   F600.0
G0   F3000
G0 Z20.000 F500
G0 X298.410 Y549.905 F3000
G0  F500
G1   Z-1.000 F180.0
G1  Y876.725  F600.0
G1 X51.590   F600.0
G1  Y549.905  F600.0
G1 X298.410   F600.0
G0   F3000
G0 Z20.000 F500
G0 X322.513 Y899.061 F3000
G0  F500
G1   Z-1.000 F180.0
G1  Y920.881  F600.0
G1 X0.694   F600.0
G1  Y899.061  F600.0
G1 X322.513   F600.0
G0   F3000
G0 Z20.000 F500
G0 X324.352 Y1694.090 F3000
G0  F500
G1   Z-1.000 F180.0
G1  Y1715.910  F600.0
G1 X2.532   F600.0
G1  Y1694.090  F600.0
G1 X324.352   F600.0
G0   F3000
G0 Z20.000 F500
G28 Z ;goto safe z
G28 ;goto home
M5
M107 P0
M107 P1
M107 P2
M400
M300
M150 S0 R0 U255 B0
M150 S1 R0 U255 B0
M117 Job Complete!
M00 Job Complete!
M118 P0 Job Complete!
G4 S30
M150 S0 R255 U0 B0
M150 S1 R21 U28 B235

PS. Im not actually cutting with these tools, its just for the above testing purposes. :wink:

I took your g-code file, edited out everything but your M3 command, and ran it on my machine. There was no error, and the command turned on my laser. I wasn’t sure what was going to happen since the S value was well outside the 0 to 255 range of a PWM value used by my laser g-code, but it did turn on the laser. Marlin processed the M3 command on my control board.

Looking through the g-code, I see a lot of uncommon (to me) g-codes used in the start of the file. Plus, there is a M84 used, and I don’t find M84 in the Marlin g-code reference.

For troubleshooting, I would suggest:

  1. eliminate all the start g-code down to the first G0 except for the M3. So, your code will run the M3 and then start processing the G0 and G1 codes. If it works, then there is something in the other g-codes causing the issue. If the test does not work then…
  2. use a diff tool to compare your configuration.h and configuration_adv.h to the unmodified V1 versions. Perhaps you’ve changed a setting that is impacting the processing of M3.

If the M3 does work with all the other start code removed, then you can start putting chunks of your header back in to isolate the problem.

I use Meld as my diff tool.

M84 disables stepper motors (however don’t know why since it’s set for 0seconds lol) so will need to get rid of this in the pp.
M106 turns on relays,
M150 turns on led strip lighting.

I will edit this gcode and just delete all the extras and just have a basic command (get rid of led, relays etc).

I will try meld, thanks for that.
I’m wondering if the vfd needs to be connected maybe? As I did have the vfd offline during the test, but I didn’t seem to get this issue prior to the vfd and the gcoding still had the M3 command in there.

What throws it off is that in doesn’t impact the other M3 commands only the start. Weird!

I wonder if I put a M400(finish moves) and a G4(dwell time) just before the M3 command as it could be that the controller just couldn’t keep up in its buffer? Maybe?

M84 disables stepper motors (however don’t know why since it’s set for 0seconds lol)

I see now that M84 is documented in the Marlin g-code reference under M18, which is likely the Marlin preferred g-code, though M84 is supported.

I’ve never seen an M400 in the start code, only at the end of a file.

The use of M118 (serial print) is the only g-code I could not puzzle out why it was there. Is this talking to the VFD?

Anyway I would start with a minimal file to try and determine if the issue is related to the specific g-code sequence, or if there is a setting in the firmware causing the problem, or a Marlin bug. The ‘MM3’ is pointing to a parsing bug in Marlin, but you’d like to have a workaround if it is a bug.

M118 sends serial text to tft screen/terminal.