Hi, I want to implement a PID controller for the kuka iiwa 14 based on the FRI (c++), Does somebody please have any experience with it or could share a sample code I can start with. Thanks in advance.
PID Controller for KUKA LWR IIWA 14
-
anasejl -
July 16, 2021 at 3:05 PM -
Thread is Unresolved
-
-
was this post not detailed enough? what is it specifically that you have a problem with?
Quote
So, for doing PID control I wrote an application which puts the robot in impedance control and sets all joint impedances to zero. I then use the positionhold() motion primitive to command the robot to hold current position, and then overlay FRI torque commands on this motion. In FRI, when you are in torque command mode, you still have to send position commands. I normally just mirror the measured position as position commands because if the robot moves more that ±10 degrees from the commanded position in torque command mode, you get an "illegal axis delta error". Note that since all joint impedances are set to zero, changing the FRI position commands does nothing other than avoiding the "illegal axis delta" fault from occurring.QuoteI recommend checking out the LBRTorqueSineOverlay example which can be found under examples > com.kuka.connectivity.fri.example in Sunrise workbecnh. The corresponding client application can be found under the example folder in FRI Client SDK.
-
thanks for the reply. Actually I am already taking the points you specified in your post into account and they are already included in my code. But I am still having some open questions concerning the robot itself and the computed torque controller as well, I will try to express them here..
1- I am trying to implement this controller [ τ = M(θ) ( θ̈_des_acc − Kv_* ė − Kp_ *e) + C(θ, θ̇) θ̇_des_vel + n(θ) ] with 1 kHz. For that, I need to have some information to define the inertia matrix, coriolis and gravity vectors. KUKA doesnt provide any kind of information about this in the datasheet. In case you also use a similar controller how did you define the inertia matrix and the other parameters ? A solution I am using for now is the kdl parser to retrieve the parameters from the URDF file they're using in the iiwa_stack repo, and try to define the matrices/vectors I need using the kdl library (kdl chain, solvers..etc)
2- In the datasheet, we just have joint, velocity and torques limits but sometimes when sending commands to one joint even if it's within those limits the robot is breaking and does not continue the movement. So probably I need to consider some additional limits as well, such as acceleration, jerk, torque derivative limits but I didn't find any information about them till now. Do you maybe have any Idea about it ?
3- I'm now in the phase of tuning the gains (Kv and Kp) of the controller I mentioned above, do you have any idea on how to do this correctly ? because till now it's more a trial and error process i.e. increasing the proportional gain till having oscillation and then try to find a differential gain that damps the oscillations. But somehow when increasing the proportional gain I could just get one oscillation, and if I keep increasing the joint just stop rotating (probably because one of the unknown limits mentioned above was exceeded..).
4-Using the smartPad, there is a possibility to apply a torque to a certain joint (In "Axis torques"). Let's say I want to control the last joint (joint[7]) when using the smartpad and the + button in T1 I can see on the smartpad that the torque is changing to a value of 0.2 Nm and maintaining it while I'm pressing the + button. But when using FRI and sending a torque of 0.2 Nm to the 7th joint, it is not moving at all, but then when sending a torque of 1 Nm it will move for some degrees and then the robot brakes. Do you have an idea why ? and what does the torque in the smartpad represent and how is it related to the torque I am commanding from FRI and how can I know from which commanding torque the joint could start moving ?
5-When I want to test the code I write in FRI, I am always running in T1 mode but then when I press the play button sometimes it will not start with the movement directly but I got the repositioning arrow and then I have to re press the play button to start the movement, have you also had a similar behaviour ? Or sometimes when I send for example a torque of 0.7 Nm to the 7th joint in FRI it's moving after doing the repositioning but when I restart the robot the same program will not work, so I have to send a bigger torque and then decreasing it... I know it's somehow a weird behavior but I just wanted to state it here in case you have a more practical way to test your codes.
Sorry for this long post, I have invested some time to try to understand those points but in vain. I couldn't find enough resources about developing controllers using FRI. I hope you can help and thanks a lot in advance.
-
Hi, any idea about my issues ? Thanks in advance
-
Hello!
did you solve the problem?