- Posts: 476
- Thank you received: 52
Orient component revised
6 years 7 months ago - 6 years 7 months ago #160804
by alkabal
Also does not work fine i see only from halscope ashortest_move = 3 ashortest_move2 = -10 (the first move from 0 to 10) and is never updated after other M19 ???
200 to 10 is ok turn cw (deviation 190)
200 to 180 is not ok turn cw (deviation 20)
10 to 200 is not ok turn cw (deviation -190)
180 to 200 is ok turn cw (deviation -20)
Replied by alkabal on topic Orient component
Code:
if (angle_deviation > 180){
cmd_to_pid_orient = vel_speed;
ashortest_move = 1;
ashortest_move2 = angle_deviation;
} else {
if (angle_deviation > 0){
cmd_to_pid_orient = -vel_speed;
ashortest_move = 2;
ashortest_move2 = angle_deviation;
} else {
if (angle_deviation > -180){
cmd_to_pid_orient = vel_speed;
ashortest_move = 3;
ashortest_move2 = angle_deviation;
} else {
if (angle_deviation < -180 ){
cmd_to_pid_orient = -vel_speed;
ashortest_move = 4;
ashortest_move2 = angle_deviation;
}
}
}
}
Also does not work fine i see only from halscope ashortest_move = 3 ashortest_move2 = -10 (the first move from 0 to 10) and is never updated after other M19 ???
200 to 10 is ok turn cw (deviation 190)
200 to 180 is not ok turn cw (deviation 20)
10 to 200 is not ok turn cw (deviation -190)
180 to 200 is ok turn cw (deviation -20)
Last edit: 6 years 7 months ago by alkabal.
Please Log in or Create an account to join the conversation.
6 years 7 months ago - 6 years 7 months ago #160817
by alkabal
Replied by alkabal on topic Orient component
Stupid bug from keeping the "last_enable" checking...
Now work like a charm :silly:
Can now ask if you have some idea for better positionning
And regarding to pid feedback-deriv command-deriv using position and Angle ? (at start rewriting the component i have very bad result using -deriv)
Br
Now work like a charm :silly:
Can now ask if you have some idea for better positionning
Code:
if (angle_scaled_out <= angle+tolerance && angle_scaled_out >= angle-tolerance) is_oriented = 1;
And regarding to pid feedback-deriv command-deriv using position and Angle ? (at start rewriting the component i have very bad result using -deriv)
Br
Last edit: 6 years 7 months ago by alkabal.
Please Log in or Create an account to join the conversation.
6 years 7 months ago #161161
by andypugh
If you are asking for a different way to code that, a common way to do it is
Replied by andypugh on topic Orient component
alkabal wrote: Can now ask if you have some idea for better positionning
Code:if (angle_scaled_out <= angle+tolerance && angle_scaled_out >= angle-tolerance) is_oriented = 1;
If you are asking for a different way to code that, a common way to do it is
Code:
if ( absf( angle_scaled_out - angle ) < tolerance ) is_oriented = 1;
Please Log in or Create an account to join the conversation.
6 years 7 months ago #161202
by alkabal
Replied by alkabal on topic Orient component
Thanks this is more cleaner like this !
I will ask mostly for advanced idea : something like use actual_velocity in the calcul for increase accuracy.
Or for increase speed regarding the angle_deviation.
For now this do the job i have no real need orient on this lathe because the encoder is 400ppr, 0.9° per pulse...
I have do this mostly because original component are for me too much difficult to setup and not easy to understand the code.
I will ask mostly for advanced idea : something like use actual_velocity in the calcul for increase accuracy.
Or for increase speed regarding the angle_deviation.
For now this do the job i have no real need orient on this lathe because the encoder is 400ppr, 0.9° per pulse...
I have do this mostly because original component are for me too much difficult to setup and not easy to understand the code.
Please Log in or Create an account to join the conversation.
6 years 7 months ago #162421
by alkabal
Replied by alkabal on topic Orient component
I haven't news for now these revised component seem to work fine.
But i see something IMO wrong, when use M19 "halui.spindle.0.on" and "spindle.0.on" stay to False but the spindle is moving so i think this is a possible cause of problem.
What did you think ?
But i see something IMO wrong, when use M19 "halui.spindle.0.on" and "spindle.0.on" stay to False but the spindle is moving so i think this is a possible cause of problem.
What did you think ?
Please Log in or Create an account to join the conversation.
6 years 6 months ago #162481
by andypugh
Replied by andypugh on topic Orient component
Is there any connection between the *-spindle.0.on and the rest of HAL?
Normally they would be used to enable / disable the spindle drive.
But that might not be ideal in orient mode.
You need to decide how you want to handle spindle-enable.
Normally they would be used to enable / disable the spindle drive.
But that might not be ideal in orient mode.
You need to decide how you want to handle spindle-enable.
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds