4 Attachment(s)
CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Ok, i got tired of having to flip the Spindle switch all the time and decided it was time to get Mach3 doing its job!
I have a newer version of the Chinese CNC 3020T-DJ with a black controller box and the controller board is model JP-382A and the spindle board is JP-1482.
The controller has a PWM output and the spindle board has a PWM input but they are not connected. Here is some pictures i included on another post..
Attachment 250510 Attachment 250512
After i got done adding home switches to the controller i also started to trace out the boards to figure out the Spindle control.
You need two JST-XH connectors to make the interconnect cable, also if you want to add limit/home switches its the same 4 pin JST-XH connector, look on eBay for LiPo balancing cables and connectors as they are used in the LiPo battery packs.
Note... I don't yet have the PWM speed control working, still finishing up how to set that up, but i DO have Spindle On/Off control now from Mach3! The PWM control just wasn't as big of a concern for me as i generally run it full speed all the time for PCB milling.
Ok, on the controller board the jack marked PWM i numbered them from the back panel forward, pins 1-4.
1. LPT Port Pin #17 to Spindle Controller PWM Input
2. +5v from Spindle Controller to the EL817 labeled DDO, This is Spindle On/Off
3. Ground from Spindle Controller
4. Spindle On/Off
On the Spindle Controller board i labeled the pin numbers Left to Right looking at it from the front panel, pins 1-4.
1. PWM
2. +5v
3. Ground
4. Spindle On/Off
The front panel Spindle switch only switches a ground on the Spindle Controller and its in parallel with an Optocoupler, part number EL817, on the Spindle Controller board. So you can leave the front panel switch for manual control and leave it in the OFF position to allow Mach3 to turn it on and off.
You need to make a cable so that its matching 1-1, 2-2, 3-3, 4-4, using the pinouts as i described them. The plug orientation is flipped, so pin 1 on plug on one end of the cable would be the opposite side of the plug on the other end. You will understand what i mean when you look at the jacks, the controller board has its jack going front to back with the keyway to the left and pin 1 towards the back, but the spindle board has its jack going left to right and keyway to the back and pin one on the left. So the cable is a flipped crossover config.
Set Mach3 for Active Low on Pin #1 to turn the Spindle On/Off.
Set Mach3 to control the Spindle PWM using pin #17
Now, as i said i haven't hooked up and configured the PWM control to pin 17 yet, so all i wired up was three pins between the boards, i didn't install the wire from pin #1 on the controller to pin #1 on the spindle controller, thats the PWM control. You need pins 2-4 for On/Off control as the Spindle controller board feeds +5v back to the controller board via pin #2 to run the Optocoupler labeled DDO, the output of which toggles another EL817 optocoupler on the Spindle board that then enables the spindle motor, the front panel switch is wired in parallel across the Optocoupler on the Spindle controller board which gives manual control and can be left in place.
Here is some schematics i drew up quickly... Notice that pins i didn't continue to trace out for PWM on the Spindle board or the ENO Opto on the Controller board are marked unknown. Also in the case of the EL817 marked ENO on the Controller board note that Pin 1 of the component was clipped and bent back at the factory, ENO looks to have something to do with the A-Axis as its connected to one of the pins of the four pin header marked A-Axis, i didn't continue tracing that out as it wasn't necessary. Also pin 2 of ENO dead ends at a set of open pads on the back side of the board, i would guess there should be a 330 Ohm resistor there as they kept the same basic design across the boards, using a 4.7k pullup resistor to 5v on pin 1 and a 330 ohm resistor on pin 2 on the others for what i would assume is current limiting through the optocoupler.
Attachment 250418 Attachment 250420
Anyway, with a three pin jumper you can make the Spindle On/Off control work with Mach3, or whatever software you use, but i haven't got the PWM config working just yet. I would assume it requires removing the front panel trimpot from the circuit, either just unplugging it or installing a jumper as in the other versions of these boards but i don't have that info yet.
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Milled a few PCB's today, the on/off control from Mach3 works great after getting the settings done.
All you have to do is go to ports/pins, spindle control, uncheck the box labeled Disable Spindle Relays, then put in the output you want to use in BOTH boxes. Now note this is not the pin number but the output number that you assign to the pin. I used 1 in both boxes just to keep everything organized in my notes, click apply, then you go to the output signals tab, find Output #1 or which one you assigned and set it for the port your using, in my case 1, and the pin you want assigned, in the case of this controller you need pin 1.
Now again apply and ok and then go to the diagnostics screen, click spindle on/off and you should see the Output #1 light up and your spindle should run. Also on the Spindle Control tab in ports and pins you should set the spinup delay under General Parameters. I set all four to 5 seconds, just to give the spindle some time to come up to full speed before the program advances into the material and also a bit of spin down time before it would happen to move after an M5 command in the GCode.
Works perfectly!!
Now i can open my GCode hit cycle start and it spins up, makes the cuts, spins down, and i generally add some GCode to move the spindle out of the way after the end of the cut, jogs to the top left corner of the table out of the way to cleanup and remove the piece i just made, etc. Now i am VERY happy with my setup!
I might have to take the Spindle Control Board back out and finish tracing it out for the PWM control. Other versions of this controller have a switch on the back to set either manual or software control of the spindle speed, but this board doesn't have any additional switch inputs for that, so i am guessing that something has to be done with the trimpot connection. The main reason i am thinking so is that the connector the trimpot plugs onto is just a set of header pins like you would put a PCB jumper on, otherwise i don't see why they didnt put a JST-XH socket there instead, that leads me to believe that you have to put a jumper on it to bypass the manual speed control.
More to come!
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Interesting! I was just about to post that it might be too low of a pullup voltage on the computer side. What you could do is if your running a parallel port card now instead of an onboard parallel port is to trace out the DB25 from pin 1 until you find a pullup resistor to 5v, shouldn't be too hard to find, and measure that resistor and replace it with a lower value to increase the voltage on pin 1. Would be a lot harder to find if it was an onboard port on a motherboard just because of board density, but on a card it shouldn't be too hard to do. I used to do that all the time on parallel port cards back in the days of parallel port printers that would stop working because they weren't getting anywhere near 5v on an enable line from the port. Always made you think the port was bad or the printer was bad until you tried another parallel port and it worked again.
I just tried clicking on the schematics and they work fine, are they still not working on your end? If not feel free to drop me a PM on here and i can email them to you instead.
I worked on the PWM speed control tonight, not possible, at least on my board. The PWM input on the spindle board dead ends to some unpopulated pads and there is no connection to the MCU's digital input to control the PWM output. This board unlike the previous version doesn't use a simple 555 timer in the circuit, it has a one shot MCU programmed for the application. It reads the resistance on the analog input from the trimpot and adjusts the PWM output to an optocoupler that then controls the IRF740.
Oh well not a big deal to me, i just wanted it turn the spindle on and off and i accomplished that at least!
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Thats along the lines of what i was thinking, digitally controlling the resistance input to the MCU's analog input from the computer. Entirely possible.
I probably won't have time to tinker on that until i get some spare time this winter, the fall season is busy season for me. If you make any progress be sure to post about it!
I think having Mach3 being able to turn the spindle on and off is more useful then controlling the speed, at least from a safety standpoint. Its nice to hit the emergency button and everything shuts down! Can't believe they didn't do that from the start. But it would also be handy to be able to control the spindle speed when changing materials.
1 Attachment(s)
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
I have been working on another issue when I ran across a 3020Z-DQ manual which has a setup for Mach3 controlling the spindle. It give the setup for it and this CNC system has the switch on the back of the back of the control box for the spindle. Don't know if it will help.
Thanks Terry
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
I don't know if there is anyone still reading this thread, but I've made some progress on this front. I can now control the spindle speed from Mach3. I have to say that its not been too easy. The spindle controller has some interesting quirks!
I'm now working to get a better relationship between the speed indicated by Mach3 and the actual spindle speed. If there's any interest I'll consider posting the details.
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Still watching here! Post the details, would be interested to see how you got this working.
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
In short I've built a small board which has on it an opt-isolator, micro controller (PIC16F628) and a digital rheostat. The micro controller measures the length of the PWM period and produces a numerical value. Software takes the PWM number and performs some simple calculations on it. The result is value which is then fed to the digital rheostat. In theory the number on the Mach3 display should have a relationship to the actual spindle speed - which it does.
However, it is not without its problems. As you will know, the power supply is unregulated and so the motor speed varies with fluctuations in the mains voltage. Also what speed are you actually measuring - it's going to vary with load.
The actual controller board (JP-1482) also has some interesting quirks - try marking a position on the spindle control pot. Start from the minimum setting and rotate the knob to the marked position. Note the spindle speed. Next rotate the knob until you get maximum speed and then move it back to your marked point. Measure the speed once more. You'll find there is a several thousand rpm difference!!!!
Anyway, I've managed to sort most stuff out in software. I just need to do some more work on the mapping between the speed indicated on Mach3 and actual spindle speed.
Any progress your end?
Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Same here still watching would love to get it working too.