yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
DOFBOT-JetsonNANO📖
00.Must Read Before Use!!
  • 00.Must Read Before Use!!
01.First Trial
  • 1.First Trial
  • 2.Analysis of common problems
  • 3.Calibration offset
  • 4.Precautions for DIY Robotic Arm
  • 5.Jetson Nano Version – Must Read
  • 6.Robotic arm gripping anomaly solutions
02.Assemble Course
  • 1.Installation video
  • 2.Calibrate the Robotic Arm
  • 3.Install the map
03.Remote control course
  • 1.Mobile APP control
  • 2.USB handle control
  • 3.PC web page programming
04.Preparation
  • 1.Manage APP control service
  • 2.Manage JupyterLab service
  • 3.Manage OLED service
  • 4.Modifying ROS_DOMAIN_ID for Multi-Machine
  • 5.Jetpack old system upgraded to SUPER system
05.Basic control course
  • 1.Control RGB light
  • 2.Control buzzer
  • 3.Control single servo
  • 4.Read servo angle
  • 5.Control all servo
  • 6.DOFBOT up down left right
  • 7.DOFBOT dancing
  • 8.DOFBOT memory action
  • 9.DOFBOT grab block
  • 10.Porter
  • 11.Stacked Arhat
  • 12.Synchronous action
  • 13.USB camera display
06.AI vision basic course
  • 1.Gesture Recognition
  • 2.Color threshold adjustment&Color calibration
  • 3.Color recognition
  • 4.Face recognition
  • 5.YOLOv11 garbage recognition
  • 6.YOLOv11 object recognition
07.2D Visual Tracking Course
  • 1.PID algorithm basics
  • 2.Color block positioning
  • 3.Color block tracking
  • 4.Face positioning
  • 5.Face tracking
  • 6.Gesture recognition fixed action
08.2D Visual Grasping Course
  • 1.Gesture recognition stack blocks
  • 2.Color recognition grab blocks
  • 3.Catch game
  • 4.Color sorting and stacking
  • 5.Garbage sorting
  • 6.Color interaction
09.Mediapipe course
  • 1.Hand detection
  • 02.Posture detection
  • 3.Overall detection
  • 4.Facial Detection
  • 5.Face Detection
  • 6.Face effects
  • 7.3D object recognition
  • 8.Paintbrush
  • 9.Finger control
  • 10.Gesture Recognition
  • 11.Gesture control robotic arm action group
  • 12.Arm posture control robotic arm
  • 13.Palm Targeting
  • 14.Robotic arm tracks the palm
  • 15.Fingertip trajectory recognition
  • 16.Fingertip trajectory control robotic arm
  • 17.Gesture Grasp and Release Objects
  • 18.Finger Control Robot Arm
10.AI Large Model Voice Module (Must Read)new
  • 1. Introduction to AI Large Model Voice Module
  • 2. Flash the firmware (Must read)
  • 3. Modify the wake-up word and command word
11.2D Voice Control Coursenew
  • 01.Simple Voice Control
  • 02.Smart Voice Control
  • 03.Voice Action Control
  • 04.Memory Learning Mode
  • 05.Color Recognition with Voice Broadcast
  • 06.Color Recognition and Grasping with Voice Broadcast
  • 07.Color Recognition and Sorting with Voice Broadcast
  • 08.Voice Recognition Target Tracking
  • 09.Voice Control Stacking
  • 10.Voice Control Color Sorting and Stacking
  • 11.Garbage Recognition with Voice Broadcast
  • 12.Garbage Sorting with Voice Broadcast
12.Robotic Arm Control and Inverse Kinematics
  • 1. Robotic arm ROS control
  • 2. Inverse solution
13.3D Sorting and Grasping Coursenew
  • 1.AprilTag ID sorting
  • 2.MediaPipe Gesture-AprilTag ID sorting
  • 3.MediaPipe Gesture-AprilTag distance sorting
  • 4.Block color sorting
  • 5.Block different shape sorting
  • 6.Yolov11 garbage sorting
14.3D Tracking Coursenew
  • 1.AprilTag Tracking
  • 2.Color Block Tracking
  • 3.KCF Object Tracking
15.3D Voice Control for Sorting & Tracking Coursenew
  • 1.Voice Control AprilTag ID Sorting
  • 2.Voice Control Color Block Sorting
  • 3.Voice Control Yolov11 Garbage Recognition Sorting
  • 4.Voice Control AprilTag Tracking
  • 5.Voice Control Color Block Tracking
  • 6.Voice Control Object Tracking
16.AI Model Basicsnew
  • 1.AI large model types and principles
  • 2.RAG retrieval enhancement and model training samples
  • 3.Embodied intelligent robot system architecture
  • 4.Embodied intelligent functions core source code
17.AI Model Developmentnew
  • 1.Register a model service provider account
  • 2. Configure API-KEY
  • 3. Introduction to Dify
  • 4. Basic Dify Features
  • 5. Deploy the RAG knowledge base
  • 6. AI Large Model Development - chatbot
  • 7. RAG knowledge base + chatbot
  • 8. AI agent workflow
18.AI Model – Text Versionnew
  • 1. Semantic understand instruction following
  • 2. Multimodal visual understand
  • 3. Text Large Model + robotic arm control
  • 4. Multimodal Large Model+video understanding
  • 5. Multimodal Large Model+robotic arm gripping
  • 6. Multimodal Large Model+robotic arm tracking
  • 7. Multimodal Large Model+robotic arm sorting
  • 8. Multimodal Large Model+robotic arm handling
  • 9. Multimodal Large Model+Color Blocks Back In Place
  • 10. Multimodal Large Model + Intent Prediction + Robotic Arm Gripping
  • 11. Text Large Model + YOLOv11 + Intelligent Garbage Classification
19.AI Model – Voice Versionnew
  • 1. Semantic understand instruction following
  • 2. Multimodal visual understand
  • 3. Text Large Model + robotic arm control
  • 4. Multimodal Large Model+video understanding
  • 5. Multimodal Large Model+robotic arm gripping
  • 6. Multimodal Large Model+robotic arm tracking
  • 7. Multimodal Large Model+robotic arm sorting
  • 8. Multimodal Large Model+robotic arm handling
  • 9. Multimodal Large Model+Color Blocks Back In Place
  • 10. Multimodal Large Model + Intent Prediction + Robotic Arm Gripping
  • 11. Text Large Model + YOLOv11 + Intelligent Garbage Classification
20.AI Model – Fun Applicationsnew
  • 1.AI Butler-Intent Inference
  • 2.AI Encyclopedia-Arithmetic Master
  • 3.AI Encyclopedia-You asked I Pointed
  • 4.AI Encyclopedia-Nutritional Analysis
  • 5.AI Encyclopedia-Problem Solving Expert
  • 6.AI Encyclopedia-English Spelling
  • 7.AI Butler-Garbage Sorting
  • 8.AI Top Chef
21.MoveIt2 Course
  • 1.MoveIt configuration
  • 2. MoveIt Usage
  • 3. MoveIt Drive Real Robot
  • 4. MoveIt Random Movement
  • 5. MoveIt Forward Kinematics Design
  • 6. MoveIt Inverse Kinematics Design
  • 7. MoveIt Cartesian Path
  • 8. MoveIt Scene Design
  • 9. MoveIt Trajectory Planning
  • 10. MoveIt Collision Detection
22.YOLOv11 Development Course
  • 1. YOLO Environment Setup
  • 2. CLI Usage
  • 3. Object Detection
  • 4. Instance Segmentation
  • 5. Pose Estimation
  • 6. Image Classification
  • 7. Oriented Bounding Boxes Object Detection
  • 8. Model Conversion
  • 9. Model Prediction
23.Linux Operating System
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Capacity expansion and resource allocation
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
24.GPIO Hardware Control Course
  • 1.GPIO description
  • 2.GPIO library installation
  • 3.GPIO reading
  • 4.GPIO output
  • 5.Serial communication
  • 6.I2C communication
25.OpenCV course
  • 0. Must Read!
  • 1. Introduction to Open Source CV
  • 2. Image reading and display
  • 3. Image writing
  • 4. Image quality
  • 5. Pixel Operation
  • 6.Image zoom
  • 7.Picture cut
  • 8.Picture pan
  • 9.Picture mirroring
  • 10.Affine transformation
  • 11.Picture rotation
  • 12.perspective transformation
  • 13.Grayscale processing
  • 14.Binary image
  • 15.Edge green detection
  • 16.Line segment drawing
  • 17.Rectangular circle drawing
  • 18.Text and picture drawing
26.ROS2 Basic Course
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
27. Advanced Visuals Course
  • 0. Must Read! Porting and Compilation
  • 1. QR Code
  • 2. Human Pose Estimation
  • 3. Object Detection
  • 4. AR Vision
  • 5. ROS + OpenCV Basics
28.Jupyter Lab Usage Course
  • 0.Read the document before operation
  • 1.Jupyter Lab environment construction
  • 2.Basic use of Jupyter Lab
  • 3.Jupyter Lab plug-in installation
  • 4.Basic use of Jupyter Widgets
29.Docker Course
  • 1.Docker overview and docker installation
  • 2.Common commands for docker image containers
  • 3.Docker images deeply understand and publish images
  • 4.Docker hardware interaction and data processing
  • 5.Start the Dofbot container
30.Python Programming Basics
  • 1.Python usage
  • 2.Use APT to install Python packages
  • 3.Python virtual environment
  • 4.GPIO Zero
  • 5.Pin output high and low levels
  • 6.Pin reads high and low levels
  • 7.Pin output PWM
Download
  • APP(iOS/Android)
  • Code
  • SystemFile
  • VM File
  • PC software
  • Instruction manual
  • Jetson_Boot_USB.tar.gz
  • More Annex
  • Tools
Download ZIP
FAQ
  • 1、Precautions for DIY Robotic Arm
  • 2、Why i can't robotic arm start normally
  • 3、When you control the No.1 servo, all servos will turn.
  • 4、How open VNC service on DOFBOT system
  • 5、Where can I get the URDF file?
  • 6、Gesture recognition cannot work normally.
  • 7、Write system image into U disk
  • 8、Write EMMC boot file

Welcome to DOFBOT-JetsonNANO repository

1.PID algorithm basics

1.PID algorithm basics

1.1 Introduction

PID is to perform proportional integral differential operation on the input deviation, and the superposition result of the operation is used to control the actuator. The formula is as follows:

It consists of three parts:

  • P is the proportion, which is the input deviation multiplied by a coefficient;
  • I is the integral, which is the integral operation of the input deviation;
  • D is differentiation, which performs differential operations on the input deviation.

As shown below is a basic PID controller:

(1) Proportional part

The mathematical expression of the proportional part is: Kp*e(t)

In an analog PID controller, the role of the proportional link is to react instantaneously to deviations. Once the deviation occurs, the controller immediately takes control to change the control quantity in the direction of reducing the deviation. The strength of the control effect depends on the proportional coefficient,The larger the proportional coefficient, the stronger the control effect, the faster the transition process, and the smaller the static deviation of the control process;But the larger it is, the easier it is to produce oscillations and destroy the stability of the system. Therefore, the sample coefficient must be selected appropriately to achieve a short transition time, small static difference and stable effect.

Advantages: Adjust the open-loop proportional coefficient of the system, improve the steady-state accuracy of the system, reduce the inertia of the system, and speed up the response speed.

Disadvantages: Using only P controller, an excessively large open-loop proportional coefficient will not only increase the overshoot of the system, but also make the system stability margin smaller and even unstable.

(2) Points part

The mathematical expression of the integral part is:

The larger the integral constant, the weaker the accumulation effect of the integral, and the system will not oscillate during the transition; However, increasing the integral constant will slow down the static error elimination process, and the time required to eliminate the deviation is also longer, but it can reduce overshoot and improve the stability of the system. When Ti is small, the integral effect is strong. At this time, oscillation may occur in the system transition time, but the time required to eliminate the deviation is shorter. Therefore, Ti must be determined according to the specific requirements of actual control.

Advantages: Eliminate steady-state errors.

Disadvantages: The addition of the integral controller will affect the stability of the system and reduce the stability margin of the system.

(3) Differential part

The mathematical expression of the differential part is:

The function of the differential link is to prevent the change of deviation. It is controlled based on the change trend (change speed) of the deviation. The faster the deviation changes, the larger the output of the differential controller is and the correction can be made before the deviation becomes larger. The introduction of differential action will help reduce overshoot, overcome oscillation, and stabilize the system. It is especially beneficial to high-order systems because it speeds up the tracking speed of the system. However, the effect of differential is very sensitive to the noise of the input signal. For systems with larger noise, differential is generally not used, or the input signal is filtered before differential takes effect. The role of the differential part is determined by the differential time constant Td. The larger the Td, the stronger its effect in suppressing deviation changes; the smaller the Td, the weaker its effect in resisting deviation changes. The differential part obviously plays a big role in the stability of the system. Appropriate selection of the differential constant Td can optimize the differential effect.

Advantages: It makes the response speed of the system faster, reduces overshoot, alleviates oscillation, and has a "predictive" effect on the dynamic process.

1.2 Selection of PID algorithm

Digital PID control algorithms can be divided into positional PID and incremental PID control algorithms. So before we decide which PID algorithm to use, we should first understand its principles:

  • Positional PID algorithm:

e(k): User-set value (target value) - the current status value of the control object

Proportion P : e(k)

Integral I : ∑e(i) Accumulation of errors

Differential D : e(k) - e(k-1) this time error - last time error

That is, positional PID is the actual position of the current system, and the deviation from the expected position you want to achieve is used for PID control.

Because there is an error integral ∑e(i), which is always accumulated, that is, the current output u(k) is related to all past states, and the accumulated value of the error is used;(The error e will be accumulated), the output u(k) corresponds to the actual position of the actuator,Once the control output goes wrong (there is a problem with the current state value of the control object), a large change in u(k) will cause a large change in the system. When the positional PID reaches saturation in the integral term, the error will still continue to accumulate under the action of the integral.Once the error starts to change in the opposite direction, the system needs a certain amount of time to exit the saturation zone, so when u(k) reaches the maximum and minimum, the integral function must be stopped,And there must be integral limiting and output limiting, so when using positional PID, generally we use PD control directly and positional PID is suitable for objects whose actuators do not have integral components. Such as steering gear and balance car upright and temperature control system control

Advantages: Positional PID is a non-recursive algorithm that can directly control the actuator (such as a balancing car).The value of u(k) has a one-to-one correspondence with the actual position of the actuator (such as the current angle of the car), so it can be used well in objects where the actuator does not have an integral component.

Disadvantages: Each output is related to the past state. When calculating, e(k) needs to be accumulated, which requires a large amount of calculation work.

  • Incremental PID:

Proportion P: e(k)-e(k-1) error this time - error last time

Integral I: e(k) error

Differential D: e(k)-2e(k-1)+e(k-2)this time error-2*last error+last time error

Incremental PID can be well seen from the formula. Once KP, TI and TD are determined, as long as the deviation of the three measured values before and after is used,That is, the control amount $Delta u(k)$ obtained by calculating the control increment from the formula corresponds to the increment of the position error in recent times,Instead of corresponding to the deviation from the actual position, there is no error accumulation. That is to say, there is no need for accumulation in incremental PID.The determination of the control increment $Delta u(k)$ is only related to the latest three sampling values. It is easy to obtain better control effects through weighted processing, and when a problem occurs in the system, the incremental method will not seriously affect the work of the system.

Summary: Incremental PID is an increment to positional PID.At this time, the controller outputs the difference between the position values calculated at two adjacent sampling moments. The result is an increment, that is, the control amount needs to be increased (negative value means decrease) based on the last control amount.

Advantages: ① The impact of malfunction is small. If necessary, the erroneous data can be removed by logical judgment.

②The impact is small when switching between manual and automatic, making it easy to achieve disturbance-free switching. When the computer fails, the original value can still be maintained.

③ No accumulation is required in the calculation formula. The determination of the control increment Δu(k) is only related to the latest three sampling values.

Disadvantages: ① The integral truncation effect is large and there is a steady-state error;

②The impact of overflow is large. It is not good to use incremental method for some controlled objects;

  • Difference between incremental and positional

(1) The incremental algorithm does not require accumulation. The determination of the increment of the control volume is only related to the recent deviation sampling values. The calculation error has a small impact on the calculation of the control volume. The positional algorithm uses the accumulated value of past deviations, which is prone to large accumulated errors.

(2) The incremental algorithm obtains the increment of the control amount. For example, in valve control, only the change in valve opening is output, and the impact of malfunction is small. If necessary, logical judgment can be used to limit or prohibit this time. The output will not seriously affect the work of the system. The positional output directly corresponds to the output of the object, so it has a greater impact on the system.

(3) The incremental PID control output is an increment of the control amount and has no integral effect. Therefore, this method is suitable for objects with integral components in the actuator, such as stepper motors, etc., while the positional PID is suitable for objects with no integral components in the actuator. Objects with integral components, such as electro-hydraulic servo valves.

(4) When performing PID control, positional PID requires integral limiting and output limiting, while incremental PID only needs to output limiting. Positional PID and incremental PID are just two implementations of digital PID control algorithms. Just the form, the essence is exactly the same. The main difference is that the integral items are stored in different ways. The positional PID integral items are stored separately, while the incremental PID integral items are stored as part of the output. Various players on the Internet also have their own unique insights and opinions on the use of positional and incremental PIDs. The specific opinion depends on which algorithm is suitable for our specific application scenarios.

1.3 Debugging PID parameters

There are many methods for selecting parameters of PID controller, such as trial and error method, critical proportional method, extended critical proportional method, etc. However, for PID control, parameter selection is always a very complicated task, and continuous adjustments are required to obtain a more satisfactory control effect. Based on experience, the general steps for determining PID parameters are as follows:

  • Determine proportional coefficient Kp

When determining the proportional coefficient Kp, first remove the integral term and differential term of the PID, you can set Ti=0, Td=0, making it

Pure proportional adjustment. The input is set to 60% to 70% of the maximum allowable output of the system. The proportional coefficient Kp gradually increases from 0 until the system oscillates; conversely, the proportional coefficient Kp gradually decreases from this time until the system oscillation disappears. Record the proportional coefficient Kp at this time, and set the PID proportional coefficient Kp to 60% to 70% of the current value.

  • Determine the integration time constant Ti

    After the proportional coefficient Kp is determined, set a larger integration time constant Ti, then gradually reduce Ti until the system oscillates, and then in turn, gradually increase Ti until the system oscillation disappears. Record the Ti at this time, and set the PID integration time constant Ti to 150% to 180% of the current value.

  • Determine the differential time constant Td

    The differential time constant Td generally does not need to be set, it can be 0. At this time, PID adjustment is converted into PI adjustment. If it needs to be set, it is the same as the method for determining Kp, taking 30% of its value when there is no oscillation.

Of course, this is just my personal debugging method, and may not be suitable for everyone and every environment. It is only provided for your reference; however, there are also classic trial tips for debugging PID circulating on the Internet, and I also posted them for your reference:

Find the best parameter setting, and check in order from small to large.

First the proportion, then the integral, and finally the differential.

The curve oscillates frequently, and the proportional dial needs to be enlarged.

The curve floats around the big bend, and the proportion dial is turned smaller.

The curve deviates and recovers slowly, and the integration time decreases.

The curve fluctuation period is long, and the integration time will be longer.

The oscillation frequency of the curve is fast, so first reduce the differential.

If the dynamic difference is large, the fluctuation will be slow, and the differential time should be lengthened.

The ideal curve has two waves, the front is high and the back is low four to one.

One look, two adjustments and multiple analyses, the adjustment quality will not be low.

PID is a proportional (P), integral (I), and differential (D) control algorithm. It is not necessary to have these three algorithms at the same time. It can also be PD, PI, or even only P algorithm control. One of the simplest ideas I had for closed-loop control was P control, which feeds back the current result and then subtracts it from the target. If it is positive, it will slow down, and if it is negative, it will speed up. Of course, this is just the simplest closed-loop control algorithm. , that is, let’s go back to the summary of positional and incremental in the previous section. For details, we must refer to our current control environment. Because of the differences in each control system, the parameters that can allow our system to achieve the most stable effect are certainly OK. .

YOLOv11 object recognition
Color block positioning

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文