When I first encountered PID, I struggled to understand how gains affect the system. Usually, I used to vary gains randomly, which never provided good results. If you have similar problems, this video is for you. After completing this video, you will understand PID gains better. You will be able to tune PID in a few steps. The code is available on: www.steppeschool.com/products/communities/steppeschool-miscellaneous www.patreon.com/user?u=80399744
@lamnhatoan99448 ай бұрын
Great explanation!
@hamidkavianathar740511 ай бұрын
Thanks for teaching. it was great. I would like to ask you a question, could you tell me how often do you run PID controller function?
@steppeschool362911 ай бұрын
Hi, I run every 1 ms. In other words, at 1 kHz frequency.
@hamidkavianathar740511 ай бұрын
Thank you so much @@steppeschool3629
@mohsenzadeh_de2 жыл бұрын
You teach very well.🌸 Please prepare a sample project for the MODBUS-RTU network.
@steppeschool36292 жыл бұрын
Thanks a lot! Noted👌
@AbhishekKanti Жыл бұрын
Nice! I am building a self balancing robot using a BO gear dc motor, l298n motor driver, arduino uno and mpu6050. I am stuck in a part. I dont know how to convert the output of the pid controller into pwm value of 0 to 255. It would be great if you could help me with this.
@steppeschool3629 Жыл бұрын
Hello, I personally do not use Arduino on my projects, but what you can do is scale the output of the PID to fit the PWM value range. For that, you can identify scale gain by dividing the maximum of the PWM range(in your case, 255) by the maximum value of the PID output (you have to identify it). Then, when the PWM duty cycle value is needed, you multiply this gain by the output of the PID to obtain the PWM duty cycle value.
@AbhishekKanti Жыл бұрын
@@steppeschool3629 thanks man for your reply. This is the main problem I am facing that how to find the maximum value of PID . I am not getting this on KZbin or the internet.
@steppeschool3629 Жыл бұрын
As I showed here kzbin.info/www/bejne/f6DEZ5uXnrupm6c You have to set a maximum value for the PID output and I-gain output. You can identify these values manually. Once you set them, defining the scale to get the PWM value will be straightforward.
@AbhishekKanti Жыл бұрын
@@steppeschool3629 In the given video how did you find your max pid value?
@steppeschool3629 Жыл бұрын
I thought you had already tuned PID and are looking for how to scale the PID output to the PWM duty cycle value. In that case, start with P-gain. Slowly increase the P-gain, and manually tilt your robot(maybe 10-15 degrees). At some point, it should oscillate. You can use that value for setting the max PID value(maybe 3 times this value might be the max value). Then, you can tune other gains, as pointed out in the video. There are no standard rules. You can manually try different values to find the best value for your case.
@jugnu361 Жыл бұрын
🙏🙏🙏
@lohikarhu7347 ай бұрын
I figured that diff gain also increases response speed to perturbations of the motor speed, so that it may be possible to reduce the P gain... In your demo, it seems that you are showing the response from an uncontrolled state to a controlled state, rather than response to a perturbation of the load? Or? But, I'm just some old guy, who never did learn the mathematics part, more of a "hands-on" and conceptual driver.... 😀
@rajdeepdas86 Жыл бұрын
Must enable SWV trace in the debugger settings first