Config absolute encoder with step/dir system

More
7 years 9 months ago #125422 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

Please Log in to join the conversation.

More
7 years 8 months ago #125462 by andypugh
I think you need to _not_ add any offsets to the encoder output.

Try
Code:
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 to join the conversation.

More
7 years 8 months ago #125481 by thang
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

Please Log in to join the conversation.

More
7 years 8 months ago #125483 by andypugh

thang wrote: + 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 to join the conversation.

More
7 years 8 months ago #125510 by thang
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 to join the conversation.

More
7 years 8 months ago #125532 by dm17ry
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 to join the conversation.

More
7 years 8 months ago #126440 by thang
Sorry, my pc just get fixed today. I created a simulator to show you how i configed.

Attachment not found

Attachment not found

Attachment not found



[strike]Just need compile abs_sim.comp by halcompile then run it. The following error happen when i turn machine on (F2)[/strike]

This is an update to files that use abs encoder to home, who interesting in using absolute encoder can take this to prefer

Please Log in to join the conversation.

Time to create page: 0.330 seconds
Powered by Kunena Forum