Log/monitor distance travelled by linear track axis

  • In order to be able to perform some automatic service on a linear track, we would like to log the distance travelled by the 7th axis. I was wondering if there is a system variable similar to $SCR_GRP[1].$MOVE_DST that monitors movements (including jogging) of individual axes instead of the TCP point?


    I have thought about running a karel program that periodically updates the current JPOS, but I would prefer not to be dependent on something like auto_exec programs if I don't have to.


    Any other suggestions/ideas are welcomed as well

    • Helpful

    You can use BG Logic to constantly monitor the position of the rail and update a register to track total distance moved.


    For a rail, the angular position is actually linear. So you can use $SCR_GRP[x].$MCH_ANG[y] where x= group and y = axis number.

  • Thank you, that is exactly what I need! Posting my solution here (with excessive use of registers to demonstrate the method), should anyone else need something like this:

    Note that there is a lot to optimise in terms of computation time for BG-logic, but I didn't spend any attention to this since I won't be running this in the guaranteed 8 ms cycle. Even a 1s cycle would provide more than enough resolution.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now