Monitoring Cartesian Positions with Karel

  • Monitoring Cartesian Positions with Karel



    Does anyone know or ever done a program that monitors the positions while the robot runs?


    I guess it would be similar to the DCS option, but probably not safety rated.


    I would buy the option, but DCS was not offered on these old RJ3 robots.


    I just need to monitor everything real-time and if it crosses a boundary, stop.

  • Hi
    Do a search for MCH_POS I used it a couple of times (not in karel, yes in BG logic )
    Work goods with boundaries but is no perfect. I was just trying that at 1000mm/sec going back a forth between two points separate by a meter.
    A DO was turning on a relay every time I was crossing a boundary. I can see the relay turning on/off at about an inch from the actual boundary

    Retired but still helping


  • Hi
    Do a search for MCH_POS I used it a couple of times (not in karel, yes in BG logic )
    Work goods with boundaries but is no perfect. I was just trying that at 1000mm/sec going back a forth between two points separate by a meter.
    A DO was turning on a relay every time I was crossing a boundary. I can see the relay turning on/off at about an inch from the actual boundary


    That's good to know. I didn't know they could do that with BG Logic since normally it alarms out for any motion in BG. I know on our older Rj3 (Not iA or iB), they don't have the option. Do you know if they offered BG Logic back then on that controller?

  • If you want to use Karel, use CURPOS and CURJPOS built-in routines to get TCP position in cartesian and joint representation.
    Use this with simple program control like REPEAT ... UNTIL or Condition Handlers to stop robot motion.
    You can use $MCR.GRP[1].UOP_IMSTP or $MCR_GRP[1].$MACHINELOCK to stop and prevent motion of the robot while boundaries are crossed


  • If you want to use Karel, use CURPOS and CURJPOS built-in routines to get TCP position in cartesian and joint representation.
    Use this with simple program control like REPEAT ... UNTIL or Condition Handlers to stop robot motion.
    You can use $MCR.GRP[1].UOP_IMSTP or $MCR_GRP[1].$MACHINELOCK to stop and prevent motion of the robot while boundaries are crossed


    I'm not that good at Karel, I've just tinkered with it to get some cameras to communicate. If I use those instructions, it will constantly loop in the karel and allow the robot to keep going through the program?

  • Yes but you need to add some stuff to your program.
    First, right after the PROGRAM ***** line, you need to add some attributes :
    %NOLOCKGROUP -- because the karel program won't use motion
    %NOABORT = ERROR + COMMAND -- ERROR will prevent the karel program from aborting if any error occur and COMMAND will prevent the user from aborting the Karel program from the TP
    %NOPAUSE = ERROR + COMMAND + TPENABLE -- Same as %NOABORT, TPENABLE disable pause of the karel program when the TP is turned on.


    Then you can add a master loop with a condition that is never satisfied to prevent your program from ending


    You can even add your program the the Cold and HOT start autoexec to run the program at startup (i would recommend removing the COMMAND part from the %NOABORT attribute as you will need a way to move the robot once it reached the boundaries)


  • This is really good info. Thanks allot.


    Question I have, is I've had Karel programs hang up and the only way to fix it was to cycle power or Abort. If I put it in Autoexec and a problem arrises. How would you clear it then?


    I requested to take a karel class but it got denied for the time being. I'll probably take a class next year. Until then, I'll look through my Karel manual.


    Thanks again.


  • Something else I've always wanted to do is to make a Karel prgram that constantly updates the greatest and lowest value each Cartesian axis reaches then set a program like i described to monitor it. SO that way, if anyone changes a program off of it's intended course, the robot would alarm out and stop.

  • Quote

    Question I have, is I've had Karel programs hang up and the only way to fix it was to cycle power or Abort. If I put it in Autoexec and a problem arrises. How would you clear it then?


    If you remove the %NOABORT attribute from the program, it will abort itself everytime an error occur (i never paid attention on how it works with warnings).
    You'll need to run the program again (either manually or through some kind of logic depending on what you want to do)


    Quote

    Something else I've always wanted to do is to make a Karel prgram that constantly updates the greatest and lowest value each Cartesian axis reaches then set a program like i described to monitor it. SO that way, if anyone changes a program off of it's intended course, the robot would alarm out and stop.


    Are you looking to prevent someone from modifying TP program position or just to check if anyone have moved the robot manually ?

  • Just to guard them from a crash more than anything. I just would prefer not having to jog the robot to every point a record where I am in each axis to set limits over that. It would be nice to have it just keep up with the min and max of every axis, then I set a limit around that after it's run awhile.


    Anyways, Thanks for all the help.


    I guess I'm just trying to replicate DCS on an Old robot.

  • Quote

    Just to guard them from a crash more than anything. I just would prefer not having to jog the robot to every point a record where I am in each axis to set limits over that. It would be nice to have it just keep up with the min and max of every axis, then I set a limit around that after it's run awhile


    So you're looking to set limits to the max and min value of each axis ?
    If so you can use the CURJPOS instruction to retrieve the current angle value of each axis and use the same kind of logic to stop the robot once any of the values goes beyond limits.
    Just access each element of the JOINTPOS type variable.

  • So you're looking to set limits to the max and min value of each axis ?
    If so you can use the CURJPOS instruction to retrieve the current angle value of each axis and use the same kind of logic to stop the robot once any of the values goes beyond limits.
    Just access each element of the JOINTPOS type variable.


    Okay, I will give it a try. Thanks for all the help.

Advertising from our partners