MOTMOD Questions
21 Jun 2020 23:43 #172288
by Freedo
MOTMOD Questions was created by Freedo
I am building a CNC with Odrives and BLDC motors with linear encoders on the axes and rotary encoders on the leadscrews. Backlash compensation is not doing anything (BACKLASH = 1.0 in my INI file did not cause the axis to violently oscillate) and I suspect it is because my HAL setup. I read the docs and I am confused on which pins I am supposed to use.
There should be an attached diagram of the HAL.
Am I supposed to use pos-cmd or motor-pos-cmd for the PID loops? The documentation is vague and only says that one of those is offset from the other. I would think that motor-pos-cmd has the backlash and pos-cmd doesn't. I tried using pos-cmd instead, but it didn't seem to account for the home offset.
My encoder setup also doesn't seem quite right. On boot, wherever the location of the axis is, my HAL component says that location is 0 and it does not get re-zeroed when homed. when I use joint.N.motor-pos-cmdm motmod seems to apply an offset after homing and makes everything work as expected but does not do it when I use joint-N.pos-cmd.
The other thing that doesnt seem right is that the linear encoders go to joint.N.motor-pos-fb and not joint.N.pos-fb. I tried to use pos-fb instead of motor-pos-fb, but pos-fb is only an output.
TLDR: motmod docs are unlcear, not sure if I am using the right pos-cmd and pos-fb pins
There should be an attached diagram of the HAL.
Am I supposed to use pos-cmd or motor-pos-cmd for the PID loops? The documentation is vague and only says that one of those is offset from the other. I would think that motor-pos-cmd has the backlash and pos-cmd doesn't. I tried using pos-cmd instead, but it didn't seem to account for the home offset.
My encoder setup also doesn't seem quite right. On boot, wherever the location of the axis is, my HAL component says that location is 0 and it does not get re-zeroed when homed. when I use joint.N.motor-pos-cmdm motmod seems to apply an offset after homing and makes everything work as expected but does not do it when I use joint-N.pos-cmd.
The other thing that doesnt seem right is that the linear encoders go to joint.N.motor-pos-fb and not joint.N.pos-fb. I tried to use pos-fb instead of motor-pos-fb, but pos-fb is only an output.
TLDR: motmod docs are unlcear, not sure if I am using the right pos-cmd and pos-fb pins
Please Log in or Create an account to join the conversation.
22 Jun 2020 04:34 #172298
by PCW
Replied by PCW on topic MOTMOD Questions
You use joint.N.motor-pos-cmd and joint.N.motor-pos-fb pins
for actual motor control.
for actual motor control.
Please Log in or Create an account to join the conversation.
24 Jun 2020 03:42 #172530
by Freedo
Replied by Freedo on topic MOTMOD Questions
I read through some of control.c and it looks like motor-pos-cmd is what I am supposed to use. I checked the value of the HAL pin joint.N.backlash−filt and it appears that backlash is being correctly read into motmod. I am still unsure why I am not seeing any changes in machine movement.
Please Log in or Create an account to join the conversation.
Time to create page: 0.131 seconds