I need a simple CSP example for CiA 402

More
2 years 7 months ago #297231 by endian
Hi Dominik, 
​​​​​​You are talking about really nice stuff... I had lack of informations..about that mode things

If I am understand right, interpolation of more axis over ethercat stuff should be performed just in the CSV mode with PID stuff setted in the lcnc like with analog velocity -10 to 10V ?

Because of each one acc decc etc which are done during CSP via derivation of actual position? I do not know much about the problematic of drivers firmware but at high school we have learned about derivation 1st and 2nd of position and they are the velocity and acceleration(positive/negative)? They should be known? Or? But with scan cycle delay?

Please, tell us more about your experiences.

Thanks
​

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

More
2 years 7 months ago #297238 by scottlaird
FWIW, I think I finally found my problem: I had dcConf set wrong in one case and not set at all in others. It looks like RTelligent wants assignActivate=300 and the Leadshine 2CS3E-D507 wants 700.

I'm not a big fan of needing magic numbers from ESI files in order to get devices working, nor am I a fan of the way this fails if dcConf isn't set right, with the drive silently failing to move.

It looks like lcec_main calls ecrt_slave_config_dc *after* calling the per-device _init code, so adding a default dc_conf setting for CiA 402 drivers wouldn't be hard. Doing this generically would be hard, but hard-coding assignActivate=0x300 for the rtec driver, for instance, would be pretty simple. I'll start a new top-level topic in a minute.

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

More
2 years 7 months ago #297241 by rodw
Spent some time trying to catch up on your journey earlier today!
Ideally, if a value is defaulted to 700 or 300, it would be great if it could be overridden by a modParam.
I hate hardcoding stuff. Bound to catch you one day.

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

More
2 years 7 months ago #297393 by scottlaird
Made a bit more progress with RTelligent steppers in PR #393 .  It defaults to adding an implicit `<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>` if dcConf isn't provided.  If you want a different setting, then just provide it explicitly.

That's enough to get this to work:
Code:
 <slave idx="27" type="ECT60" name="rt-ect60"/>  <slave idx="28" type="ECR60x2" name="rt-ecr60x2"/>

I have a little bit more cleanup left; this defaults to mapping everything needed for CSP mode, but changing to anything else is kind of painful.  I'll go ahead and add a bit of code to make that easier, and then add explicit rtec support to lcec_configgen, so it'll add common modParams to generated configs.
The following user(s) said Thank You: rodw

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

More
2 years 7 months ago #297395 by scottlaird
I'm trying to figure out what the best user experience is for CiA 402 devices with specific drivers, like the RTelligent EC* devices.

Specifically, what do we need to do to configure them for various CiA 402 opmodes, like CSP, CSV, and so forth. In an ideal world, we'd just map all of the PDO entries that the device can support, but a lot of devices don't have PDO space for this. My Leadshine driver, for instance, only really has room for 8 TX and 8 RX PDO entries, but supports about 40 different CiA 402 CoE objects. We can't map them all at once.

RT is a bit better than Leadshine in this regard (IIRC room for 12-16 entries *and* fewer optional features), but I still doubt that there's room for all of them.

With the `basic_cia402` driver, I handle this by having a *huge* set of `enable*` modParams. The `lcec_configgen` tool probes `ethercat sdos` and writes out the full set of `enable*` settings that each device supports, but this frequently needs to be edited down in order to keep under the device's (frequently undocumented) PDO size limit. So, getting basic_cia402 working requires some editing.

With device-specific drivers, I think we can do a bit better. First, we can default to CSP (for most things) or VL (for VFDs), with a reasonable set of additional PDO entries mapped. For devices with large PDO spaces or a small number of objects, we can just map everything and be done.

For the rest of our devices, I'm leaning towards overriding the `enableCSP`, `enableCSV`, `enableCST`, `enablePP`, etc modParams. Normally, these only enable PDO entries that are a hard requirement according to the CiA 402 spec. So `enableCSP` adds `actual-position`, `actual-velocity`, and `target-position`, but not `position-demand`, `velocity-demand`, `torque-demand`, `actual-voltage`, or any of a handful of other useful-for-debugging pins. That's because we can't depend on any random device actually supporting any of the other PDOs from within generic code. But, for device-specific drivers, we should know what's available. So we can override `enableCSP` and friends to enable a set of additional PDOs that may be useful. If you're building a device that could use CSP and CSV, then you can say `enableCSP` and `enableCSV`, and you *should* have everything that you need mapped, although there's a chance that you'll overfill your PDOs. If that happens, that you can still do things like `<modParam name="enableTorqueDemand" value="false"/>` to take more control. We'll need to document this and file it under "advanced use", but we can probably make most of the normal cases pretty easy to use correctly.

I'll ignore the issue with the cia402 HAL module only supporting CSP and CSV and not allowing switching between them in realtime mode for now. That should be relatively easy to change if we ever need to.
The following user(s) said Thank You: besriworld

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

More
2 years 7 months ago #297397 by pippin88
I'm guessing there is not an easy way to test how many PDOs a slave supports? Can we probe programmatically to work out the PDO capacity?
I guess a slave will just ignore PDOs that are more than the number it can accept?

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

Time to create page: 0.549 seconds
Powered by Kunena Forum