Category: EtherCAT
I am confused in the whole idea. EtherCat drives are not like hardware(FPGA) motion controlled drives. They actually have the motion controller built into each drive. All LCNC should have to do is set the OP states correctly.
If in OP State 8, listen for Pos PDO's and act on messages indexed to my slave ID. Do what the master says. If I have an issue, send an EMG packet to the master. While driving the motor send back pos/vel data. There isn't a real need to even close the loop. Given the DC(Dis Clk) all slaves will operate at the same overall timing of 1ms. Basically just like an open loop S/D system driven from a MESA card but deterministically. If I understand the purest concept of the benefit of EtherCat motion over 402. In other words, LCNC just needs to generate the Trajectory for each axis in RT and send the data via PDO's so the drive can do all the work. Why would you want to have LCNC double check whether your drive is doing the assigned task it is given? Seems redundant in my opinion. LCNC > Drive >> move .001mm then tell me you did. Drive moves .001mm then << LCNC I did it. LCNC >> Good job little boy. Drive << LCNC Thanks Dad. That defeats the entire concept of EtherCat. The loop is open because the loop is closed at the drive level. The position/velocity command is closed at the control level. This creates a very slim and very fast deterministic system based on separation of concerns. A P/C to P/C relationship.
OP Mode 6 - Homing
All EtherCat drives with any real value should have a completely internal homing sequence. Many simply have ABS encoders with battery backup that maintain the ABS position even if power is lost. This value can only be lost if the battery dies. If it does, you replace the battery and reset the ABS coordinate stored in the drive so that the encoder and drive are in sync. Then update the CNC controller who does it's own stuff to sync with the drive. The drive does drive stuff and the controller does controller stuff.
On Fanuc and Siemens controls the ABS value is gathered from encoder ABS position from the drive. This value on Fanuc is stored in a parameter once P 1815.4 is set to zero and then back to 1. The stored value on the control after setting this parameter is then to compare the ABS V on the drive to the one stored in the control at startup. If they differ, the control request an update to the actual encoder position that is then calculated by the drive and then sent back to the control which then updates the machine position value of the control. Fanuc and Siemens also have a special bit that tells the control the drive has not lost the stored ABS value of the encoder. If the bit is high, meaning the drive has lost the ABS because of a battery loss, each have a procedure that then tells the drive to reset the ABS position and store it. From that point forward both the control ABS and drive ABS match. Regardless of the control OEM there is some method for the control to know where the encoder is based on the data maintained by the drive. The control acts as a master for sending the Pos commands the drive needs and the drive acts as master to control the feedback loop. A purely producer consumer relationship.
So, basically what that means is somehow LCNC needs to stop trying to master both sides as it is not required. As far as homing and ABS feedback the drive does all the work. LCNC simply needs a method to know when the drive is done homing. The drive needs to know when LCNC is ready for it to do the job. The soft and hard limits should be controlled and monitored by the drive not LCNC, The homing switch if even needed(Multi-Turn ABS encoders do not) is monitored and wired to the drive.
Let's say I want the machine in a very specific spot in the travel and I have the multi-turn ABS encoder, I can jog the machine to that coordinate, tell the drive "hey I am where I want the axis to be, stored the current ENC ABS POS as zero. The encoder may be a 23 bit with 8M possible "pulses" and number of turns the actual encoder may be at exactly 180 degrees in rotation, it sees the 4M+*number of turns in the counter(Could be a value of 1,000,000,000 or more), stores that value from that counter, then sets the POS register to zero. The ABS position is then calculated based off the offset in PPR+Turns in both directions +-. The value given to the control is the final calculated true ABS position.
Now that I have that value fully stored and maintained within the drive, the controller only needs the calculated ABS from the drive which arrives in the PDO every 1ms. Both the control and the drive use the calculated ABS position to derive their respective soft limits. I can then use my control side soft limits or simply allow the drive to do the work for me which is ideal since the hard limits are wired to the drive anyways. You can still use the hard limits in the control and the soft limits in the control if you so desire. The result should be the same. But, homing in EtherCat is the job of the drive.
Let's say, the battery died and the original ABS REF is lost. The soft limits will longer work. But this should not be an issue. If you have a home to limit setup. the drive has params that control the vel to search the switch and a procedure to follow in order to find the switch which it will do if commanded to do so. From that point, the switch is found, the axis moves to index, then if it has an offset from that position will make an additional move then store the encoder counts+turns into a non-volatile register. In most cases, the drive should never need to actual use the switch unless once again the encoder lost power from the battery. If the drive has full respect and knowledge of the physical location of the drive, I should then be able to send and OP 6 state to the slave, which will immediately send back a response that it is complete without ever moving. That is ideal and based on current modern hardware will be as accurate and reliable.
Many modern drives allow for a no limit required homing method. In the case of many high end CNC Machines, Toyoda, Mori Seiki, Toshiba, etc. they have no hard limits nor homing switches. What would they be there for? The encoder is ABS and knows where it is at all times. Even most scales if using one work without homing switches. This standard has been around for over 20 years. EtherCat drives have had this standard for 10+ years.
So, all that said which is a lot, why is LCNC when utilizing the lcec setup trying to control the drives job. The drive has the full recipe to make the cake. All it needs is the command to make it. LCNC should be only concerned with trajectory planning based on the RS274 Interpreter sending data to the planner. The planner then sends that p/v info over the wire to the drive that makes awesome and perfect cakes. As long as the drive has no issues and LCNC knows the drive is healthy, LCNC should by all measures just keep sending commands to the drive. LCNC has its' own fail safes and can stop sending commands or tell the drive to reset to noOP mode. It would respond in 1ms stopping all motion. Period. If the drive sends a EMG on the error pipe then LCNC should also stop sending commands within the same tick cycle stopping the entire system if say the X axis drive poops out, all the other drives in RT stop receiving commands and the machine fails to a stop condition. There is more in the safety side that is possible but for the basic functionality for Hobby or Light Industrial use where a strict compliance to "STO, etc" are not required the system stays quite slim.
LCNC Behavior As I See It Should Be With ECAT -
1. Power on
2. Reset all drives to OP 6 if all drives report boot healthy
3. LCNC ignores all POS FB, (if used - limits, home switches) until the drive sends back Home Complete regardless of home style.
4. LCNC reads the position actual PDO and then position actual updates the register for the session internal to LCNC. If the drive says I am zero and home, the DRO should match the drive. If the drive is a Home In Place using multi-turn, then the DRO should read the drive ABS position and the LCNC machine position register should be updated to the value from the drive.
5. LCNC should now be ready to send the OP 8 mode to the drives once LCNC has run through its' final sequence and is ready to run.
6. Set Op 8
Maybe I missed a step but 99% of all other CNC controls of any real value work exactly as described above. It is a standard. The only variable is the actual procedure to lock in the stored encoder value. But the control operations work as explained above. Swap out LCNC for Fanuc. Swap it for Siemens. It is always the same for the control if using bussed motion and multi-turn ABS encoders with battery backup. Which almost every ECAT(registered) porvides as a standard model.
It seems highly illogical to try to make some custom this and that to accommodate any drive that is A. Not a registered ECAT OEM and B. Uses antiquated technology. For those who cannot afford the higher price points to step up to ECAT should continue to use the basic ParPort versions with S/D motion controllers. It is way less expensive.
One of the most frustrating aspects of LCNC is the lack of pure standards. If EtherCat with LCNC is to become a mainstream a strict set of standards must be adopted by all users. No custom setups. Either the hardware and implementation follows the standard or it doesn't get done. No use of non-registered ECAT drives or knock off I/O modules from Amazon/Alibaba that will never be registered should be allowed to enter the discussion. CNC machines are very dangerous and the barrier to entry above a threshold must be maintained to keep novice users from hurting themselves or others. Period.
My comments here might be taken as an insult. It is not meant to be by any stretch. But, as an engineer in the CNC control and machine business for over 30 years, I think I have the experience to say we need higher standards for this advanced usage of LCNC. If I offended anyone please accept my apology in advance.
Maybe can start a thread that strictly deals with developing a way to have LCNC follow industry standards as we develop drivers and integrations. I am certain I am not the only one on here with the requisite experience to contribute. Regardless, of knowledge of the entire LCNC Eco System we should be working toward KISS methods and standards that keep people safe and give them the greatest opportunity for success at the same time.