Pressbrake CNC Control Setup Questions

More
28 Jun 2021 19:17 #213166 by PCW
What is intended to happen is that on index detection (hardware index when
index enable is true) is that the encoder position is reset to 0 and LinuxCNC
resets the commanded position to 0 when it detects the falling edge of index enable.

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

More
28 Jun 2021 21:40 #213176 by EW_CNC
So it seems that the problem that I'm having is when the encoder position gets reset, the move to the new commanded position is not controlled by the home-search-velocity.
Would it be possible to change the press component to stop homing when the encoder gets reset to 0 and have a separate move, if we still need it, to move to the new 0 offset point?

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

More
28 Jun 2021 21:52 #213178 by PCW
The reset should not cause a move. When the the search for index
is complete the motion should stop (obeying acceleration constraints)
and then move to the final home position with HOME_FINAL_VEL

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

More
28 Jun 2021 22:45 #213189 by BigJohnT
You need to set HOME_FINAL_VEL in your ini file for each axis.
HOME_FINAL_VEL = 0.0 - Velocity in machine units per second from home latch position to home position. If left at 0 or not included in the joint rapid velocity is used. Must be a positive number. 

JT

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

More
29 Jun 2021 00:44 #213201 by EW_CNC
I should explain that the motion for this configuration setup is controlled by a custom component, press.comp. Thanks to andypugh!
 

File Attachment:

File Name: press.comp
File Size:5 KB
Attachments:

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

More
29 Jun 2021 07:51 #213219 by andypugh
I need to look at the comp to make it behave like a LinuxCNC axis after home is found.

The .comp exists to keep the motion in the real-time layer. Where a press-brake differs from a CNC machine is that one axis is under entirely manual control, and faking that in a user-interface does not seem like the best idea.

I probably could have made it work a lot more easily inside the GUI, with a down command being a programmed move to the bend position, and sending an abort if the pedal is released. (which is exactly how GUI jogging works). But we do hear occasional stories of jogs not stopping because a key release has been missed, and such.

Back to the issue. Do you want the axes to stop when they find home, or to make a controlled move to a fixed position?

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

More
29 Jun 2021 11:43 #213227 by EW_CNC

Do you want the axes to stop when they find home, or to make a controlled move to a fixed position?

With my setup, on all 3 axis, they could stop when they find home, but both ways would work.

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

More
01 Jul 2021 22:25 #213458 by andypugh
I think that this might help.
Sorry, I have struggled to find any time for this.
(Don't forget that you need to halcompile the comp)

I think that this should just leave the axis where is homed to, but I can't really test it on my sim config. 

 
Attachments:
The following user(s) said Thank You: EW_CNC

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

More
02 Jul 2021 23:43 #213517 by EW_CNC
I have installed the comp and tried a few changes to it. It works best with my latest changes. 
case 0:
                if (axis_home_switch(axis)) {
                    axis_pos_cmd_out(axis) = axis_home_offset(axis) * 2;
                    axis_vel_cmd(axis) = axis_home_search_velocity(axis);
                    home_state = 1;
                } else {
                    axis_index_enable(axis) = 1;
                    axis_pos_cmd_out(axis) = -1 * axis_home_offset(axis);
                    axis_vel_cmd(axis) = axis_home_search_velocity(axis);
                    home_state = 2;
                }
                break;
            case 1: // searching down, Press Up
                if (! axis_home_switch(axis)){
                    [color=#c0392b][u]axis_pos_cmd_out(axis) = 0;[/u][/color]
                    home_state = 0;
                }
                break;
            case 2: // searching up, Press Down
                if (! axis_index_enable(axis)){
                    offset(axis) = axis_pos_fb_in(axis) - axis_home_offset(axis);
                    [color=#c0392b][u]axis_pos_cmd_out(axis) = 0;[/u][/color]
                    home_state = 0;
                    state = 0;
                }
                break;

I still get the rapid move of the offset when it homes to the axis.
If I startup with the axis close to the home position with min. offset correction it works great, but greater distance I'm off of the index position the greater the jump.

Would it be possible to get it to stop at rising edge of the home switch, then apply a rough correction offset, then resume to final homing with the index? It seems to me it needs to apply offset correction while motion is stopped, but I might be wrong.

I looked over the homing.c file.

It's more than I can figure out. I feel like a 1st grader learning to read when it comes to programming.

Take your time Andy, don't feel like this project is a rush. I'm amazed at the time you spend with LinuxCNC.
EW

homing.c
case HOME_INDEX_ONLY_START:
        /* This state is used if the machine has been pre-positioned
           near the home position, and simply needs to find the
           next index pulse.  It starts a move at latch_vel, and
           sets index-enable, which tells the encoder driver to
           reset its counter to zero and clear the enable when the
           next index pulse arrives. */
        /* is the joint already moving? */
        if (joint->free_tp.active) {
            /* yes, reset delay, wait until joint stops */
            H[joint_num].pause_timer = 0;
            break;
        }
        /* has delay timed out? */
        if (H[joint_num].pause_timer < (HOME_DELAY * servo_freq)) {
            /* no, update timer and wait some more */
            H[joint_num].pause_timer++;
            break;
        }
        H[joint_num].pause_timer = 0;
        /* Although we don't know the exact home position yet, we
           we reset the joint coordinates now so that screw error
           comp will be appropriate for this portion of the screw
           (previously we didn't know where we were at all). */
        /* set the current position to 'home_offset' */
        offset = H[joint_num].home_offset - joint->pos_fb;
        /* this moves the internal position but does not affect the
           motor position */
        joint->pos_cmd += offset;
        joint->pos_fb += offset;
        joint->free_tp.curr_pos += offset;
        joint->motor_offset -= offset;
        /* set the index enable */
        H[joint_num].index_enable = 1;
        /* set up a move at 'latch_vel' to find the index pulse */
        home_start_move(joint, H[joint_num].home_latch_vel);
        /* next state */
        H[joint_num].home_state = HOME_INDEX_SEARCH_WAIT;
        break;

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

More
03 Jul 2021 02:23 #213528 by PCW
Can you plot (with halscope) the commanded and feedback joint position
at the point where index enable goes low? This would give valuable information
as to what's going wrong.

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

Moderators: cncbasher
Time to create page: 0.118 seconds
Powered by Kunena Forum