Author Topic: Denford Cyclone retrofit  (Read 11051 times)

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Denford Cyclone retrofit
« on: July 24, 2015, 12:40:11 AM »
This retrofit was intially completed about 18 months ago, but I'm reposting it here as I'm in the process of building a stand for it (it's never been moved of the pallet it was delivered on!), and am looking to convert from Mach3 to KMotionCNC.

These posts have been copied from the original build thread over on the Mach support forum at http://www.machsupport.com/forum/index.php/topic,25493.0.html, which is probably worth checking out, as I've only copied across my own posts, so some comments may not make much sense without seeing the other posts.

Quote from: mc
September 22, 2013, 12:36:46 AM
Whilst lounging about on holiday last month, this popped up on the radar

New Toy by mc_mtb, on Flickr

Once back from holiday, I had been planning to order all the bits to get my Matchmaker mill up and running, then look at getting something bigger to replace my little Conect lathe, however this Cyclone happened to pop-up just before I ordered anything.
My main reason for purchasing it, is it's a 35mm through hole version, which ties in nicely with my future plans. It also comes with a 6 position toolchanger.

Initially I was going to go a for a quick retrofit using a PLCM-E3 controller coupled with the PLCM-B1 BOB as the BOB is 24V tolerant, so connecting everything would of been reasonably straight forward, with the only other items needed being a couple stepper drivers, a bridge rectifier, and a big capacitor to give me a power supply for the steppers, however the PLCM stuff was out of stock in the UK with a lead time of two weeks. Also some reading up that the PLCM doesn't support threading, and all english pages disappearing from their website put me of using it.
Instead I've opted for a bit more involved retrofit, using the Dynomotion KFlop+Kanalog I had already bought for the mill, and fitting servos.

Here's the control cabinet prior to delivery -

Electrics as Delivered by mc_mtb, on Flickr
The original setup used an Optimised Controls rack fitted with a Eurostep controller, and rack mount Parker SD15 drives.
I spent some time today removing the old rack along with the wiring I know I won't need, and getting the Kanalog and servo drives mounted in place. I also managed to get an extra single phase contactor for the servo drives in place and connected into the E-Stop controlled supply.
As of this evening, this is how the control cabinet sits-

Out with the old, in with the new by mc_mtb, on Flickr

I'll hopefully start getting things wired up tomorrow.
« Last Edit: July 24, 2015, 01:15:08 AM by mc »

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #1 on: July 24, 2015, 12:43:32 AM »
Quote from: mc
September 22, 2013, 09:46:20 PM

I got as far as getting the 240V input/switch panel made today, and power from the main contactor to the drivers. I need to go shopping for some heavier wire to get the contactor connected to the inlet socket. I'm aiming to get started on swapping the stepper motors for the servos tomorrow, which will involve a bit bracket modification on the Z-axis to allow for the change in pulley size.


Hood, I'll probably be racking your brain at some point regarding the Toolchanger.
In fact, I'll do it just now!
I'm going for having it PLC controlled over Modbus, however I'm not sure on how best to handle interlocking it. I was thinking of having a ToolChanger OK signal from the PLC into the KFlop, which goes low if there is any fault (i.e. the toolchanger becomes unlocked for some reason), or if the current position doesn't match the commanded position. The only issue I can see with that, is I'd need to make Mach stop in case of a fault, yet ignore things during a toolchange.
So I'm thinking have two signals into the KFlop. One for faults, and one to signal a toolchange is complete.

I could check tool change is ok over modbus, however that would involve continual checking, and at somepoint I'll be looking to add some controls via modbus, and don't want to be using the modbus too much.

I know you use PLCs for toolchangers, but how are you making sure things stop if there's a fault?

Quote from: mc
October 05, 2013, 11:49:40 PM

Just a quick update.
Things are progressing, but a real job and sideline jobs are keeping me away from getting this finished.

I've got all the new electical bits mounted and the power wiring almost complete. The new pulleys and mounting brackets are just about complete, with only a few holes left to be drilled and tapped.
I'm aiming to get the control wiring mostly done this week, so I can test the servos before I bolt them on, then that just leaves the tool changer and tooling up.

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #2 on: July 24, 2015, 12:46:25 AM »
Quote from: mc
October 07, 2013, 12:18:27 AM

I got started on the KFlop and servo wiring today, which is going reasonably well. Took a quick photo before I gave up for the night -

Progressing by mc_mtb, on Flickr

And here's the shiny 240V input panel-

Almost professional by mc_mtb, on Flickr
(don't look too closely, as I got carried away with the filing and filed a corner I shouldn't of!)

Quote from: mc
October 07, 2013, 09:23:45 PM

Servos work!

Took a bit head scratching with the instructions to figure out all the required settings, but they're now working under KFlop control. Still got to add in the fault relays/wiring, and attach them to the lathe, but they spin.

And going back over this, has made me realise I never mentioned what Servos I used.
For the X-axis I opted for a 400W servo, along with a 750W servo for the Z-axis, matched with Kinco CD422 drives, all provided by the helpful people at Zapp Automation.
« Last Edit: July 24, 2015, 12:52:56 AM by mc »

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #3 on: July 24, 2015, 12:55:18 AM »
Quote from: mc
October 13, 2013, 11:43:30 PM

Managed to get the Z-axis motor bolted on during the week, along with various bits of wiring. I ran the auto-tuning for it today which shaked things about a bit, but not anywhere near as much as hitting the step button in the KFlop step response screen. I had meant to hit the move button, but clicked the wrong button, which resulted in moving the servo motor a quarter turn and back again as quickly as possible.

I went to connect in the home sensors, but turns out they're NAMUR output which means there's no easy way to connect them into the KFlop, so I'll need to order some new ones.

I got the spindle wired up today, and tested it. Spins up nicely, however the encoder doesn't appear to output B signals, just A and Z despite the label and wiring having the full compliment. I'll need to get a scope on the extra wires and see what's happening. I'm not too bothered about the lack of B, it's just I'll need to figure out how to set-up the KFlop to handle it.

Also spent some time removing all the remaining extra bits and wiring, and the cabinet is looking neater already -

Looking Neater by mc_mtb, on Flickr

I started to finish of the X-axis motor mount, but can't find a suitable tap, so I can't get the X-axis bolted on until that turns up.
And I'm still waiting for the additional IO module for the PLC to turn up.

Quote from: mc
October 21, 2013, 01:34:53 PM

I've managed to get the new home sensors wired in. I still need to test/adjust them, but they're both in ready to go.
The X-axis servo is now bolted up, and ready to go.

All wiring outwith the control cabinet is now in place. It's just a case of securing the servo wiring, bolting the Z+ limit switch (the home switch is mounted onto the switch block) back on, and putting the various covers back on.

I'm still waiting for the additional IO module for the PLC so I can get the tool changer wired in, but the majority of the wiring is in place already for that. It's just a case of connecting up the turret sensors/control cable and the contactors.
Other than that, I just need to finish wiring in the servo fault relays so the drives all stop on a fault, and connect the KFlop enable relay into the E-stop circuit so nothing powers up until the KFlop has booted.

Nothing much will happen this week though, as I'm away until friday on a training course.

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #4 on: July 24, 2015, 01:01:53 AM »
Quote from: mc
October 22, 2013, 10:42:16 PM

One of the Automation Direct Click PLCs.
Originally picked them for cheapness, but miscounted the number of inputs/ouputs needed, so had to buy one of the additional IO modules. One feature I skipped over during the orignal decision to use a Click PLC, is the Kanalog has a connector designed to connect directly to the Click plus comes with sample code to talk to the Click.

The order is late as apparently the courier has lost the last UK distributor order, so everything has had to be reordered.

Quote from: mc
October 26, 2013, 01:03:47 AM

The IO module finally turned up today.
I've got it in and mostly wired up. The turret locked/thermal switches still need to be connected, and the Click to the Kflop (2 IOs and the serial cable), which I'm aiming to get done over the weekend.
After that, the main thing left is dealing with all the programming. I need to get the ladder logic finished, finish tuning the servos, sort the C code for the KFlop, and get the KFlop talking to Mach.

I'm considering switching the servos to torque mode, as most of the latest debates I've seen about Torque via Speed seem to say Torque gives better performace.


Yes, I ordered the Click via Lamonde. I had to wait for the main module to come from the states aswell.
I could of done the turret directly through the KFlop, however I would of had to make an interface board to make use of the low voltage inputs on the addtional header. I'm going to use the lathe as a bit of a test bed to see how well the KFlop works with a PLC for extending ins and outs, as I'm still undecided on how to handle the matchmaker as it's going to need a good bit more IO. I had been considering some custom arduino boards with modbus and 24V IO, but a couple Clicks may make life a bit easier.

Quote from: mc
October 26, 2013, 10:42:00 PM

Finished most of the wiring tonight. I've got 4 stray wires that I need to deal with. One is definetly the lubrication low switch although I may of disconnected it's partner when removing the old controller so that makes two, but I've no idea what the other two are :-/
I still need to tidy up the tool changer wiring as I just used the existing lengths to make sure it was all going to work, and deal with all the other loose odds and ends like getting all the wiring into the trunking.

I grabbed a quick photo with the phone before i headed in tonight-


Getting Tidier by mc_mtb, on Flickr

I've just remembered I still need to find out why the spindle encoder isn't outputting the B pulses.

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #5 on: July 24, 2015, 01:06:20 AM »
Quote from: mc
October 28, 2013, 12:41:16 AM

After several hours trying to figure out the ladder logic for the turret, I have come to the conclusion I hate ladder logic.

I can appreciate it's uses, but what could take a couple lines of reasonably simple code in a microprocessor, takes far too many rungs and holding variables and contacts. Plus it's a nightmare to move things around when you need to change things. I'm probably not helping myself by programming for the turret to spin both directions, but even the locking for one direction gets a bit complicated.

Quote from: mc
October 29, 2013, 01:40:42 AM

Ok, I think I've finally cracked the ladder logic. The proof will be if it actually works...
I still need to add a couple additional timers to trigger a fault and disable the motor/solenoid if the turret fails at any point during the move.

The annoying thing is, I got an email from Dynomotion this morning telling me all about their new Konnect IO expanding board, which would of given me more than enough IO to handle what the PLC is handling. If only it had of been available a couple weeks ago when I ordered the PLC!
Only thing I'm not too keen on is the price of the Konnect as it's $199, which puts it at roughly twice the price of a CS IO module for an identical number of IO's.

Quote from: mc
October 29, 2013, 02:11:45 PM

I noticed that earlier when I was comparing prices for a complete package (mostly out of curiousity), and realised that CS mention the IOs for the main modules on the IO module page. The CS has the benefit the main modules have more IO (32In/16Out) on the main modules compared with the Kanalog (only 8In/8Out that are 24V, along with 8 80V relay drivers).
Price wise there's not much between them. To get a Kflop with analog and comparable IOs to just a CS main module, CS is a bit cheaper, but if you then need a threading module, then Dynomotion is cheaper.

Anyway, I got the Click programmed. Then followed by a bit head scratching, and flipping all the logic in the position detection subroutine, the turret spins, locks, then starts spinning again  :-\
I need to run through all the logic that calculates the move direction and number of positions, as if I request position 3, it always moves in reverse, stopping and locking at 1 and 5. I'm hoping it's just something simple in my code.

Quote from: mc
October 31, 2013, 12:04:09 AM

The turret works!

Found a couple issues in the ladder that were causing the wrong move to be calculated, so fixed them and also added in rungs so it only attempts to move once for each toolchange attempt. I still need to add a couple time outs so the turret can't sit spinning endlessly if something goes wrong, but I'm happy the basics are now working.

I grabbed a quick vid - http://www.flickr.com/photos/mc_mtb/10582127085/

Now onto configuring the KFlop, so it works with Mach, and can talk to the PLC.

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #6 on: July 24, 2015, 01:10:29 AM »
Quote from: mc
November 05, 2013, 12:08:05 AM

Cable trunking hides a multitude of sins :)


Wiring Tidied by mc_mtb, on Flickr

I've started modifying the basic lathe screenset to get a layout I'm happy with, and so it can handle the KFlop, as various buttons need to be changed so they notify the KFlop plugin, and the DROs changed so they read directly from the KFlop.

I'm also working on configuring the KFlop, and trying to decide how the various functions I need are going to be coded. I'm aiming to have the KFlop handle as much of the critical stuff as possible, and then just notify Mach when things havn't worked how they should. Things like halting everything when a Servo faults will be handled directly by the KFlop, along with talking to the PLC, and things like stopping when the door gets opened.

Quote from: mc
November 05, 2013, 10:20:34 PM

After some input from Tom at Dynomotion, I've started on the KFlop initialisation code, and one thing he mentioned was for spindle feedback, KFlop has to receive full A & B quadrature input.

So I dug the oscilloscope out tonight, and after some probing, it turns out for the British Encoders encoder that Denford originally specced, British Encoders simply cut the B wires where they enter the encoder housing and never soldered them onto the encoder board. I've probed the board, and the signals are there, so it'll just be a case of figuring out what is the high and low (just need to find a datasheet for the differential driver chip as the tracks from the chip to the holes are nice and visible), and solder in the extra couple of wires, then we'll be good to go :)

Quote from: mc
November 07, 2013, 11:32:25 PM

I now have a fully functional spindle encoder, after soldering in a couple extra wires, so the KFlop channel it's connected to actually increases and decreases when the spindle is moved.

Mach has now also been introduced to the loop.
Setting up the KFlop for basic use is actually pretty easy, and the instructions on the Dynomotion website cover the basics pretty well. The hardest part is setting up all the output values, as it's a bit more involved than doing it in Mach alone. First you need to configure and tune the motors using the KMotion software, then copy those settings into an initialisation file that gets loaded when you hit Reset in Mach. You then need to configure the motor tuning in Mach.

One thing I discovered, is the lower settings in either the KFlop or Mach will take precedence. Provided Mach is set slower, it's not an issue, however if the KFlop settings are slower than those in Mach, the Mach DROs will show the motion as complete, even though the KFlop is still processing the motion. On single moves, that's not an issue, however during programmes it would eventually cause the motion planner to overflow, so it's something to be aware of.

Now I've got the basics sorted, the next couple steps will be modifying the Mach lathe screen to add LEDs for the servo ready/fault signals, and also adding the KFlop code to handle servo faults/estop activation.

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #7 on: July 24, 2015, 01:13:55 AM »
Quote from: mc
November 17, 2013, 01:24:03 AM

Things are now progressing, after a few issues that took longer that I'd hoped to solve.

The major headache of the past week has been getting the KFlop to talk to the PLC using modbus, and retrieve the information I needed.
First up the Kanalog port is numbered backwards, so what should of needed a straight through cable, actually needed a crossover cable. Once this was realised, I just had to cut the cable and crimp on a new RJ connector, and the sample script provided with the KMotion software burst into life and worked flawlessly.
Then there was the case of figuring out how to read and write to the correct Holding Registers within the PLC, which I only figured out after sitting and going through the Address Picker within the Click software to figure out exactly the sample script was working, and realising you can access the inputs and outputs using two different methods.
Once I'd managed to get past those issues, I managed to get the KFlop reading the current tool position, and writing a new commanded tool position.

The spindle is now setup as a closed loop servo (albeit a very slow reacting one due to still being VFD controlled), so the set speed is highly accurate.
I did have an issue with the spindle reversing direction whenever a new speed was set with it already running, which Tom at Dynomotion explained was due to Mach not issuing a direction command to the plugin on a speed change, so he quickly sent me a modified sample script that stored the previous direction command.

I've also got the homing routines working, so they use the proximity switches followed by the servo index.


I'm now working on getting everything working together,, and getting it all combined into the one initialisation file that gets loaded via Mach.
I've so far got most of the code done for the KFlop monitoring, where an E-Stop has to be activated. For this I've essentially got two levels of E-Stop. First there is the physical circuit that triggers when a limit or an e-stop button is activated, and second there is the monitored circuit for things like a servo fault (the servos are connected and configured to do a fast stop if any fault) or tool changer issue, where the KFlop will stop things and notify Mach.
As Mach can only accept one E-Stop input, all E-Stop control is ultimately mapped to a single virtual bit within the KFlop, that Mach monitors just like a normal input pin.

Next up is the tool changer, which will require several parts. First up the macro within Mach needs to notify and transfer the requested position to the KFlop, then the KFlop has to transfer that position to the PLC, followed by the Tool Change allowed output being activated, then once the TC Ok input is activated again, I need to read the position back into Mach. I don't really need to read the position back into Mach, but I can use it to avoid commanding a tool change when one isn't actually needed.

Quote from: mc
November 18, 2013, 12:03:28 AM

It is, but that's probably more to do with lots of things being new to me, and this isn't exactly a simple build.
For example if the Konnect board had been available a month or so earlier, then I could of avoided the pain of adding a PLC and modbus to the mix, and all the coding could of been done directly in the KFlop.

If you were just going for a simple machine using step/dir, then setting up the KFlop isn't much more involved than anything else as you can access all the in/out via ports and pins. Just use the standard init.c file, and you're pretty much good to go.

Although having said that, I'm probably still going to use a PLC for the tool changer on the Matchmaker, as I don't fancy running 30+ wires from the tool changer cabinet around to the main cabinet! Just a few wires for power and modbus seems much more appealing...

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #8 on: July 24, 2015, 01:27:19 AM »
Quote from: mc
November 18, 2013, 05:33:17 PM

The issue is a KFlop  Kanalog  Konnect work out about 250GBP cheaper than a CSMIO/IPA, MPG, ENC, and IO (2 off), assuming all the tool changer requirements could be handled by a single CS-IO. That 250GBP can buy a couple PLCs, and several expansion modules. I won't make any decisions until I've got a full IO requirement list done for the tool changer.

Anyway, getting back on topic, I've got a new screen, macropump and some new KFlop code to go test.

Quote from: mc
December 19, 2013, 09:57:40 PM

Progress had stopped on this due to a couple other more pressing jobs, plus I was still dithering over how best to make the required toolholders for the turret.

However I've added to the Denford collection in the form of a Novamill, and the first toolholder has had the underside machined. The critical size came out perfect being a nice tight fit in the turret, so I just need to drill & counterbore the mounting holes, face the sides, then get it drilled & bored to size. Oh, and make several more.

Quote from: mc
December 20, 2013, 12:03:52 AM

Whatever I can fit in the holders!
The original holder drawing states a 22mm drilled hole, finished to 25mm fitted to the lathe turret, which suits me. I can get sleeves for whatever boring bars I'm using, which are 8 and 10mm just now, and I can also use the same ER holders as I made for the Connect which avoids lots of custom holders for various drills.

I'll drill them so far on the lathe itself, then swap them to the big pillar drill to drill them to whatever drill I have near 22, then refit them and bore them to size using a boring head in the lathe chuck. That way I can get 6 done per borind head adjustment :-)

Quote from: mc
December 20, 2013, 12:33:47 AM

I'm not sure if the spindle and Z-axis would have enough power for a big drill.

It's only a 2.0KW motor at 2450rpm, so at big drill speeds I'm not sure if will have the torque, plus the Z-axis gearing is on the conservative side for force.
According to HSMadvisor, a 22mm drill should be aprox. 850RPM requiring about 0.9KW, and assuming the spindle motor is roughly constant torque, at 850rpm it's only capable of 0.7KW. However that doesn't allow for a pilot hole...
I'll run the figures through my more advanced spreadsheet at some point, as it's always worth a try!

mc

  • Newbie
  • *
  • Joined: Jul 2015
  • Location: East Lothian
  • Posts: 34
  • Country: scotland
    • View Profile
Re: Denford Cyclone retrofit
« Reply #9 on: July 24, 2015, 01:29:48 AM »
Quote from: mc
March 02, 2014, 08:13:52 PM

Progress.


Covers on and blocks ready for boring by mc_mtb, on Flickr

I had a bit of an extended run on needing to make bits, so had been suffering from a chicken and egg situation, in that the little lathe takes too much time/manual input to make the bits, so I've not had time to get this up and running, and then when I have had time, things have stalled due to needing some stupid part I should of ordered weeks ago.
The tool holders have now been milled to the correct height, and the other faces tidied up to look a bit neater. Took a couple weeks to get hold of suitable length bolts, as they need to be a specific length, and the supplier sent them to the wrong address.

I was going to risk just relying on the grub screws to hold the X servo pulley in place, however after I realised just how much effort it takes to get all the slideway covers off/on, and that I really want to minimise knocking any of the tooling of line by anything slipping, I ordered up a suitable broach set, and took the pulley back of.
Everything is now back on how it should be.
I'll take the Z servo pulley of and broach it at some point, but I'm in no rush as it's far easier to get into and not as critical if it does slip.

I've got a dedicated computer setup now, so have been working on the final coding, during which I discovered an issue with the PLC ladder causing the toolchanger to go into an endless spin if an invalid position was requested. That's now sorted, so that it shouldn't do anything if an invalid position is requested, and if it does somehow go into an endless spin, it should stop after 10 seconds (I could probably reduce this, as the maximum change time should be sub 3 seconds).
Thanks to Hood, I've also added some extra lines to the tool change macro so any program should halt with a warning message if an invalid position is requested during a program.

Main things I have left to do are bore the tool holders, and properly tune the servos. I done a quick tune earlier, and have the X-axis holding sub 50 pulses, and the z about 14 pulses, but I think X should be better.

I also need to make a proper stand, but that won't stop it working!

Quote from: mc
March 06, 2014, 12:34:11 AM

X axis following error is now sub 10 counts.
After not getting much improvement in Speed mode, I tried Torque mode, but despite trying all sorts of PID values, the results were even worse. So swapped it back to Speed mode, and with a bit filtering and further PID adjusting, managed to get a reasonably good result. 10 counts works out at 0.0025mm of error, so I'm pretty happy with that.

I also had an issue with the spindle VFD, in that it started tripping the RCD while I was in the middle of changing settings in the servo drive. I just turned it off so I could tune the servo. I took the cover of to check for anything obvious, but other than lots of dust it all visually looked good, so gave it a blow out and it's working again. I'm hoping it was just the dust and a bit dampness causing the problem.

Just got the Z-axis to tune, and then I might get to cut some metal with it.