Spindle speed control
-
I want to add a PWM output from my Duet3D board to control a VFD and spindle.
I have a PWM to voltage (1-10v) board that converts a PWM value into voltage. (5v =50%, 10v=100% etc) that connects to my VFD.QUESTION:
Can I use heater 4 (on pin 13 of the Duet board) as a PWM output by using the following in my post processor?
M307 H4 A-1 C-1 D-1 -- to disable heater 4
M42 P4 Snnn --to send a PWM value -
What firmware version are you on?
Have you seen M453 which sets the machine in CNC mode to allow the use of M3 and M5? -
my Duet3D board
presume you have a duet 2 wifi or duet 2 ethernet? running reprapfirmware v2.x?
Can I use heater 4 (on pin 13 of the Duet board) as a PWM output by using the following in my post processor?
M307 H4 A-1 C-1 D-1 -- to disable heater 4
M42 P4 Snnn --to send a PWM valueby persuming its a duet 2 you're refering to the 50 pin expansion header, that should give you a 3.3v pwm signal, but you might want to use
https://duet3d.dozuki.com/Wiki/Gcode#Section_M453_Select_CNC_Device_Mode
https://duet3d.dozuki.com/Wiki/Gcode#Section_M3_Spindle_On_Clockwise_CNC_specific_Laser_on_Laser_specificinstead of M42, also beware in some case the firmware invert the heater output pins
-
@jay_s_uk
I do use M453 cnc mode. How do I assign a particular pin as a PWM output?
Would it just be a case of M453 P4 R24000 (max spindle speed) and then M3 S255 for max speed? -
depends of the version of the firmware you are on.
Whats the output from M115? -
@jay_s_uk
v2.03I have just been looking at using a fan output instead. M106 P2 Snnn.
Would this work? -
@TonyPagett said in Spindle speed control:
Would it just be a case of M453 P4 R24000 (max spindle speed) and then M3 S255 for max speed?
If your standard heater ports are available I would just use one of those.
And yes, it would be as you've suggested, just using the right pin number (and freeing up the pin)I would also consider upgrading to RRF3 when a CNC orientated version of DWC is released as you can also add a direction pin rather than jumpering forward to ground.
This is a helpful page. https://openbuilds.com/threads/workbee-cnc-w-duet2-and-chinese-spindle-control.14004/
Also connect the grounds on the VFD to a ground on the PSU for the duet (but this would be a DC ground and not an AC ground).I use 3.2 beta 2 on my machine and I have this PWM converter https://www.amazon.co.uk/1-3KHZ-Voltage-Module-Digital-Converter/dp/B0789738RC/ref=sr_1_3?crid=AAYEZCBCA2WZ&dchild=1&keywords=pwm+to+analog+converter&qid=1603813874&sprefix=pwm+to+ana%2Caps%2C160&sr=8-3
-
@jay_s_uk
Many thanks. I will do a few tests using various options.
FYI, my VFD allows me to disable the REV direction (which I have already done to prevent broken end mills!!)
Many thanks again.