Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

following error when homing with abs encoder #2308

Closed
1 task
annhan opened this issue Jan 27, 2023 · 3 comments
Closed
1 task

following error when homing with abs encoder #2308

annhan opened this issue Jan 27, 2023 · 3 comments

Comments

@annhan
Copy link
Contributor

annhan commented Jan 27, 2023

Hi.

This error occurred when I clicked home on any axis, which was configed to be the abs encoder.

HOME_ABSOLUTE_ENCODER = 2

Ini file of joint

[JOINT_0]
#AXIS = X
NAME = shoulder
TYPE = ANGULAR
MAX_VELOCITY = 100
MAX_ACCELERATION = 80.0
P = 2.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1
FF2 = 0.00030
BIAS = 0.0
DEADBAND = 0.2
MAX_OUTPUT = 0.0
STEPGEN_MAX_VEL =    150
STEPGEN_MAX_ACC =    300
BACKLASH =           0.0
MIN_LIMIT = -181
MAX_LIMIT = 181
HOME_IGNORE_LIMITS =YES
HOME_SEARCH_VEL = -20
HOME_LATCH_VEL = -5
HOME_FINAL_VEL = 7.0
HOME_SEQUENCE = 0
HOME = 0
FERROR = 3.0
MIN_FERROR = 3.0
HOME_OFFSET = 0
HOME_ABSOLUTE_ENCODER	= 2
DIRSETUP   =  6000
DIRHOLD    =  6000
STEPLEN    =  1500
STEPSPACE  =  1500
STEP_SCALE = 1137.7778

This is what I expected to happen:

  • update homing status

This is what happened instead:

  • Got error Joint xx following error

It worked properly before this:

  • my build file from 27/11/2022 work ok. After pull request from master and rebuild.i got this error.

Information about my hardware and software:

  • I am using this Linux distribution and version (often, shown by lsb_release -a):

Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

  • I am using this kernel version (shown by uname -a): Linux mwork 4.19.0-23-rt-amd64 use Tcl_SetResult and Tcl_GetStringResult #1 SMP PREEMPT RT Debian 4.19.269-1 (2022-12-20) x86_64 GNU/Linux

  • I am running ...

    • A binary I built myself
  • I am using this interface hardware vendor and chipset (e.g., parallel port, ethernet port, FPGA card): 7i80db

@andypugh
Copy link
Collaborator

The most likely culprit is this commit made by me:
f72bd0b

Can you do a git bisect to prove this? (It shouldn't take very long).

Instructions here: https://www.metaltoad.com/blog/beginners-guide-git-bisect-process-elimination (obviously you don't need to create a repository with a bad commit)

@andypugh
Copy link
Collaborator

The fix is probably this change in homing.c

        case HOME_FINISHED:
            H[joint_num].homing = 0;
            H[joint_num].homed = 1; // finished
            H[joint_num].home_state = HOME_IDLE;
            if ( ! H[joint_num].home_flags & HOME_ABSOLUTE_ENCODER) {
                joints[joint_num].free_tp.curr_pos = H[joint_num].home;
            }
            immediate_state = 1;
            H[joint_num].joint_in_sequence = 0;
            break;

@annhan
Copy link
Contributor Author

annhan commented Jan 31, 2023

The fix is probably this change in homing.c

        case HOME_FINISHED:
            H[joint_num].homing = 0;
            H[joint_num].homed = 1; // finished
            H[joint_num].home_state = HOME_IDLE;
            if ( ! H[joint_num].home_flags & HOME_ABSOLUTE_ENCODER) {
                joints[joint_num].free_tp.curr_pos = H[joint_num].home;
            }
            immediate_state = 1;
            H[joint_num].joint_in_sequence = 0;
            break;

Thank you so much. I tested it, and this code solved my issue.

@annhan annhan closed this as completed Feb 3, 2023
andypugh added a commit that referenced this issue Feb 3, 2023
Don't set position to home for absolute encoders.

Signed-off-by: andypugh <andy@bodgesoc.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants