Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Direct Connect Spindle to Duet Board - Solution for SoftStart

    Scheduled Pinned Locked Moved
    CNC
    1
    1
    231
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • iptronicaundefined
      iptronica
      last edited by

      I'm using duet board to recorver old CNC machines. In some of my implementation I use heater or bed output to directly drive the spindle motor...

      So if spindle motor don't takes to much power when runing, if i start it imediatly at full power i'll notice some voltage drop in porwer source, and depending on power source maybe voltage can be lower then minimum voltage needed to get all working properlly.

      So one solution was put a "bigger" and more expensive power source. But makes no sense once it will only be necessary when I turn ON spindle.

      My solution, that i wanna share with all, is to implement a "soft start" spindle, by incresing PWM output until reach the speed requested.

      I just chenge SetRpm() function in Spindle.cpp file in firmware:

      void Spindle::SetRpm(float rpm)
      {
      	const float pwm = abs(rpm / maxRpm);
      	if (rpm >= 0.0)
      	{
      		spindleReversePort.WriteAnalog(0.0);
      		//add by IPTRONICA for soft start
      		for (uint8_t spindlestep=4;spindlestep > 0; spindlestep--) {
      			const float step_pwm=(pwm/spindlestep);
      			if ( step_pwm >= 0.20) {
      				spindleForwardPort.WriteAnalog(step_pwm);
      				delay((spindlestep)*200);
      			}
      		}
      	}
      	else
      	{
      		spindleForwardPort.WriteAnalog(0.0);
      		//add by IPTRONICA for soft start
      		for (uint8_t spindlestep=4;spindlestep > 0; spindlestep--) {
      			const float step_pwm=(pwm/spindlestep);
      			if ( step_pwm >= 0.20) {
      				spindleForwardPort.WriteAnalog(step_pwm);
      				delay((spindlestep)*200);
      			}
      		}
      	}
      	currentRpm = configuredRpm = rpm;
      }
      

      Hope this will contribute to project, and maybe someone can easy create a M??? P? parameter to define a soft start time to put in config.g

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA