Config absolute encoder with step/dir system
31 Jan 2019 18:23 #125422
by thang
Config absolute encoder with step/dir system was created by thang
I'm trying to use absolute encoder for my machine, here is my goal:
+ Getting absolute encoder data
+ Setting absolute encoder is used for homing.
+ Setting motor and absolute encoder direction
To use encoder i did:
+ Create a halcomponent to get absolute encoder data and make an output pin:
abs_pos_fb = absolute_pos_encoder + pos_offset + pos_incr
+ Connect halpin:
Hm2_5i25.0.stepgen.pos_fb <=> pos_incr
abs_pos_fb <=> motor_pos_fb
+ I take absolute encoder before power_on
+ Set homing with absolute encoder
There is a problem when i use this config:
+ after getting absolute encoder, motor_pos_fb is changed ==> generate motor_pos_cmd this will cause motor run.
If someone have exp about using absolute encoder ? Or is there anyway that i can set offset to make motor_pos_cmd =0 after get abs encoder? I found joint.x.motor_offset but i dont know how it work and this pin seem not writeable
+ Getting absolute encoder data
+ Setting absolute encoder is used for homing.
+ Setting motor and absolute encoder direction
To use encoder i did:
+ Create a halcomponent to get absolute encoder data and make an output pin:
abs_pos_fb = absolute_pos_encoder + pos_offset + pos_incr
+ Connect halpin:
Hm2_5i25.0.stepgen.pos_fb <=> pos_incr
abs_pos_fb <=> motor_pos_fb
+ I take absolute encoder before power_on
+ Set homing with absolute encoder
There is a problem when i use this config:
+ after getting absolute encoder, motor_pos_fb is changed ==> generate motor_pos_cmd this will cause motor run.
If someone have exp about using absolute encoder ? Or is there anyway that i can set offset to make motor_pos_cmd =0 after get abs encoder? I found joint.x.motor_offset but i dont know how it work and this pin seem not writeable
Please Log in or Create an account to join the conversation.
01 Feb 2019 13:37 #125462
by andypugh
Replied by andypugh on topic Config absolute encoder with step/dir system
I think you need to _not_ add any offsets to the encoder output.
Try
I think that all the calculations that you are doing in HAL are duplicates of calculations done in the motion module.
Try
net pos-fb absolute_pos_encoder joint.0.motor-pos-fb
I think that all the calculations that you are doing in HAL are duplicates of calculations done in the motion module.
Please Log in or Create an account to join the conversation.
01 Feb 2019 17:13 #125481
by thang
Replied by thang on topic Config absolute encoder with step/dir system
Curently i'm using open loop so I can only take absolute position once time(i use estop signal to start reading serial data). And i didnt use encoder increment.
When i connected:
motor-pos-cmd => hm2_5i25.0.stepgen.0.position-cmd
(abs_pos_encoder+ pos_offset + hm2_5i25.0.stepgen.0.position-fb) => motor-pos-fb
I saw:
+ After reading encoder data,
hm2_5i25.0.stepgen.0.position-cmd changed from 0 to value = -motor-pos-fb
hm2_5i25.0.stepgen.0.position-fb=0.
+ Turn power-on make f-error.
+ If there is noway to use absolute encoder with open loop, i will use step/dir system close loop like u mention, i wish i dont have to do it
When i connected:
motor-pos-cmd => hm2_5i25.0.stepgen.0.position-cmd
(abs_pos_encoder+ pos_offset + hm2_5i25.0.stepgen.0.position-fb) => motor-pos-fb
I saw:
+ After reading encoder data,
hm2_5i25.0.stepgen.0.position-cmd changed from 0 to value = -motor-pos-fb
hm2_5i25.0.stepgen.0.position-fb=0.
+ Turn power-on make f-error.
+ If there is noway to use absolute encoder with open loop, i will use step/dir system close loop like u mention, i wish i dont have to do it
Please Log in or Create an account to join the conversation.
01 Feb 2019 17:32 #125483
by andypugh
The way I suggested isn't closed loop, it just gives the system some information to use for homing.
Replied by andypugh on topic Config absolute encoder with step/dir system
+ If there is noway to use absolute encoder with open loop, i will use step/dir system close loop like u mention, i wish i dont have to do it
The way I suggested isn't closed loop, it just gives the system some information to use for homing.
Please Log in or Create an account to join the conversation.
02 Feb 2019 00:11 #125510
by thang
Replied by thang on topic Config absolute encoder with step/dir system
Absoluter position(without add stepgen position-fb or increment encoder) is constant. If i connect it directly to motor-pos-fb, this pin wont change.
Please Log in or Create an account to join the conversation.
02 Feb 2019 13:56 #125532
by dm17ry
Replied by dm17ry on topic Config absolute encoder with step/dir system
if you add a constant to stepgen.0.position-fb before feeding it to joint.0.motor-pos-fb then i think you have to subtract the same amount from joint.0.motor-pos-cmd and then feed it to stepgen.0.position-cmd
Please Log in or Create an account to join the conversation.
14 Feb 2019 10:04 - 20 Feb 2019 02:07 #126440
by thang
Replied by thang on topic Config absolute encoder with step/dir system
Sorry, my pc just get fixed today. I created a simulator to show you how i configed.
Just need compile abs_sim.comp by halcompile then run it. The following error happen when i turn machine on (F2)
This is an update to files that use abs encoder to home, who interesting in using absolute encoder can take this to prefer
This is an update to files that use abs encoder to home, who interesting in using absolute encoder can take this to prefer
Last edit: 20 Feb 2019 02:07 by thang.
Please Log in or Create an account to join the conversation.
Time to create page: 0.093 seconds