CiA 402 in 1.15.0

More
10 Feb 2024 13:57 #292993 by scottlaird
CiA 402 in 1.15.0 was created by scottlaird
I went ahead and merged the first pass at CiA 402 support, including an "rtec" driver for RTelligent ECT/ECR stepper drivers and a "basic_cia402" driver for semi-generic device support.  You can see documentation here: They're not done, and I'm planning on making a few changes in the next few days that may lightly break users.  Call this "beta" at best, but I'd love to get a bit of feedback, especially if people are willing to give "basic_cia402" a quick spin.

At this point, I'm able to drive an ECT60 in either position or velocity mode using either type="ECT60" or type="basic_cia402".  Using the ECT60 driver gives you more modParams and pins, covering things like open/closed mode, motor current, current torque, current RPM, and so forth.  See the docs.

Right now, digital in and digital out ports aren't working correctly on my ECT60, and I'm not quite sure why.  I think it's a hardware problem -- using 'ethercat upload' gives weird results, too -- and it wasn't worth delaying over.

This should support pp, pv, csv, and csp modes today.  I haven't made any attempts at homing mode, interpolation mode, vl mode (for VFDs), or either of the torque modes.  It's designed to work with the existing cia402 HAL component.

Coming up soon, I'm hoping to:
  • Move a number of the generic CiA 402 modparams (profile velocity, profile acceleration, etc) to be pins instead.  They should have been pins in the first place.
  • Figure out my digital in/out aren't working, then add generic digital in/out support into the CiA 402 library.
  • Fix the mess that is "pdo_entry_count".  It's surprisingly hard to know how many PDO entries you're going to need to register ahead of time, as almost everything in the CiA 402 spec is optional.  At this point, I've added error reporting when a device requests N PDO entries, and usually just end up changing the count until the errors stop.  It's probably time to make it dynamic and delete "pdo_entry_count" across all drivers.
  • Add homing
  • Add interpolation mode
  • Add vl mode
  • Finish multi-axis support.  The framework supports up to 4 axes in theory, but there are a few details still missing, and I don't have any multi-axis hardware to test with.  Both Leadshine and RTelligent make dual-channel stepper drives; I'm hoping to pick up one of the Leadshine models after lunar new year.  Also, I should extend this to 8 axes, as per the actual spec.
  • Look at migrating some of the semi-CiA 402 drivers in the tree to use the new CiA 402 framework.
After that, I may look at extending the cia402 HAL component to cover a few more modes.
The following user(s) said Thank You: tommylight, rodw, besriworld, Pro_El, medicusdkfz, DSS

Please Log in or Create an account to join the conversation.

More
10 Feb 2024 14:11 #292994 by tommylight
Replied by tommylight on topic CiA 402 in 1.15.0
How come you have 42 posts and 45 "thank you" ? :)
Again, thank you.
The following user(s) said Thank You: scottlaird

Please Log in or Create an account to join the conversation.

More
10 Feb 2024 19:28 #293027 by rodw
Replied by rodw on topic CiA 402 in 1.15.0
Great work Scott.
on the ECT60, The digital inputs are at 60FD per your documentation. Here is how I defined them
github.com/rodw-au/linuxcnc-cia402/blob/main/ethercat-conf.xml

But Rtelligent does not have any listing in their manual for outputs in the CIA402 workspace. Instead they are in the manufacturer's space at 
204A
github.com/rodw-au/linuxcnc-cia402/blob/main/ethercat-conf.xml
I assumed that outputs were not part of the CIA402 standard.

I'm sure it won't be hard to get inputs and putputs into your driver. Hope this helps
The following user(s) said Thank You: besriworld

Please Log in or Create an account to join the conversation.

More
10 Feb 2024 19:34 #293028 by scottlaird
Replied by scottlaird on topic CiA 402 in 1.15.0
Yeah, outputs are listed in the standard as being at 60fe, and `ethercat sdos` shows that the ECT60 has them there, but weirdly it doesn't appear in the manual. I'll figure out what's up soon enough.

I'm currently removing `pdo_entry_regs` from practically everywhere in the codebase and replacing it with a thin wrapper inside of `slave` that tracks the number of defined PDO entries per slave, and then code that merges all of the slaves' entries per master at the end. This will let `basic_cia402` do things like ask the CiA 402 device which modes it supports and then create the right pins at runtime, that's all but impossible today.

This ends up removing *so* much boilerplate code and ~3 different hacks for variable numbers of PDOs, only one of which was mine :-).
The following user(s) said Thank You: tommylight, besriworld

Please Log in or Create an account to join the conversation.

More
10 Feb 2024 19:44 #293029 by rodw
Replied by rodw on topic CiA 402 in 1.15.0
And the output port functions are defined in 2005

 

It would be good to get outputs working because the alarm output should be connected to joint.N.amp-fault-in 
I guess in the absence of a brake, the other pin gould be used as a generic output

 
Attachments:
The following user(s) said Thank You: scottlaird

Please Log in or Create an account to join the conversation.

More
10 Feb 2024 22:30 #293041 by scottlaird
Replied by scottlaird on topic CiA 402 in 1.15.0
Thanks. I have those already, as <modParam name="output1Func" value="brake"/> and so forth. There are a lot of modparams here :-).

I had output1 working, but output2 wasn't, and none of the inputs worked, even with "ethercat upload" for reading the PDO values directly. I probably just mis-read the wiring colors or something. I'll get back to it in a day or two.

I just merged the dynamic PDO allocation change; that hit 97 files (!), but most of those were just automated changes. As of 1.16.0, there's no reason to bother counting PDO entries directly anymore. Just call lcec_pdo_init() and everything will be resized correctly under the hood. This had a lot of nice consequences in the code.

Everything compiles cleanly and all of my tests pass, but I can't test everything. The AX5xxx and FSoE devices had the most invasive changes, so they're probably the most likely to have problems.
The following user(s) said Thank You: tommylight, besriworld, DSS

Please Log in or Create an account to join the conversation.

More
16 Feb 2024 19:44 - 16 Feb 2024 19:45 #293539 by scottlaird
Replied by scottlaird on topic CiA 402 in 1.15.0
Minor update: I think there's actually a hardware issue here with my ECT60's I/O ports. At a minimum, I can't find the "COM+" wire, which I assume is supposed to have +24V. My multimeter measures 0V to ground on all 8 pins of the I/O connector. I should have a replacement in hand :before too long, as well as a few other CiA 402 devices for testing.
  • RTelligent ECT60
  • RTelligent ECR60x2 (2x open loop stepper drive)
  • RTelligent DRV400E brushless motor, er, "DC stepper" drive
  • Omron MX2 (VFD)
  • Rovix ESD-A6 (6-axis 24V stepper drive)
  • Leadshine 2CS3E-D507 (2x closed loop stepper drive)
If I'm reading the specs right, the DRV400E actually looks kind of interesting because it supports `tq` and `cst` modes. I think that'll give me hardware on hand that covers pretty much the full set of CiA 402 modes, with 1, 2, or 6 axes.

The ECR60x2 is cheap enough that it might be a reasonable option for anyone that wants multiple open-loop steppers. It (allegedly) does 2 channels of steppers for around $130 US. There are closed loop (ECT60x2) and higher-power (ECR86x2) models on some of their websites, but they don't seem to actually be shipping.

At this point, I have code that includes pins for nearly all of the optional CiA 402 objects supported in pp, pv, csv, csp, or hm modes.  I still  have tq, cst, and vl to go, plus some of the generic gear ratio/e-gear/etc modparams and some documentation.  Oh, plus the PDO mapping code is really broken for multi-axis devices, *and* will probably overflow the number of mapped PDO entries allowed on at least some devices.

Once I make it through these, I can start looking at AC servos and The Dreaded Yaskawa Problem.
 
Last edit: 16 Feb 2024 19:45 by scottlaird.
The following user(s) said Thank You: besriworld, RDA, DSS

Please Log in or Create an account to join the conversation.

More
17 Feb 2024 04:42 #293576 by rodw
Replied by rodw on topic CiA 402 in 1.15.0
The pinout for the ECT60 I/O is on the side of the drive. You loose the diagram once you squeeze your controllers into  a control panel :)
 

They are NPN type so an input is fired if connected to ground (0V if you must)
So yes, all pins will be 0 volts
Comm +  has a brown wire, 
Comm - has a Green wire.
Attachments:

Please Log in or Create an account to join the conversation.

More
20 Feb 2024 17:05 #293851 by RDA
Replied by RDA on topic CiA 402 in 1.15.0
Just give a heads up with the Yaskawa stuff if you ever get to that point. I dont think you need to start spending big bucks on buying the stuff just to test.
Im sure we can work something out from the HW side.

Please Log in or Create an account to join the conversation.

More
20 Feb 2024 19:44 #293856 by scottlaird
Replied by scottlaird on topic CiA 402 in 1.15.0
Thanks! I'll probably take you up on that at some point in late March or early April. I'm going to be travelling about half of March, so I don't want to plan anything new between now and then.

I should have a Leadshine 2-axis controller in my hands late this week, and I *think* I have all of the parts needed for the Rovix ESD-A6 now (plus 5 very cheap steppers), so I can probably make some progress on those soon.

The Omron MX2 EtherCAT controller is somewhere between Australia and the US now, and the replacement RTelligent driver is somewhere in China, so there's no shortage of pending hardware right now ;-).
The following user(s) said Thank You: DSS

Please Log in or Create an account to join the conversation.

Time to create page: 0.450 seconds
Powered by Kunena Forum