Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Reinforcement Learning Robot Manipulator #2: Manipulator Dynamics and Motion Simulation”.
Other ways we can help with Python.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Multi-Objective Optimization Course: NSGA-II, MOPSO & Hybrid Algorithms (Python)

ECG Arrhythmia Classification Course with Wavelet & Deep Learning (PyTorch)

ANFIS + PSO/GA Course for Non-Linear Time Series Forecasting (Python)
Have it built for you
No time to learn Python? Our team can do the project for you.

Python Machine Learning — Prediction Models, Customer Segmentation, Fraud Detection & AI Apps

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, the robot arm is released without torque and swings freely due to gravity, simulated with Lagrange and Runge Kutta equations. Its energy remains constant up to 1 millionth of a Joule, proof that our model is correct. Let's start. Hello, welcome to episode two of the robot manipulator control series with reinforcement learning. Kinematics only answers where it is. To control the robot, we need to know what torque makes it move, including the effects of inertia, Coriolis force, and gravity. Today we are writing the robot arm dynamics model.
We add it to robot.py. The parameter function combines the load at the end of the arm with the second link, mass increases, the center of mass shifts to the end, and its inertia is recalculated. This is how we will later simulate a robot lifting an object. The dynamics function generates three components of the motion equation derived from Lagrange.
The inertia matrix M, which depends on the elbow angle, the Coriolis and centrifugal vector C, which appears when the arm rotates, and the gravity vector G. The equation is M multiplied by angular acceleration equals torque minus C minus G. The step function solves the acceleration with a linear system of equations and integrates it with Runge Kutta of order 4. Create a test file underscore dynamics dot py.
The energy function calculates the kinetic energy as half the transpose of mdki multiplied by mdki, plus the potential energy. Run. At zero angle, the inertia matrix is 1,333, 0,417, and 0,167. To hold the arm horizontally, the first joint motor must provide 19,62 Nm, and with a 1,5 kg load, it increases to 34,34 Nm. When the arm is released without torque, the energy change is only about 1,10 million J during 3 seconds.
Let's see the graph. Both joints swing with complex and non-periodic motion, a characteristic of a chaotic double pendulum system. With a load, the pendulum behaves differently because the inertia and center of mass change. The right graph shows the change in energy remaining zero until the millionth scale, proving the equation and its integration are correct.
Done. We have modeled the robot arm dynamics using the Lagrange equation, adding a load at the end of the arm, simulating with runge kutta, and validating it with energy conservation. In the next episode, we will control it with PID and Competitor. Currently working on a thesis, dissertation, or research in the field of robotics and reinforcement learning? Cerdas Inovasi Digital helps with robot control implementation from manipulator kinematics and dynamics, PID and Competitor, gym environment, up to soft actor critic agent training, and also opens Python programming courses for electrical and mechatronic engineering. Want to master the entire series, from robot arm kinematics to adaptive reinforcement learning agent testing? All 6 episodes, complete with PDF step-by-step guides and source code, are available to premium tutorial subscribers. Subscribe starting at 69 thousand rupiah per month, save 28 percent with the 12-month package, or one-time pay 999 thousand for lifetime access. Want just one class? Buy the single class with lifetime access. Subscribe now on the premium page cerdasinovasidigital.com. Contact us via WhatsApp or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode. Thank you for watching,
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →