I'm currently doing a robotic internship and I'm trying to control a simulated humanoid robot.
I'm using a PID controller to control each of my 6 joints (2 ankles, 2 knees and 2 hips). For the moment I'm always moving both identical joints (for example both knees) together, so it's like having only 3 joints. The input is the angular position of the joint, and the output is the torque of the motor driving that joint.
Tuning one PID (while blocking completely the other joints) isn't too difficult. When I tried to use activate both the PID of the ankles and the PID of thee knees, I first got something quite instable, but I managed to get a correct result by playing with the coefficients of my PIDs (particularly decreasing the derivative part).
Now I'm trying to use all the joints at once, and I can't manage to get some stable system : I manage to get trajectories that are quite good, but with high frequency oscillations, corresponding to big torques changing sign at each time step.
I'm using Gazebo (a physic engine based on ODE) to simulate my robot, with a simulation time step of 0.2 ms. Just after each simulation step I update my PIDs (so the calculated torques will be used by the next simulation step). So I have both simulation and control working at 5 kHz (I may still increase a little bit this frequency, but I'd rather not if I could avoid, because the simulation is already quite slow).
When I put no proportional coefficients in my PIDs, everything is smooth, but of course I get big oscillations at low frequency (<30Hz).
When I add proportional coefficients, I'm getting big oscillations of the output (torques) at 2.5 kHz : each time step, the output is changing sign!
Do you have some idea where the problem may come from and/or how to solve it?
Do you think it's a bad idea to update the controllers at the same frequency than the simulation? should I reduce the control frequency? Or even use a different thread to get them non synchronized?
Or do you know a method to tune multiple PIDs (I'm doing it my try and error without real method)?
Thank you very much in advance
PS: I'd rather not do it by modeling the system mathematically, because on the final application (an exoskeleton) I will not have a reliable model of the human wearing it)
You have to look at the physical geometry of your system to sort out the interactions, since every joint will have some degreee of interaction with all other joints. It can be quite a bit of controls, and not likely a simple control system.
You can use independent PIDs in a given loop to the degree that you can demonstrate that it is unaffected by the others.
It involves maths that has been used in automation since the 80's