I need a simple CSP example for CiA 402

More
27 Mar 2024 16:05 - 27 Mar 2024 16:07 #296915 by scottlaird
I'm finally on the home stretch with CiA 402 support, I think, with my Big Board of Motors finally assembled and powered on.

This helped flush out 3 or 4 bugs yesterday, so progress is happening again. It's nice to be home after spending half of the month on the road.

My big issue is that I'm having a hard time testing CSP mode with CiA 402 devices. CSV mode is easy, just load the cia402 HAL module, connect pins together, set the velocity, and watch it spin. Unfortunately, the same thing isn't working with CSP mode right now. It's failing identically with different hardware, even on hardware which works fine with CSV, which makes me think it's *probably* a config error with the way I'm using CSP, although it could absolutely be a bug in my new CiA 402 code or a config problem with my drives.

I'll get it eventually, but it'd be really helpful if someone had a minimal CSP config that I could swipe and use as an example. Ideally it'd work with existing CiA 402 hardware, presumably via `generic`, and would just have a single axis with as little extra infrastructure as possible. I'm trying to drive 11 different motors right now, setting up a whole fake CNC for each is more than I really want.

With CSV I can set `velocity_cmd` and the motor spins (and velocity_fb changes), but setting `pos_cmd` doesn't seem to do anything by itself and I can't tell if it's supposed to.
Last edit: 27 Mar 2024 16:07 by scottlaird.
The following user(s) said Thank You: besriworld, foxington

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

More
27 Mar 2024 16:15 #296917 by scottlaird
I've been providing details in github.com/linuxcnc-ethercat/linuxcnc-ethercat/issues/180, but here's a quick summary of the hardware involved:
  • Leadshine 2CL3-EC507 (2-axis closed-loop stepper) with 2 steppers
  • Rovix ESD-A6 (6-axis open-loop 24V stepper) with 4 steppers
  • RTelligent ECT60 (1-axis closed-loop stepper) with 1 stepper
  • RTelligent ECR60 X2 (2-axis open-loop stepper) with 2 steppers
  • RTelligent DRV400E (1-axis DC servo) with 1 brushless drive
  • Omron MX2 (VFD) with a cheap spindle
I also have a Leadshine CANopen stepper drive on the way, to see how terribly painful it is do to EL6751->CANopen CiA 402.  I expect that the answer is "too painful to actually use", but people keep asking...
The following user(s) said Thank You: tommylight, foxington

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

More
27 Mar 2024 19:16 #296935 by foxington
hi,

it is not simple as it should looks like.. some of drivers run with SI units via pdos 607A+6064 and some of them working on bit revolution increments via 607A+6064 and some of them via 60C1+6063... It has to be settable on each of them..

I have working stuff with kollmorgen, pilz and nidec control techniques  but this working with incremental bits resolution/revolution but Ive done custom RT component of each one becasue every of them has different control/homing setup subroutine and different codes of the operation modes... but they are working rock solid for long long hours few days a week...config is not minimal but it should be helpfull

and you have to sure, if you had right tunned servo becasue whole position loop + compensation are in the servo driver loop itself... just commands or correction are done from lcnc...

how you are working with CSV? do you net velocity-cmd and position feedback via PID like we are using with mesa 7i77 cards???

regards 

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

More
27 Mar 2024 20:04 #296937 by scottlaird
At this point, I don't care about scale at all. I just want the motor to spin repeatedly. One layer at a time :-).

For CSV, I'm literally just setting the velocity target (via the cia402 component) and watching it spin. I don't care what a speed of '1000' means, as long as it's 10x as fast as 100 and 1/10th as fast as 10,000. But doing the same basic thing with CSP results in no spinning, no change of position, and no velocity measured. And I'm not sure if that's a bug in my generic CiA 402 code or if I'm doing something wrong.

I want to set target location (607a) and see actual location (6064) move. 6063 *shouldn't* be needed in general, but so much is optional in CiA 402 that's it's hard to depend on anything, unfortunately.

In general, some of the ratio settings (6092, especially) should be useful for getting the units from 6064 to match more sensible measurements. There are ~7 of them, IIRC, and I haven't spent much time looking at them all yet, but I have support for setting them via modParams. No docs yet, though. Which is fine, because the whole mess isn't *quite* working as expected all the time.

Actually figuring out which devices want which ratios for what will be fun.

I'll look through the thread you linked. At this point, anything is helpful.

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

More
27 Mar 2024 22:23 - 27 Mar 2024 22:27 #296944 by db1981
Hello Scott,

thumbs up for the work you are putting in this project.
Unfortunaly i have not time to look at it, yet.

One Note about CSP Mode, i don't know how you are testing...

-CSP needs an cyclic updata of the position data, its a little bit like driving an velocity drive. CSP calculates the velocity for the velocity loop inside the drive from the deriative of the position command to set the Motor speed. The diff beetween the command and feedback position is then calculated in the pos controll to give changes to the speed depending on the controller parameters.
But Acc, Decc, Jerk, RPM has to be commanded with cyclic position command, in scope the command has the shape like the velocity with an y offset. Commanding Steps between cycles that are much to big to get reached in the cycletime, usually will result in big following error from the drive or will be suppressed by plausibility check.

Setting an constant pos value, will generate no speed, this only works in an real Position Mode where the drives does positioning fully standalone. But in this mode interpolation of axes is not possible.
Last edit: 27 Mar 2024 22:27 by db1981. Reason: typos
The following user(s) said Thank You: scottlaird, foxington

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

More
27 Mar 2024 22:35 #296949 by pippin88
The following user(s) said Thank You: scottlaird

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

More
27 Mar 2024 23:50 #296955 by scottlaird
I guess I should really read the CiA 402 chapter on CSP mode, and not just skip ahead to the list of CoE objects used :-).

Thanks. I'll probably just set up a bunch of random joints and see how that goes.

Do you have any thoughts around supporting additional modes in your CiA 402 HAL component? I think Rod was looking at homing. I'd like to get VL mode working (VFDs, mostly), but it has so little overlap with other modes that I'm not sure that there's a point in sharing a component with them. And at some point I'd like to get CST mode working, although I don't really have a good use in mind for it, other than maybe the world's most expensive constant-tension home yarn winder.

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

More
28 Mar 2024 00:01 #296957 by scottlaird
Also -- any opinions about PV/PP/TQ modes? As I understand it, in general they're inferior for most uses compared to their CS* equivalents, as long as you have enough control bandwidth. I have a couple devices that support PV but not CSV, but I don't see a particular reason for running them in a velocity mode. People do weird things with LinuxCNC, though.

CSP is plainly useful. CSV (or maybe PV) probably makes sense for servo-as-spindle uses (or lathes?), although presumably for rigid tapping you'd want CSP instead, right? VL is for VFDs. HM is for homing, which practically everything needs eventually. But I'm kind of hazy on when you'd want to use the other modes for in a CNC environment.
The following user(s) said Thank You: foxington

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

More
29 Mar 2024 06:30 #297065 by scottlaird
I ended up just picking 3 axes and firing up a full copy of LinuxCNC using Rod's config. I can see it writing to target-position for a few seconds, and then LC's motion code throws a following error without anything actually moving. This is using 2 axes on Leadshine closed-loop steppers and 1 on a RTelligent DC servo. I'll move one of them to use a generic config and see if that works any better, then go through the manufacturer's manuals with a fine toothed comb, and then take whatever I've learned and debug from there.

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

More
29 Mar 2024 06:47 - 29 Mar 2024 06:47 #297066 by rodw
Scott, I have attached a later and more complete (near production)  config. it probably has very wide following error limits. Eventually I tightened these up and had some following errors on homing. Eventually I realised that my max accelleration was too high and it was tripping as the drive decellerated during homing (could not slow down fast enough). Reducing the accelleration fixed it.

I never did  get CIA402 homing going and eventully just did it in linuxcnc.

I did give it a good attempt and at that stage, there was a huge amount of code  required to replace the homing.c features. Dewey  redid this to simplify it but that obsoleted my work so I kinda lost interest. My idea was to move Dominic's cia402.comp into the homecomp so that the various pins he used moved to the joints. I almost got this going github.com/rodw-au/ciahome.

I have often thought of making a simple test rig to play further with homing but time is an issue these days. I like your idea of the simple cheap machine for testing and have also considered this.
Attachments:
Last edit: 29 Mar 2024 06:47 by rodw.

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

Time to create page: 0.142 seconds
Powered by Kunena Forum