Hello everyone. I am new to CNC so I need your help.

Hello everyone. I am new to CNC so I need your help.

I just got my TinyG (yesterday) and set it up in my CNC3040 (I bought it a couple of months ago). It works amazing. I can moving around axis X,Y and Z.
My problem is with the spindle. I control the spindle with the PWM driver it came when I first bought the CNC. when I am not running any gcode, I can move around X,Y,Z axis and the spindle also works . all work like it’s suppose to be. But when I try to run gcode (the chilipeppr logo, this was my first try on chilipeppr) it doesn’t works. But when I turn off the spindle , the machine can run the gcode. I am attaching a picture of the PWM control for the spindle.

I also dont know what is the little thing that is connect between them (I am attaching a couple of picture too).

Also noticed something, whenever I use the spindle , the light of the Mot1, Mot2 and Mot3 go on but the brightness is low. And when I only use the stepper motors without the spindle, the LEDs go on too but are more bright. I am attaching two pictures, one for each situations.

The spindle is 500w., the power supply is 24v 8.5A . this is the link where I bought the CNC https://www.aliexpress.com/item/CNC-3040-Z-DQ-3-axis-CNC-Router-Engraver-Ball-Screw-Cutting-Milling-Drilling-Engraving-Machine/32821715266.html

Can you help me?


You say that when you’re not running gcode, the spindle works? Presumably using a button in the interface? It sounds to me like the CAM system you’re using is choosing the wrong code for powering the spindle, or you have the CAM configured incorrectly. In the very beginning of the gcode you’re sending, there should be a g0 to move to the point where you’re going to start milling, and then something like M4, M5, or M6, that actually turns the spindle on and tells it which direction to rotate.

Hi @John_Bump . Yes using a button to turn on the spindle and a potentiometer to control the PWM . separately to the TinyG. I will check the beginning of the gcode. Thanks

In addition you might check the power supply values when the spindle is energized. The dimming LEDs may be a clue that dc supplies are overloaded.

Do you have a relay connected to control spindle on/off operation via TinyG?

Connect Spin to relay In (and also VCC and GND). Spindle motor-wire1 should be connected to relay output1, relay output2 should be connected to Motor1 on spindle controller board and Motor2 on spindle controller board should be connected to motor-wire2.

Tiny PWM should be connected to spindle controller board PWM input and other input to GND.

This way you will be able to control spindle with M3 (ON) and M5 (OFF) commands. You have to provide spindle speed at the first M3 or this will not run the motor e.g. ‘M3 S12000’.

Make sure TinyG settings are correct:

I use settings from above on my 3040 with no issue.

In case your machine stops accidentally during job, this might be due to electrical noise given by stepper motors and spindle. You may disable limit switches alarm action as a temporary workaround, but it is your responsibility to make sure the machine will not go beyond working area or into the bed. Good luck with Chilipeppr logo :wink:

@sszafran if you control the motor with the TinyG pwm the M commands will also control the motor no?

I also run the 48V to the motor through a master spindle power switch.

PWM is needed to set the motor rpm (0-12000 for this spindle), while motor ON/OFF command is controlled via Spin output on the TinyG board. TinyG is using 3.3V logic, that is why relay is needed to allow switching between ON and OFF states via the software M3 and M5.

Long story short, there are 2 TinyG outputs needed to control the spindle motor:

  • Spin connected via the relay to control spindle motor ON (M3) and OFF (M5) operation
  • PWM to control speed (Sxxxx after M3).

Add this parameter setting to Sebastian’s list:
Otherwise, if you are using the PWM output of tinyG to control speed, the spindle will always be on because the off state is defaulted to 0.1.
You need to provide a wiring diagram of your connections.
Unfortunately, the link you provided does not specify much about your spindle controller interface. I have seen recent pictures of something like this that is MACH2/3 compatible, but not tinyG compatible.
The Mach 2/3 interface is a voltage controlled speed setting (0-10V, maybe), whereas the tinyG PWM control is a logic (3.3V) digital PWM stream, with Pulse widths variable between 0% (Off) and 100%, depending on parameter settings.

Are your motor LEDs “dim” when motor is running?
If so, dimming is normal. The LED is connected from one of the 4 field wires to ground(the A1 lead) When running, the voltage will statistically be positive or negative, hence dimmed. If the motor is at rest, the led may be hard on (bright) or off.
The Motor LED is NOT a logical “Motor is moving” Yes/No indicator.
See Schematic here https://github.com/synthetos/TinyG/blob/master/hardware/v8schematics/v8h/tinyGv8h%20-%20schematic%20page3.pdf

Oscar - give this thread a read. I believe it features the same Spindle kit that you have. That users experience was not “pretty”, the tragic death of a tinyG

@cmcgrath5035 , @sszafran , @r.v.oscar9318

Ah, I noticed that most CNC controllers use an analog 0-10 vdc signal for speed control. @r.v.oscar9318 , I echo @cmcgrath5035 suggestion that a circuit diagram that shows how you spindle driver is connected to the TinyG and the motor would help.

Puzzling I am pretty sure that I only have one signal to control the spindle, the PWM. [I have been travelling so I have to recheck when I am again in the shop].
I can control spindle and off with M commands and the spindle only runs if I have issued an M command or a Gcode program is running. The PWM is asserted only when an M [on] command is active?

Hi everyone. So this is what happen.

I took out the speed power converter for the spindle and It worked, a least I could runed a gcode of a PCB I had (in the air, I had not the material). this was the first test. So I think this speed power converter make some kind of inteference in a way that make the TinyG disconnect and make it stop (this was happening early when I make the post) .
When I runed a second test, It went well but at one point It got stuck again. I lower the RPM of the spindle (0 RPM) with the potenciometer in the speed power converter , and a few seconds pass and the TinyG reconnect and continue the job. then I higher the RPM of the spindle. and went well.

So … what I did it is not a 100% solution. What is happening exactly? what can I do? any suggestions ? Thanks again to all :slight_smile:

[this is the Spindle Speed Power Converter that came with the CNC when I bought it: https://goo.gl/kqHq3S ]

@r.v.oscar9318 its still a little bit hard for me to see what your configuration is but let me try an provide some useful ideas:

  1. Your spindle motor is connected to your speed controller and you control the speed with the pot on the controller. There is NO connection from the speed controller to the TinyG?

  2. The TinyG will operate normally some times and other times it will stop but it only stops when the spindle motor is running. When you run it without the motor running it runs properly?

If #1 and #2 is true then I think you may have a ground loop between the TinyG’s supply and the spindle motor or noise injected to a control signal from the motors current.

  1. Best I can tell the spindle controller runs from AC and the supply and its output is not referenced to anything? The motor and the controller are electrically isolated from the TinyG, YES?

It looks like the motor wire is running in the harness with the other signals so you could also be getting noise from motor currents.

You can be also getting noise coupled into the ac power. I did not previously catch your question as to what the "… the little thing that is connect between them" is. Its an AC line noise filter.

  1. What other wires are in that same harness, stepper motors?

  2. Do you have end-stops connected? I don’t think so?

My guess is that the TinyG is getting reset from some noise source. Not helpful I know but it hard to see exactly how things are wired and what wires are near each other.

  1. When the TinyG stops what lights are ON other than the motor lights?

  2. How is the line filter connected in the AC circuit I cannot tell from the pictures (can you provide a drawing).

    If it were me I would start by connecting all the metal cases of the power supplies and the line filters ground to a common bolt using ring tongues. Do not daisy chain.

If that did not work I would tie the DC grounds of any power supply going to the TinyG to that same bolt.

I do not think that you can tie the gnd of the spindle motor to the same point as I do not know if it is connected in a HIGH or LOW side configuration.

You can try taking the motor cable out of the harness …

Noise problems are tough to find…

Another place is spindle noise on the serial data cable. I moved mine away from the spindle cable till I was able to buy a nice one with a ferrite ring.

well i think I solved my problem. I am using a shorter USB cable, but for this I had to use a raspberry pi. The dimmer LED not longer flash when the spindle is working, I also reduced the noise connecting all to ground as you told me. Thank you guys :slight_smile: