584,837 active members*
5,367 visitors online*
Register for free
Login
IndustryArena Forum > Other Machines > PCB milling > CNC 3020T-DJ Spindle Control, JP-382A JP-1482
Page 1 of 3 123
Results 1 to 20 of 47
  1. #1
    Join Date
    Sep 2014
    Posts
    123

    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 Click image for larger version. 

Name:	2014-09-16 13.28.42.jpg 
Views:	116 
Size:	80.4 KB 
ID:	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.

  2. #2
    Join Date
    Sep 2014
    Posts
    123

    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!

  3. #3
    Join Date
    Jun 2014
    Posts
    16
    Thanks for sharing this information with the rest of the community, I'm sure that it will be greatly appreciated. I've been trying out your method and unfortunately not had much luck. I can't quite find out why yet, but I'm beginning to suspect that I might have a hardware problem. To that end, I was wondering if you would be kind enough to repost the schematics you mentioned in post 1. When I click on the links I get taken to a forum error page (Invalid Attachment specified).

    Many thanks,

    Bob (G8GFA)

  4. #4
    Join Date
    Jun 2014
    Posts
    16
    I've now got this mod working. Originally, when I carried out the alteration, the spindle would be rotating all the time no matter what the position of the spindle on/off switch or how Mach3 was configured. Removing the parallel cable from the controller box caused the spindle to stop, but as soon as it was placed back in position off the spindle went again. To cut a long story short, what I discovered was that logic 1 (spindle off) on pin 1 of my desktop PC parallel port is only 3.4 volts! It seems that this is too low to turn off the led on the DDO opto-isolator with the consequence that the spindle rotates continuously. I confirmed the problem using an old laptop which has a parallel port logic 1 represented by 4.8V. Result - the mod works perfectly! In all other respects the desktop port controls my miller perfectly. A new parallel port card is required I think.
    Last edited by Mellbreak; 09-24-2014 at 07:28 PM.

  5. #5
    Join Date
    Sep 2014
    Posts
    123

    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!

  6. #6
    Join Date
    Jun 2014
    Posts
    16
    Hi,

    Thanks for taking the time to reply. I've obtained a new parallel port card and all is well. Having Mach3 turn the spindle off/on is really useful. At least I find it so.

    Your comments are on using PWM are equally interesting. I too have been having a play and unfortunately been equally unsuccessful. However, I have had another idea. What about replacing the the 5K manual pot with a digital one and a bit of control circuitry? Suppose a 256(ish) step, 5k digital pot is connected to a micro-controller. The PWM signal could be integrated to produce a DC level, which in turn would then be read by an analogue to digital converter on the same micro-controller. The digital value of the DC could then be used to set an appropriate level on the pot.

    An alternative might be to time the length of the positive part of the PWM signal and use that value to control the digital pot. On the plus side this would allow a simpler (and therefore cheaper) micro controller to be used. I wonder if the down side might be that this method is more prone to noise problems. I guess it depends on how clean the PWM signal is.

    The additional hardware involved should not be too complex or costly. Anyway, I think I'm going to have a go at this.

    Any thoughts or comments gratefully received!

    Thanks once again for all your efforts.

  7. #7
    Join Date
    Sep 2014
    Posts
    123

    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.

  8. #8
    Join Date
    Nov 2014
    Posts
    5

    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

  9. #9
    Join Date
    Jun 2014
    Posts
    16

    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.

  10. #10
    Join Date
    Sep 2014
    Posts
    123

    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.

  11. #11
    Join Date
    Jun 2014
    Posts
    16

    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?

  12. #12
    Join Date
    Nov 2014
    Posts
    5

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Same here still watching would love to get it working too.

  13. #13
    Join Date
    Jun 2014
    Posts
    16

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    My intention is to do a bit more work on the software (hardware seems fine) and then offer it to those who might be interested. More details will follow, I just want to make sure that there's nothing unforeseen happening in the software. What part of the world are you in Terry?.

  14. #14
    Join Date
    Nov 2014
    Posts
    5

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    I'm in Idaho USA. I do have one question and that is did you look at the 4 pin connector on the motor control board JP-1482 that the pot goes too? I was wondering if the switch that is on the back of some units switch the third pin (Red Wire) from the pot to pin 4 to enable the PWM to be controlled by the mach 4 software? Could it be that simple? Thanks Terry

  15. #15
    Join Date
    Jun 2014
    Posts
    16

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    I was wondering if the switch that is on the back of some units switch the third pin (Red Wire) from the pot to pin 4 to enable the PWM to be controlled by the mach 4 software? Could it be that simple? Thanks Terry
    I don't think so Terry. I seem to recall trying this myself and, also, a comment by kb0nly to the effect that he'd mapped out part of the PWM circuit on the board only to find it came to a dead end.

    Terry (and anyone else), are you in a position tell me what the maximum RPM of your spindle motor is? Off load mine is 13200. I need this information to try and get a good fit between the Mach3 RPM number and actual spindle speed. I really just want to know if my figure is typical.

  16. #16
    Join Date
    Nov 2014
    Posts
    5

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Have not checked on the speed but the motor is rated for 12,000 rpm. Also the forth pin I have been talking about go to MCU chip STC 12C5616AD Pin 15 Which is labeled P3.7/PCA0/PWM0. From the spec on the chip it would have to be programmed to use all of the functions. This pin also goes to pin 4 of an Optocoupler EL817 labeled (off) on the board and pin 1 of EL817 goes to pin 1 of the 4 pin connector for the PWM. If the MCU was not programed for that function that could be why it will not work.

    Just a guess at this point but when pin 4 and pin 3 are connect the resistance is controlled by the MCU not the pot. When my JST connectors come I will try it out. Also the manual I have listed in an earlier post is for a Z-D system that uses the switch on the back of the box it also has all the setup info for Mach 3 to control the drill on/off and speed.

    Do not try this unless you take all the responsibility for causing any damage to your system if it does not work.

  17. #17
    Join Date
    Jun 2014
    Posts
    16

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Well I've now got the software into a usable state. It's by no means perfect, but given the limitations and quirks of the original controller board, it doesn't do too bad a job. In reality I suspect any PWM controller using an unstabilized power supply and no motor speed feedback system would face many of the same difficulties.


    A couple of pictures of the board for anyone who might be interested.


    Attachment 262864 Attachment 262866


    kb0nly's nifty automatic stop mod still works, which is nice, and my add on board requires no mods to either of the original controller boards.

    I'm happy to post further details, including the software hex file, if anyone's interested.

    Happy new year to all.


    Bob

  18. #18
    Join Date
    Jan 2015
    Posts
    4

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Thank you both kbOnly and Mellbreak for sharing your progress. I also wanted to use more of the Mach3 controls for my 3040Z-DQ machine.
    Mellbreak, would you mind sharing your source for the connector and plugs? I'll see if I can cross reference to Mouser or DigKey here in the US.

    Louie

  19. #19
    Join Date
    Jun 2014
    Posts
    16

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Hi Louie,

    All the connectors are standard JST parts from eBay....


    For example:

    Mini Micro 1 25mm T 1 4 Pin JST Connector with Wire x 10 Sets | eBay

    and


    ww.ebay.com/itm/10set-2-5-XH-4-Pin-JST-Connector-plug-Male-Female-Crimps-/171346705559?pt=Radio_Control_Parts_Accessories&ha sh=item27e50f3c97

    If there's anything else I can help with, shout up.

    Bob

  20. #20
    Join Date
    Jun 2014
    Posts
    16

    Re: CNC 3020T-DJ Spindle Control, JP-382A JP-1482

    Hi Terry,

    Just tried your suggestion regarding pins 3 and 4 on my board - no luck I'm afraid. If yours works out differently, do let us all know. It would be a neat solution.

    Bob

Page 1 of 3 123

Similar Threads

  1. Need help with eBay 3020T-DJ
    By morbidmind6 in forum Chinese Machines
    Replies: 2
    Last Post: 06-20-2016, 05:15 AM
  2. It's Alive! 3020T-DJ
    By kb0nly in forum PCB milling
    Replies: 0
    Last Post: 09-21-2014, 06:46 AM
  3. 3020t Size and specs
    By tracyaf_2 in forum Chinese Machines
    Replies: 0
    Last Post: 09-07-2014, 05:33 AM
  4. No Movement Cnc 3020t-dj
    By seriousman in forum Chinese Machines
    Replies: 3
    Last Post: 09-03-2013, 02:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •