I need a simple CSP example for CiA 402

More
2 years 7 months ago #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
2 years 7 months ago #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: endian

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

More
2 years 7 months ago #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
2 years 7 months ago - 2 years 7 months ago #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.
Last edit: 2 years 7 months ago by rodw.

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

More
2 years 7 months ago #297119 by endian
hi Rod,

I do not know which type of drivers you are actually using but for my configuration homing works normally. Everytime it starts and dones right. and repeatabelity is usefull too.. but it was pain to done it for my old hardware stuff..

I had customized Dominiks cia402 homing subroutine for my hardware and shaped them like in my regular PLC programs.. but you have to had a right servo homming subroutine setup inside the servodrive, right sensor or switching device type, right homing mode codes etc... 

code should be splitted to read and write function, but I do not have time to do it and because of them I added single scan time delay temp...

there is starting of homing subroutine for each type of drive different and therefore I am setting bit 4 or bit 11 in the controlword 
Code:
if(home) { switch (home_state){ //#############################################################################3# case HOME_TRIGGER: opmode = homing_mode_code; pos_fb_from_incremental = pos_cmd; if(opmode_homing){ pos_fb_from_incremental = pos_cmd; home_state = HOME_CONFIRM; homingStatus = home_state; } break; //#############################################################################3# case HOME_CONFIRM: pos_fb_from_incremental = pos_cmd; if(opmode_homing){ // Homing request accepted from driver if(opmode_display == homing_mode_code){ controlword |= (1 << 4); // homing subroutine request set if(homingDelay > waitingDelay){ if(!stat_internal_homed){ home_state = HOME_SEEKING; homingStatus = home_state; homingDelay = 0; } } else{ homingDelay++; } } else{ if(opmode_display == homing_mode_code_display_from_drive){ controlword |= (1 << 11); // homing subroutine request set if(homingDelay > waitingDelay){ if(!stat_internal_homed){ home_state = HOME_SEEKING; homingStatus = home_state; homingDelay = 0; } } else{ homingDelay++; } } } } break; //#############################################################################3# case HOME_SEEKING: if(stat_internal_homed){ if(opmode_display == homing_mode_code){ controlword &= ~(1 << 4); // reset homing subroutine request reset } else{ controlword &= ~(1 << 11); // reset homing subroutine request reset } home = 0; home_state = HOME_TRIGGER; homingStatus = home_state; pos_fb_from_incremental = (drv_actual_position_incremental) * pos_scale_rcpt * incremental_pos_scale_rcpt; if(pos_mode){ opmode = csp_mode_code; } else{ opmode = csv_mode_code; } } break; //#############################################################################3# } } else{ if(pos_mode){ opmode = csp_mode_code; } else{ opmode = csv_mode_code; } }

 
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 #297124 by scottlaird
Ah, that helped a bit. Swapping your ECT60 generic config in for my ECT60 basic_cia config (and modifying pin names to match) resulted in slightly different errors and a bit of motion. It's only moving target-position by -50 before getting following errors, but it *is* moving.

I'm not sure quite what's up -- swapping back to basic_cia keeps the same behavior, so maybe I wasn't setting one of the 0x2xxx SDO entries?

In any case, I'm probably looking at a mix of missing per-drive config and maybe bad CiA 402 following limits. In either case, it's something that I can probably move forward on quickly.
The following user(s) said Thank You: rodw

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

Time to create page: 0.081 seconds
Powered by Kunena Forum