Hello Guest it is November 18, 2019, 11:43:26 AM

Author Topic: Precise homing even with CSMIO-M  (Read 6074 times)

0 Members and 1 Guest are viewing this topic.

Precise homing even with CSMIO-M
« on: May 03, 2014, 04:24:39 PM »
Hey guys!

As I wrote in my other thread, I am making my first steps in CSMIO + Mach3 but I am not totally new to Mach3 because a friend of mine owns a machine with this software and I can say I know how to work with it.

Everybody is seeking the best which can be taken out of the hardware, at a reasonable price of course. In my case I built a robust CNC router for now so much money and CSMIO-M seemed the perfect product for me. Now that I evaluate the full capabilities of -S version, I am little bit sorry for not taking it.

My servo drivers support homing on index internally. However, this is activated by input of the servo, not by pulses. If I give a logical "1" to that input, the servo will start searching for the home switch, reach it, get OFF it and stop at Z encoder pulses. This is what precise homing is all about. It is just that it is syncrhonized by the -S version, not by the servo itself(although that's also possible).

I have a separate PLC in my electrical panel which is responsible for reading all drives via RS-485 ModBus and observe the current torque and visualize on a HMI so we know what the actual loads are. I have my CSMIO-M outputs connected to the PLC because I have more control on what's happening and advanced possibilities.

Is it possible that I home all my axes precisely with a input(from the HMI for example) and manually specify that this is the machine coordinates X0 Y0 Z0 from the Mach screen without the axes being moved to search for the zero?

I can always zero the local X,Y,Z values but if the machining fails, it will be the machine coordinates that will help me get back to the very same place at a later moment.

In summary, CSMIO-M doesn't support index on homing but I can achieve it will the additional PLC. The question is if I can skip the homing in Mach3 and just zero the machine coordinate registers.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Precise homing even with CSMIO-M
« Reply #1 on: May 03, 2014, 04:58:53 PM »
You can easily utelise the Index homing of the drives, it is the way I do it on several machines that are using the SmoothSteppers. My other machines have the IP-A and IP-S so I use the index homing on them.

Anyway what I do on the SS machines is alter the code in the RefAll button, I send/recieve the signals via Modbus (my PLC) but it can be done via normal I/O if you have enough spare.
Here is an example of the code I use in the RefAll button on the lathe.


DoOemButton (240)                     'De-Reference All axis
 Sleep(10)
 If GetOemLED (809) Then               'Check that Ref Z LED is RED
  Do
   Call SetModOutput (21,1)             'Activate ModOutPut 20
   If GetInput(19) Then Exit Do       'Loop until ModInPut 18 is seen
  Sleep (10)
  Loop
   End If
  Call SetModOutPut (21,0)            'DeActivate ModOutPut 20
    DoOemButton (1024)  'Set Z axis Home
   
If GetOemLED (807) Then
 Do
  Call SetModOutPut (20,1)
   If GetInput(18) Then Exit Do
   Sleep (10)
    Loop
   End If
   Call SetModOutPut (20,0)
    DoOemButton (1022)
   

Hood
   
Re: Precise homing even with CSMIO-M
« Reply #2 on: May 04, 2014, 12:34:37 AM »
Thanks Hood for the sample source code.

I so much lack the possibility to connect via ModBus other devices to the CSMIO. This way I would do it very easily for each axis.

The workaround here would be to send just 1 single signal to my PLC, leave it do all the job and return a signal back although I don't have enough spare to be honest. But if precise homing works, then the 3 home switches may not be connected to the CSMIO at all and make 3 more inputs free.

Anyway, I would try this idea, thanks for sharing.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Precise homing even with CSMIO-M
« Reply #3 on: May 04, 2014, 02:12:32 AM »
You do not need the home switches connected to Mach when using this method, in fact if you did have home switches connected then it would not work.
Regarding the PLC, can you not connect it via Modbus? That is how my PLC is connected to Mach.
Hood
Re: Precise homing even with CSMIO-M
« Reply #4 on: May 04, 2014, 04:20:32 AM »
How have you connected it to Mach? Should I connect it via RS-232/RS-485 to the computer or somehow to the CSMIO? The only way I see is the spare "Expansion" connector but the CSMIO manual clearly states nothing other than products of CS Labs should be connected to this connector.

If I wire the PLC via RS-232 to the PC, will I be able to specify it in Port & Pins correctly and will it work together with CSMIO simultaniously?

As for the home switches, they are currently connected both to CSMIO and the corresponding servo drivers before I figure out the final work pattern. In fact, I could easily remove them from the CSMIO and free some space.

But I got attracted by the ModBus connection of a PLC to Mach3 working together with CSMIO. Please throw some more light Hood, thanks.
« Last Edit: May 04, 2014, 04:32:54 AM by penkomitev »

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Precise homing even with CSMIO-M
« Reply #5 on: May 04, 2014, 06:59:17 AM »
I think what Hood is doing is this.
Is Ref All macro does not do any homing in Mach3, and he has no home switches enabled in Mach3.
His macro tells the servo drives to home the machine (through Modbus). When the servo drives have finished homing, they send a signal back to the macro via ModBus. When the macro receives this signal, it calls the Mach3 Ref (Home) command. Since there are no Home switches enabled, this just sets machine coordinates to zero.

You probably don't even need to send a signal back to Mach3 (the macro) to verify that homing is complete. But if you don't, your homing macro will finish before homing is actually completed. You'd need to make sure you don't try to move the machine before homing completes.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Precise homing even with CSMIO-M
« Reply #6 on: May 04, 2014, 07:07:03 AM »
@ger21, thanks for replying.

I understand what Hood said from physical point of view.

As you and Hood said, one of the ways is to communicate via ModBus:
1) send command to the PLC to ref all drives
2) all drives ref in sequence Z -> Y/X -> X/Y
3) (optional)confirmation from the PLC


if (3) is optional, it is up to the operator to verify everything is OK and not move the machine without homing being finished.


My continued question was more about the way Hood connected the PC and the external PLC. I have the CSMIO via Ethernet to the PC but surely my RS-232 is not occupied and can be used as an additional interface. Also, I recently bought from EBAY USB->RS-485. Although it costs $2, I may give it a try.

In summary, the ModBus connection would be the best solution, I just need Hood to confirm the way he did it. Maybe the ModBus settings in Pins menu are independent and they don't interfere with CSMIO. RS-232 will also work for me as it is just the PLC I need to wire. The PLC itself will be wired via RS-485 to all drives and will read voltage, current, torque and other data which will be visualized at a later moment on a display or if I get better with VB Macros, maybe I could get them to the Mach3 custom screen. I haven't got into details so far but have good idea of the capabilities of ModBus protocol although I tend to be more a mechanic now :)





Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Precise homing even with CSMIO-M
« Reply #7 on: May 04, 2014, 08:46:42 AM »
I use RS232 to connect to the serial port on the computer, I do not use the Plugin version of ModBus but rather the Non-Plugin interface, I find that much more useful.
With that you can use Brains, VB or even ports and pins in Mach, Modbus port is 0 as far as Mach is concerned.

The CSMIO also uses its own internal Modbus but that should not interfere with Mach/PLC as it starts well up in the registers if I recall, something like 80 or higher where your PLC will be under 64 I think.

With regards the home switches, if you have none designated in Mach then it will just zero out your Home position at whichever point you tell it to (oem 1023,1024 etc) so in effect what you are doing is sending a signal to the PLC to then in turn start the drive homing, once the drive has homed it sends a signal back to the PLC which in turn then tells Mach set that axis as Home and move onto the next.
If you do not have enough I/O to have a signal from Mach to each drive and for each drive back to Mach you could have the actual homing done completely in the PLC's ladder and thus you would only have one signal from Mach to iniate the homing procedure, and one back to Mach informing Mach that it is complete and that it should set the Machine as homed.

Hood

Hood
Re: Precise homing even with CSMIO-M
« Reply #8 on: May 04, 2014, 08:55:20 AM »
Hood, you couldn't write it in a more detailed manner.

Thank you very much. I am about to complete the wiring and make a test trial with 2 drivers(the rest are somewhere on the road from Germany to here) without mechanical shaft coupling.

I will write more when I have some results or I get stuck.

Penko

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Precise homing even with CSMIO-M
« Reply #9 on: May 04, 2014, 01:12:51 PM »
Hood, you couldn't write it in a more detailed manner.
Penko

Not sure if you are wanting more info or think you have enough?

Hood