Damaged Smoothieboard trying to control brushless servo

Hi, I am reviving this topic, trying to run a pro-drive 35-42 1250kv as a drive motor for a tiny spindle. I’m using a YEP brushless 40A ESC to run it. I’ve tested these parts on a TinyG and confirmed it sort of works (spins when M3 command is issued and stops with an M5). Now I’m migrating to a smoothie board for a 5 axis machine. I tried the code from the spindle-module page " HOBBY SERVO ESC AS SPINDLE CONTROL" copied and pasted directly into my config. Tested an M3 command and immediately saw smoke coming from the small mosfet (Q4?). Is it game over for spindle control for this board or are there alternative ways to get out a PWM?

That’s not normal to see smoke there, I would worry about why that happened, before trying to get some other pin to work, risking the same thing happens to it.

About finding other pins for this, there are several PWM-capable pins on the board you can use, you are definitely not out with Q4 gone. Check out pinout [Smoothieware]

1 Like

Sorry I may be wrong, this component fried, highlighted on this board.

I have tried a few PWM pins but to no avail (3.25, 2.4,2.5). I’m guessing there is some issue with my config but not sure what values need to change to properly talk to the YEP ESC 40A.

I’ve tried this code as well and I am getting the humming and beeping I normally get when talking to an ESC, but no motion. (with spindle.enable true) and I do appear to get voltage from the 2.4 pin.

 spindle.type                                     analog   # set the spindle type to analog, can also be used for ESC spindles controlled by a PWM
spindle.max_rpm                                  24000    # set the max spindle speed that is achieved at 100% PWM
spindle.pwm_pin                                  2.4      # the pin which emits the PWM signal
spindle.pwm_period                               1000     # the PWM frequency
spindle.switch_on_pin                            2.6      # the pin which is used to enable the VFD (optional)

I think I’ll continue trying to change PWM frequency, but I am fairly sure I used a similar number on my TinyG and got some motion.
This may not be totally relevant because the switch module is used here to achieve what the spindle module is doing (I think?) but would anyone explain these values, specifically the open drain notation on 1.23o!. I have a feeling I must have wired something totally wrong to fry that voltage regulator or whatever it was.

switch.servo.output_pin                      1.23o!             # spare pin with PWM capability, 3.25 should also work from EXP2, maybe needed to set it to 1.23o!
switch.servo.output_type                     hwpwm
#switch.servo.pwm_period_ms                  20                #set PWM period to 20ms (50 Hz)
switch.servo.startup_state                   true                # turn on the output to have neutral for ESC
switch.servo.startup_value                   7.5               # this is default_off_value
switch.servo.default_on_value                7.5
switch.servo.failsafe_set_to                 0

One last note is that I still have stepper motor control working, seems to be ok there.
Thanks

If you’re confused on what that was, you clearly have not ready enough documentation to be able to safely use the system. Please go over the documentation patiently, following the guides and the pages for the different modules. You can’t use the system without reading the documentation first, that’s how things end up burning down…

Open-Drain is also explained in the documentation (and is something you can easily learn about yourself through the Internet, which you should do).

What did you have wired where when things burned? You say you must have wired something wrong, but we can’t figure that out without some precise information on how exactly you have/had everything wired.

Yea, I guess still more to read, I figured the spindle module doesn’t really have much to do with the Mosfets which I assume are more commonly used for printer bed heating… but after reading spindle mosfet control I realize probably should have read that first.
BUT
if using an ESC then I presume all you need is a pwm signal from a capable pin. what I didn’t realize is that pin 1.23 is connected to a mosfet too. So from my ESC I have three pins, GND,Signal,Power which I plug into GND, P1.23 (using a header not the mosfet GND), and 5V (taken from an endstop pin) respectively. That was the wiring config that led to smoke following the code block below

But if I use a different pin 2.4 for example without open drain, I can get the ESC to beep and enter different sections of the menu by issuing M3 and M5 commands, sporadic motion…and no smoke.

Can anyone relate the information in this part of the documentation taken from the spindle module to this part of the documentation taken from spindle mosfet control
with a wiring diagram?

Thanks

You want to get familiar with pinout [Smoothieware], amongst other places in the documentation, it should help.

So from my ESC I have three pins, GND,Signal,Power which I plug into GND, P1.23 (using a header not the mosfet GND), and 5V (taken from an endstop pin) respectively. That was the wiring config that led to smoke following the code block below

That’s fairly odd. Did you have anything wired into the mosfet’s output ?

The way you are describing having it wired should be correct, though I’d try using a different PWM pin now that the mosfet for 1.23 burned.

I’d recommend P3.26: that goes to your ESC’s signal pin.

But what I’d recommend first, before wiring anything to your ESC, is you configure the switch module to use P3.26, then use a voltmeter to verify that sending commands actually changes its output, and that you can get it both to turn on, turn off, and set intermediate PWM values.

Nothing else plugged into mosfet out. with this code block I get on and off 3.3v and 0v but no intermediate values on pin 3.26

switch.servo.enable                          true             # Servo module for PWM control
switch.servo.input_on_command                M3
switch.servo.input_off_command               M5
switch.servo.output_pin                      3.26             # spare pin with PWM capability, 3.25 should also work from EXP2, maybe needed to set it to 1.23o!
switch.servo.output_type                     hwpwm
#switch.servo.pwm_period_ms                  20                #set PWM period to 20ms (50 Hz)
switch.servo.startup_state                   true                # turn on the output to have neutral for ESC
switch.servo.startup_value                   7.5               # this is default_off_value
switch.servo.default_on_value                7.5
switch.servo.failsafe_set_to                 0

But with this code block

spindle.enable 					true
spindle.type                                     analog   # set the spindle type to analog, can also be used for ESC spindles controlled by a PWM
spindle.max_rpm                                  10000  # set the max spindle speed that is achieved at 100% PWM
spindle.pwm_pin                                  3.26      # the pin which emits the PWM signal
spindle.pwm_period                               16000     # the PWM frequency
spindle.switch_on_pin                            2.6      # the pin which is used to enable the VFD (optional)

I get on off and pwm range.

Well, if the spindle module does on, off and intermediate pwm power, you’ve got everything working now, right?

not quite, I can get my ESC to beep, to cycle through menus but can’t actually get the motor to spin, or at least to spin consistently. Just to keep going with this project I’m using an arduino with a Pot to vary the speed of the motor, outputting pwm probable the same thing smoothie is outputting but maybe at a different frequency. Just like with the TinyG I think I have to keep playing around with period settings and max rpm until the motor starts turning. thanks for help

But like, if the Smoothieboard can output 0V, output 3.3V, and output PWM-ed 3.3V with all the values in between, then it’s not a Smoothie issue, and it’s some kind of issue with the ESC, right?

What more could/should the Smoothieboard be doing here? Am I missing something?

Do you have documentation for the ESC’s interface?

Do you know what exact frequency it’s expecting?
Have you tried several frequencies at random just in case it helps/changes something?

Does the ESC maybe need/want 5V instead of 3.3V (again, the ESC’s documentation would help/tell you this)?
And if it does want this, then you want to look up/learn/understand Open-Drain, and use that to control the ESC with Smoothie using Open-Drain to output 5V instead of 3.3V.

1 Like