Results 1 to 11 of 11

Thread: Adventures in X3 spindle control

  1. #1
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0

    Adventures in X3 spindle control

    Hi this is my first post here, I have been building an X3 with the CNCfusion kit and a G540. I have been positing the build progress over at the CNCFusion forum since so far I have been interested mostly in the mechanical parts of the mill. I have been reading the threads here for some time though and found quite a bit of info without needing to post. I have run into a problem with the spindle control though and need some assistance.

    I have been spent most of today and late into the night working to interface my mighty G540 with my X3 from Harbor Freight. I call it mighty since it is a tough controller, and pretty much idiot proof which is why I bought it

    I wired it up according to the diagram here:

    http://pminmo.com/g540-vfd

    EXCEPT, I swapped P1 and P3 since I found them to be reversed on my X3 (the diagram is for an X2 which explains the difference). I measured 6.8V on P3 prior to my adventures (between P1 and P3). I initially attempted to connect a switch to toggle between manual and Mach3 control, but finally (and by that I mean 3-4 hours into it) decided that KISS was the best method for me so I hooked it up directly from my G540 like this:

    G540 pin 7 --- P1 (GND)
    G540 pin 8 --- P2 (VFD IN)
    G540 pin 9 --- P3 (VFD +6.8v)

    I used the settings below for Mach3 after a lot of googling and searching the manuals - I did not really mess with the pulley setup much so it is not optimized.









    Now however when I run the spindle from Mach3 by entering a speed such as 200 and pressing the "SpindleCW F5" button, the spindle turns at what seems like the right speed, but then slows a bit and speeds up a bit and continues doing that until I stop the spindle. It seems to be trying to hold the speed, but just cannot do it consistently. I do not have any feedback sensors hooked up yet so Mach3 is just flying blind as to what the speed really is. I had not read of this problem before and I am suspecting my wiring at this point (interference). I did use shielded wire which is grounded at the controller box, however now that I think of it, the back of the case was open when I was doing the testing so that could be the problem (will be next week before I can test that theory though).

    Additionally, I was not sure on the best PWM Base Freq, I tried 5, 10, and 50 with similar results. Since my Mach3 port has a frequency of 24999 the manual suggested something less than 10, however most of the tutorials have shown the PWM Base Freq as 50. I guess I am going to get a coarser adjustment but I was hoping by going to 50 that it would smooth the speedup-slowdown on the spindle - that did not happen. I posted the settings in case somebody out there running the G540 with an X3 could check them against theirs and advise me what changes may be needed.
    Last edited by Geekus; 08-14-2010 at 07:06 AM.


  2. #2
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0

    More problems

    I would not recommend that anyone hook up their g540 like I did. There seems to be something really wrong with my setup. I went to test it after re-verifying my connections and found that when I turned on the mill with the g540 hooked up, but with Mach3 in reset and connected to the g540 the spindle turned on by itself. I measured about 12v across P1-P3 and 9.9v on P1-P2. I did not write down the steps I took after that (such as hitting the e-stop for the G540 but I think that I did and that may have stopped it. I then disconnected the vfd from the g540 - though with it still connected to the X3 controller and restarted the mill - same thing, it started up on it's own as soon as the fwd switch was thrown - and this is without the pot connected, that was pretty weird to say the least. I measured the same 9.9v from P1-P2 at that point. I never saw a fault light thoughout on the mill.

    I then re-connected the pot without the g540 connected and it ran OK. Finally I reconnected the g540, restarted mach3, checked my configs, changed the spindle setup from 3000 to 2000 steps, rechecked everything and tried again. This time the spindle did respond to Mach3, however it did not seem to be running at the requested speed and I got some funny readings when I checked it:

    requested speed P1-P2 P1-P3
    200 1.9v 4.9v
    600 3.3v 5.2v
    800 3.4v 5.2v
    1000 3.3v 5.2v
    100 0.7v 5.8v

    I also checked it with the power on, spindle = 0 and measured 0.1v across P1-P2 and P1-P3 with the G540 connected. I also noticed that my G540 was very warm - too warm to keep a finger on it so I added a block of aluminum to it to help with heatsinking temporarily. So now I am pretty stumped and am going to call it a day and probably will start from scratch next week with this and re-test the gecko again. I am also going to bypass a switch I installed that toggles P2 between the pot and the VFD out from the G540 - in today's testing I removed the pot from P1 and P3 when testing the VFD, the switch was set to select the VFD for the P2 terminal.

    A couple things (out of many) that bother me about the readings are - how was there 12v across P1-P3? The highest I had seen it previously was around 6.8v.


  3. #3
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0
    Thanks to the threads here (and to CR), and a great write up on pminmo.com (for the X2), I got my VFD working last night when I went back to basics and rewired it all up. I wired it up as posted above (EDIT: Though the wiring was connected as shown above, the voltages are much higher than shown - over -50v on the VFD lines relative to ground) I think the switch I was using to toggle the P2 line from the VFD to the pot was bad. Now that I know it works, I am going to use a new 3PDT switch to toggle between the VFD and pot so I can go back to manual control if I wish.

    I did notice some weirdness when trying to control the spindle from mach3 though, sometimes it did not respond so I had to restart and try it over. I think I am doing it wrong (not exactly sure how to setup the spindle control in mach3) - but it is not starting up on it's own now (was thinking about naming the mill "Christine" for a while there).
    Last edited by Geekus; 08-27-2010 at 12:57 PM. Reason: updating formatting


  4. #4
    Registered
    Join Date
    Jan 2009
    Location
    USA
    Posts
    322
    Downloads
    0
    Uploads
    0
    please keep posting as you work the bugs out...

    I'll be following in your footsteps in a month or so.


  • #5
    Registered
    Join Date
    Feb 2007
    Location
    USA
    Posts
    560
    Downloads
    0
    Uploads
    0

    Question

    If you check the voltage between those contacts on the X3 spindle drive and ground you may be surprised how high that voltage really is. So consider if anywhere in that circuit is referenced to ground what kind of power might be flowing...


  • #6
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by skullworks View Post
    If you check the voltage between those contacts on the X3 spindle drive and ground you may be surprised how high that voltage really is. So consider if anywhere in that circuit is referenced to ground what kind of power might be flowing...
    Thanks Skullworks, I just checked it and it shows -51.9v (read using DC with common on the case ground connection for the mill and measuring in relation to P1). I suppose that is the cheap way to get a DC voltage (go figure). Makes it very important that I am certain of connections and cable routing so that there are no sharp points where the VFD lines could be shorted to the case or me for that matter.

    Timely info for me too, since I was just shocked on 120AC yesterday while working trying to get something else to work (pure Darwin award worthy stupidity). Fortunately it was though fingers on the same hand. I think I got very lucky, but I should have tested first and not just trusted it was off. The AC really sucked my hand in till the GFCI on the wall tripped - worst I have ever been shocked and it was not a fun or forgettable experience.

    I have more to do to get the VFD working the way I want it to (add a new switch), and then I will need to get the mach3 settings tweaked to get the spindle under reliable control.

    I was unable to edit my first post so I reported it to the mods (hoping they will allow me to edit it or remove it and I will then correct it) - since it incorrectly shows P1 as ground - it is not, I measured it at -52v relative to ground - and P2 and P3 are also higher voltage.
    Last edited by Geekus; 08-27-2010 at 12:56 PM. Reason: updating formatting


  • #7
    Registered
    Join Date
    Aug 2004
    Location
    US
    Posts
    5
    Downloads
    0
    Uploads
    0
    thank you for posting your work. I'm working on the same thing (G540 spindle control on a HF X3.) I stopped when I saw the aprox -50v between the P1 (?) and case ground. I have a friend coming over next week to look at it with me.

    If we make any breakthroughs I'll let you know.


  • #8
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by mike345 View Post
    thank you for posting your work. I'm working on the same thing (G540 spindle control on a HF X3.) I stopped when I saw the aprox -50v between the P1 (?) and case ground. I have a friend coming over next week to look at it with me.

    If we make any breakthroughs I'll let you know.
    Hi, that is what is concerning to me as well when I checked it last night. When I first took the measurements I was only measuring between P1 and P3 so I was mistaken when I posed in the first post that P1 was ground - it is really about -52v relative to ground on my mill. I notified the admins to see if I can edit it or if they can delete that part of the first post since I was wrong and P1 is NOT ground.

    I just re-measured relative to the grounding bar on mill and saw P1= -53.2v and P3 = -46.3v so the difference would be around 7v (which is how I arrived at the incorrect P1 and P3 readings in the first post). Please don't take any of this as a how-to though, I am just trying to get mine working and trying to post what I am finding to get some help since I know this will work, and mostly does now.

    I doubt most who had set this up already have as much of a problem as I have though - I complicated my setup from the get-go with a (faulty) switch. I should have just tried it straight though first and would not have had all the weirdness I saw (I think). Now I am going back to my original plan to switch between manual and vfd to see if it still works. Once I get that done I will need to tweak mach3 settings and when I do that I will post the screencaps to show what I ended up with.

    EDIT: Highlighting and formatting is for the sake of warning that the first post has incorrect info - not cause I am an angry dude

    I think there are too many ways to get zapped working in the mill's control board, it is definitely not user friendly and is dangerous (that was not how I got zapped though). I even found a screw that had wedged the white AC neutral line against the power switch my mill and the screw had cut the insulation - that same screw went though the case - so there could be hidden dangers with these mills (QC does not seem to be a big concern).


  • #9
    Registered
    Join Date
    Jan 2009
    Location
    USA
    Posts
    322
    Downloads
    0
    Uploads
    0
    sorry to hear you go bit...

    Be safe.... double check that you are de-energized b4 putting your pinkies in there.


  • #10
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0
    Thanks Matt, that is good advice. I have been extra cautious working on the control box and mill lately. I have been checking and double checking my connections to make sure everything is correct before I apply power - would be very easy to damage the VFD or controller (or me) if I had something incorrectly connected.

    I did just get it working with a switch to manually toggle between VFD and pot control of the spindle though. The toggle is a simple 3PDT on/off/on latching switch that switches all 3 lines between the POT or the VFD to the mill control board - turned out that it was really useful for troubleshooting. The VFD still seems to have a bit of an oscillation in a certain range around 80% of max - though I just remembered that I forgot to close it all up so maybe there was interference. I am still working on my mach3 settings as well.

    I also set up my e-stops so I now have 5 places to stop the spindle and the steppers at the same time. I goofed up when I was deciding how to do it, and wanted to take Peter Homann's advice and shut down all power using a realy, but I realized I had a problem since I was going to use the power supply for the steppers to power the e-stop relay - doh! So I decided that for now it will switch the enable line to stop the steppers and at the same time toggle the mill controllers e-stop (DPST relay). This is not the best way to do it, but I am planning to re-do this with a lower voltage relay and an external power supply which will be on even if the e-stop is thrown (so it can power the relay).


  • #11
    Registered Geekus's Avatar
    Join Date
    Apr 2010
    Location
    US
    Posts
    50
    Downloads
    0
    Uploads
    0
    There is an excellent write up of how to set up the X3 VFD with the G540 and Mach3 in this thread:

    G540 Spindle Control for the X3 / Guide


  • Similar Threads

    1. spindle motor and spindle control dont work
      By customcncparts in forum Milltronics
      Replies: 0
      Last Post: 10-01-2009, 03:08 PM
    2. spindle control
      By uberdude in forum LinuxCNC (formerly EMC2)
      Replies: 1
      Last Post: 06-19-2008, 08:33 AM
    3. Replies: 0
      Last Post: 10-15-2007, 10:46 PM
    4. MrBeans adventures in making a tap and nut.
      By CNCadmin in forum DIY CNC Router Table Machines
      Replies: 0
      Last Post: 12-07-2006, 02:00 PM
    5. MrBeans adventures in making a tap and nut.
      By MrBean in forum DIY CNC Router Table Machines
      Replies: 19
      Last Post: 12-04-2006, 07:48 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.