Conversation
…m_balance.py changed folder
…swing.py changed folder
|
You should run ros2 nodes using the "ros2 run..." command rather than "python3". And then add it to the launch file as well. The balancing is working. but pendulum_swing.py and pendulum_balance.py are exactly the same file. So how are you achieving swing up. Your assumption of dt=1/500 is wrong and also rather than assuming a constant dt you should calculate your loop time in real time, balancing still works tho because it acts like another constant in multiplication with kp ki kd. Make a separate launch file for the double pendulum as well and add a single torque input at the hinge. |
|
I wasn't aware that i can it add to the launch file as well. and i run my nodes by the command ros2 run . I have updated the 'dt' term. As for the swing up, I didnt understand what the difference between their motions are, I thought it was just the change in initial state that matters. Can you explain what the difference both controllers are trying to achieve? |
The fact that we don't have enough torque changes everything, if you use PID, then the torque just remains clipped at 5. So you need to devise a method to increase energy of the pendulum such that it is able to reach the top most point and then switch to PID controller |
|
Also add a diagram for your assumption of theta_0 and theta_1 |
updated for swing up initially followed by PID
used a flag to tell if swing up completed
|
I have added a flag which is false until swing up is completed and during that time, i use a torque to increase the energy of the system. as soon as the swing up is completed, it switches to the PD controller to balance it. Added diagrams for initial conditions in both scenarios as well. |
|
Ran the simulation and then pendulum_balance.py. The swing up doesnt work. I still don't see nodes being added as an executable in the setup.py, had to run the the balance file using python3. And by diagram I meant, diagram for the double-inverted pendulum indicating theta0_0 and theta0_1 |
|
Please run the pendulum_swing.py node for the swing up function. and sorry, I forgot to commit my setup.py file ;/. I'll add the diagram for the double inverted pendulum as well. |
The single inverted pendulum files are inside its folder and there is a separate package for the double inverted pendulum.