- LinuxCNC
- General LinuxCNC Questions
- intergrate computed torque control (dynamic control) for linuxcnc
intergrate computed torque control (dynamic control) for linuxcnc
- thang
- Offline
- Elite Member
Less
More
- Posts: 196
- Thank you received: 11
20 Oct 2017 09:04 #100577
by thang
Replied by thang on topic intergrate computed torque control (dynamic control) for linuxcnc
My component has multi file.c, i dont know if halcompile can compile it or i have to put all of them into a single file C. I was looking at many hal components written from C but all of them are single file
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4862
20 Oct 2017 10:00 #100580
by andypugh
Replied by andypugh on topic intergrate computed torque control (dynamic control) for linuxcnc
All I can suggest is trying it.
halcompile can compile C or .comp. For kinematics you would not use .comp even for a simple module.
halcompile can compile C or .comp. For kinematics you would not use .comp even for a simple module.
Please Log in or Create an account to join the conversation.
- automata
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 58
04 Dec 2017 05:37 #102648
by automata
Replied by automata on topic intergrate computed torque control (dynamic control) for linuxcnc
hi thang,
I have some experience writing computed torque controllers for robots (Puma 560) as well as multi file c components for realtime in HAL and I am definitely interested in this project.
What robot are you targeting?
apprise on your project and let us see how to take this forward.
On the side, I have also coded a patch that allows you the switch from a task based planner to a joints based planner - on the fly, using a Gcode command. This is really important for switching from joints controller to a task controller on-the fly.
-automata
I have some experience writing computed torque controllers for robots (Puma 560) as well as multi file c components for realtime in HAL and I am definitely interested in this project.
What robot are you targeting?
apprise on your project and let us see how to take this forward.
On the side, I have also coded a patch that allows you the switch from a task based planner to a joints based planner - on the fly, using a Gcode command. This is really important for switching from joints controller to a task controller on-the fly.
-automata
Please Log in or Create an account to join the conversation.
- thang
- Offline
- Elite Member
Less
More
- Posts: 196
- Thank you received: 11
04 Dec 2017 06:55 #102649
by thang
Replied by thang on topic intergrate computed torque control (dynamic control) for linuxcnc
hi automata,
for now, we are still developing on it. I can manual compute torque for any robot by matlab to get formula then move it to C program. I wrote a realtime component to compute joint's torque although this formula is very long that need 4gb ram to compile.
i'm interested in your patch u mentioned that can help change robot config ( i just can change robot config by Mcode that change hal pin connected to flags of kinematic but i think this is not a good way).
For now, i'm focusing on planning trajectory by Gcode but seem there is no CAM software on linux support 4-5axis
for now, we are still developing on it. I can manual compute torque for any robot by matlab to get formula then move it to C program. I wrote a realtime component to compute joint's torque although this formula is very long that need 4gb ram to compile.
i'm interested in your patch u mentioned that can help change robot config ( i just can change robot config by Mcode that change hal pin connected to flags of kinematic but i think this is not a good way).
For now, i'm focusing on planning trajectory by Gcode but seem there is no CAM software on linux support 4-5axis
Please Log in or Create an account to join the conversation.
- automata
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 58
04 Dec 2017 13:59 #102662
by automata
Replied by automata on topic intergrate computed torque control (dynamic control) for linuxcnc
Hi thang,
Computed torque control equations generally involve only matrix multiplication. Are you planning to use an inverse Jacobian in your computation also? This way you will be applying the control equation in the task space.
For calculation of the computed torque you will require the joint positions and velocities. Using those you can compute the M (inertia matrix), C (coriollis vector) and G/n (gravity vector). This computation should be straight forward and should not take a lot of CPU time and is viable to do in realtime. Beyond that the torque can be computed by simple matrix multiplication.
When you switch from joint mode to task mode for the planner, the current position of the planner will change from joints to axis position. The mode switch is propogated to the kinematics module via a hal pin. The forward kinematics change will change the feedback input of the motion controller from joints to task. This causes the planner to output spurious motion. So we need to tell the planner start replanning from that point with a kind of soft reset like that which happens on motion.disable being asserted.
I have tried this with a gcode G12.1 for switching from linear kinematics to polar kinematics as a proof of concept but it is bit rotting in some old branch somewhere on my local git. Will dig it up in a couple of days , bring it up to speed to master and post it somewhere public. Give me till the end of the week.
-automata
Computed torque control equations generally involve only matrix multiplication. Are you planning to use an inverse Jacobian in your computation also? This way you will be applying the control equation in the task space.
For calculation of the computed torque you will require the joint positions and velocities. Using those you can compute the M (inertia matrix), C (coriollis vector) and G/n (gravity vector). This computation should be straight forward and should not take a lot of CPU time and is viable to do in realtime. Beyond that the torque can be computed by simple matrix multiplication.
When you switch from joint mode to task mode for the planner, the current position of the planner will change from joints to axis position. The mode switch is propogated to the kinematics module via a hal pin. The forward kinematics change will change the feedback input of the motion controller from joints to task. This causes the planner to output spurious motion. So we need to tell the planner start replanning from that point with a kind of soft reset like that which happens on motion.disable being asserted.
I have tried this with a gcode G12.1 for switching from linear kinematics to polar kinematics as a proof of concept but it is bit rotting in some old branch somewhere on my local git. Will dig it up in a couple of days , bring it up to speed to master and post it somewhere public. Give me till the end of the week.
-automata
Please Log in or Create an account to join the conversation.
- thang
- Offline
- Elite Member
Less
More
- Posts: 196
- Thank you received: 11
04 Dec 2017 16:23 #102670
by thang
Replied by thang on topic intergrate computed torque control (dynamic control) for linuxcnc
Hi automata,
Yes Computed torque control is just need only matrix multiplication, partial derivative to calculate jacobian of links and loops but when i was researching this my knowledge about linuxcnc is quite bit ( i dont know if linuxcnc has a math library like Eigen, didnt read library math.h yet) and still a "noob" programer (for now i'm still like that ).Code in matlab is a bit easier for me.
In future, i will try hard code them complete in C, anyway the current code is still ok, it's give 100-150ums to calculate (although file's very long and i dont like it).
Using inverse jacobian to calculate static force is simpler than dynamic force. ofc i'm going to use it.
Yes Computed torque control is just need only matrix multiplication, partial derivative to calculate jacobian of links and loops but when i was researching this my knowledge about linuxcnc is quite bit ( i dont know if linuxcnc has a math library like Eigen, didnt read library math.h yet) and still a "noob" programer (for now i'm still like that ).Code in matlab is a bit easier for me.
In future, i will try hard code them complete in C, anyway the current code is still ok, it's give 100-150ums to calculate (although file's very long and i dont like it).
Using inverse jacobian to calculate static force is simpler than dynamic force. ofc i'm going to use it.
Please Log in or Create an account to join the conversation.
- thefabricator03
- Offline
- Platinum Member
Less
More
- Posts: 1130
- Thank you received: 533
31 Oct 2019 06:15 #149259
by thefabricator03
Replied by thefabricator03 on topic intergrate computed torque control (dynamic control) for linuxcnc
Hi Thang,
Is there a chance you could share the joint compensation component you wrote? I am trying to do the same thing. I want to put together a config for industrial robots that is to robots what PlasmaC is to plasma cutters.
I would be very much appreciative for your help.
Is there a chance you could share the joint compensation component you wrote? I am trying to do the same thing. I want to put together a config for industrial robots that is to robots what PlasmaC is to plasma cutters.
I would be very much appreciative for your help.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19526
- Thank you received: 6553
31 Oct 2019 10:18 #149269
by tommylight
Go! Go! Go!
Replied by tommylight on topic intergrate computed torque control (dynamic control) for linuxcnc
......... I want to put together a config for industrial robots that is to robots what PlasmaC is to plasma cutters................
Go! Go! Go!
The following user(s) said Thank You: thefabricator03
Please Log in or Create an account to join the conversation.
- thang
- Offline
- Elite Member
Less
More
- Posts: 196
- Thank you received: 11
02 Nov 2019 02:21 #149404
by thang
Replied by thang on topic intergrate computed torque control (dynamic control) for linuxcnc
What do u mean by "joint compensation component"? If u mean "dynamic control" then i'm so sorry because i'm not finish this component yet, it was stopped because i'm still busy to do other things, for now i just have a C component that calculate torque, it's still raw because it doesnt use partial derivative and i never use it to contrl a real robot yet . I could share it but i'm not sure you can use it
Please Log in or Create an account to join the conversation.
- thefabricator03
- Offline
- Platinum Member
Less
More
- Posts: 1130
- Thank you received: 533
02 Nov 2019 04:14 - 02 Nov 2019 05:01 #149405
by thefabricator03
Replied by thefabricator03 on topic intergrate computed torque control (dynamic control) for linuxcnc
Hi Thang,
Yes I mean dynamic control. If you could share it, it might help give me a basic example of what I need to do to create a finished dynamic component for my open source config.
Yes I mean dynamic control. If you could share it, it might help give me a basic example of what I need to do to create a finished dynamic component for my open source config.
Last edit: 02 Nov 2019 05:01 by thefabricator03.
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- intergrate computed torque control (dynamic control) for linuxcnc
Time to create page: 0.157 seconds