1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Monitoring Cartesian Positions with Karel

  • ESIELI
  • August 19, 2016 at 5:59 PM
  • Thread is Resolved
  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 19, 2016 at 5:59 PM
    • #1

    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.

  • Fabian Munoz
    Reactions Received
    134
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • August 19, 2016 at 6:30 PM
    • #2

    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

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 22, 2016 at 4:49 PM
    • #3
    Quote from Fabian Munoz


    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?

  • skalactik
    Reactions Received
    13
    Trophies
    3
    Posts
    111
    • August 22, 2016 at 5:06 PM
    • #4

    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

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 22, 2016 at 5:48 PM
    • #5
    Quote from skalactik


    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?

  • skalactik
    Reactions Received
    13
    Trophies
    3
    Posts
    111
    • August 22, 2016 at 6:04 PM
    • #6

    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)

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 22, 2016 at 6:50 PM
    • #7
    Quote from skalactik


    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.

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 22, 2016 at 7:01 PM
    • #8
    Quote from skalactik


    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)

    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.

  • skalactik
    Reactions Received
    13
    Trophies
    3
    Posts
    111
    • August 23, 2016 at 1:01 PM
    • #9
    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 ?

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 23, 2016 at 2:38 PM
    • #10

    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.

  • skalactik
    Reactions Received
    13
    Trophies
    3
    Posts
    111
    • August 23, 2016 at 3:02 PM
    • #11
    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.

  • ESIELI
    Reactions Received
    10
    Trophies
    5
    Posts
    275
    • August 23, 2016 at 5:52 PM
    • #12
    Quote from skalactik

    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

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download