Hi,
I want to add some code for heating the spindle before CNC machining something.
I’ve generated the CNC code with fusion 360 and added this code at the beginning.
The last 4 line are coming from Fusion 360.
When I’m starting this CNC program the G90 is done the the M03 P25 and the following are not performed, the spindle doesn’t turn. Can someone tell me why ?
;Lentus-V3
;Machine
;vendor: Snapmaker
G90 ; Position absolue
G00 X0 Y0 Z100 ; Position Tete X0 Y0 Z100
M03 P25 ; Broche ON - 25% max tr/min
G04 S60 ; Durée 1min
M05 ; Broche OFF
G04 S10 ; Durée 10sec (Pause)
M03 P50 ; Broche ON - 50% max tr/min
G04 S90 ; Durée 1min30
M05 ; Broche OFF
G04 S10 ; Durée 10sec (Pause)
M03 P75 ; Broche ON - 75% max tr/min
G04 S210 ; Durée 3min30
M05 ; Broche OFF
G04 S10 ; Durée 10sec (Pause)
M03 P33 ; Broche ON - 33% max tr/min
G04 S60 ; Durée 1min
M05 ; Broche OFF
;description: Generic Snapmaker Marlin v20180725
M3 P100
G4 S2
G21
G90
Is it possible that a firmware downgrade can cause the spindle not turning ?
I’ve updated the firmware to the v1.12.1 (to the CNC Tool) but I realized that I didn’t make the commissioning of the 3D printing and the laser tool. So I’ve downgraded the firmware of my SM2 A350 to the V1.11.4
I don’t see an obvious reason why it shouldn’t work. Can’t test right now. The only thing that I notice when comparing with files that I know work on my device is that the G21 is executed before the G90. And that the spindle is turned on even before that.
Basically the last for lines of your gcode. Do file generated by Luban or Fusion work?
I understand that this is a thing for professional “big” or high precision cnc machines. However, I doubt it will make any real world difference on the “toy” device that the SM2 actually is.
Thank you for your answer brvdboss.
Maybe you are right about the “toy” that can be the SM2, but if the spindle could turn about 24000 rpm this could more interesting than it is already.
For the problem that the spindle doesn’t turn : I tried the code below. The 1st one is requesting 40% of maximum rotation available (that means 4800 rpm) and it is not working. So I tried the 2nd code below that requesting 66% and I succeed with this one.
;Machine
;vendor: Snapmaker
G90 ; Position absolue
G0 X0 Y0 Z50 ; Position Tete X0 Y0 Z50
M3 P40 ; Broche ON - 40pourcent max tr-min
G4 S150 ; Duree 2min30
M5 ; Broche OFF
G4 S10 ; Pause 10sec
M3 P80 ; Broche ON - 80pourcent max tr-min
G4 S210 ; Duree 3min30
M5 ; Broche OFF
;Machine
;vendor: Snapmaker
G90 ; Position absolue
G0 X0 Y0 Z50 ; Position Tete X0 Y0 Z50
M3 P66 ; Broche ON - 66pourcent max tr-min
G4 S150 ; Duree 2min30
M5 ; Broche OFF
G4 S10 ; Pause 10sec
M3 P88 ; Broche ON - 88pourcent max tr-min
G4 S210 ; Duree 3min30
M5 ; Broche OFF
``
The specs actually list a spindle speed between 6000-12000rpm (snapmaker) So it probably won’t turn on at speeds below 6000RPM (or 50%)
In this post someone actually did some measurements on the actual speeds (to validate how correct the numbers are) CNC Spindle Speed - #15 by ODD and it goes between 50 & 100% as well.
Ok. I didn’t looked at the specs, thank you one more time.
No, it was not a typo, I guess if Snapmaker team could release a 24000 rpm rotating spindle for a new CNC tool head, this side of that machine would be even more interesting for makers that we are.
I only went through the code pretty quickly, but I read that function as a check to validate if the spindle is still turning at an acceptable speed and is not stuck/blocked.
So if you set it at 12000rpm (100%) and the actual speed goes below 60% of that (7200rpm) it will set the fail flag which is picked up in the ReportSpeed function and causes the machine to report a failure.
Again. didn’t go in detail through the code, and am making assumptions about function names etc
Assuming the above comments are accurate regarding the machine not accepting values lower than ~50%, I also cannot find anything the definitively prevents it from being set. Perhaps it’s a PWM issue, below a certain pulse duration the motor just doesn’t spin up from a stop, which results in the minimum speed check nearly immediately failing afterwards?
I wonder if that would imply running at 100% and then slowing down to 30% would work…
Yea, although I think the control flow wouldn’t end up there as each call to SpeedStatuCheck will recalculate the min_speed as 60% of the normal speed.
Changing the target speed to 30% seems like it would result in a min_speed = 18, and thus (this->ReadCurSpeed() < min_speed) would be false, falling down to the this->speed_fail_flag_ = false; part of the condition.
I just tried it and it’s perfectly possible to set lower speeds
I even tried running the script from the first post from @moris and it just worked. (well I didn’t run it all the way but it started also at the 25% speed: and this was after a power down, so it couldn’t be caused by some of the manual commands I did first.
I checked with an rpm counter and the speeds actually match.
The only thing it doesn’t seem to do is spin counter clockwise. So no matter if you use M3 or M4, it’s always clockwise (M3).
I did just install the last firmware version (so I needed to connect all toolheads anyway)
Don’t have a clue what’s causing it then. Unless there are different hardware revisions of the modules and they have disabled in hardware or something.
I’m a Numerical Control Programmer. I’ve written”warm-up” programs for CNC machines. The purpose is to warm the ways, and get the machine up to operating temperatures. This allows whatever thermal growth is going to happen, happen. It provides for higher precision machining. On the SM2, that really isn’t going to do anything because it’s only the spindle bearings that are going to warm, and that’ll happen almost immediately, once the spindle starts turning. A warm up program for spindle only, will not offer any benefit, and won’t improve the precision…