Skip to content

For both parts of the assignment#1

Open
parthgoel17 wants to merge 27 commits intodeepboliya:mainfrom
parthgoel17:main
Open

For both parts of the assignment#1
parthgoel17 wants to merge 27 commits intodeepboliya:mainfrom
parthgoel17:main

Conversation

@parthgoel17
Copy link

The single inverted pendulum files are inside its folder and there is a separate package for the double inverted pendulum.

@parthgoel17 parthgoel17 changed the title For both part of the assignment For both parts of the assignment May 17, 2024
@deepboliya
Copy link
Owner

deepboliya commented May 21, 2024

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.

@parthgoel17
Copy link
Author

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?

@deepboliya
Copy link
Owner

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

@deepboliya
Copy link
Owner

Also add a diagram for your assumption of theta_0 and theta_1

@parthgoel17
Copy link
Author

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.

@deepboliya
Copy link
Owner

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

@parthgoel17
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants