We use cookies to provide our visitors with an optimal site experience. View our privacy notice and cookie notice to learn more about how we use cookies and how to manage your settings. By proceeding on our website you consent to the use of cookies.
Despite a detailed Google site (Home), I couldn’t run the setup as per the above YouTube video.
While I can run the demo program of the self-sustained inverted pendulum using the binary file, the individual values of PID variables, as shown in the video, do not work.
Dear Ryan, Thank you for your reply. Just to let you know, I got three of these setups for my control laboratory. The first one I tried, the demo ran successfully. However, the Arduino IDE and Python Jupyter notebook programs from Github ( GitHub - ShawnHymel/pendulum-pid ) do not seem to work in my case. The rest two tested by my students, (they couldn’t even run the demo!). Hoping to solve this issue this year.
Reading your posts, I’m still not exactly clear on what code you are running and what’s not working.
What binary file?
By this do you mean the exact gain values Shawn arrived at in the video (K_P = 0.3, K_I = 0.005, K_D = 1) don’t work. Or do you mean that the default values in the GitHub repository (K_P = 1, K_I = 0.005, K_D = 0.000) don’t work. Also, what exactly do you mean by “do not work”. Do you mean that the system is unstable? If so, have you tried going through the tuning procedure?
What demo?
Again, what exactly isn’t working?
Again, what demo? And what do you mean by “they couldn’t even run the demo”? What issues were they experiencing?
Dear Matt, Thank you for your reply. Apologies for not being to the point. Here I am providing all the details.
What binary file? The binary file titled “STM32F401RE-Nucleo_V3.0.bin” available at this link
PID values: I do not mean the exact gain values Shawn arrived at in the video, as they can change from one product to another; they have to be tuned. However, I cannot go through the tuning process as something is stopping me from running the program. This “Something” refers to random errors in the program that occur during running/compiling. I will identify the specific errors once I return to the setup and attempt to run the program. As I understand, the Arduino IDE is used for getting the values from the encoder, and the Python program is used for deciding the required control. The control information is then sent to the Arduino program that controls the stepper motor. Is this correct?
What demo? The binary file is a demo file. This runs using STM32 Cube Programmer software. The video of how demo works is available at this link: https://www.youtube.com/watch?v=L4WKp5diTko
What exactly isn’t working? I will get back to you with specific errors.
“They couldn’t even run the demo”: (a) the second kit, when the demo run, the motor rotates only in one direction, leading to encoder wire tightening and evantually manually stopping the setup. (b) The third kit, the demo starts fine but as soon as the inverted position achieved, the control kicks in and the system becomes unstable.
I will come with more details soon. Thank you for your support.
Thank you much for the additional details! They’re very helpful and clear things up quite a bit for me.
Sounds spot-on to me. The Nucleo board is basically just a custom hardware interface for the Python code. Implementing the PID control in Python allows one to easily make adjustments to the gain values as well as create some nice plots to inform the tuning process. Once tuned, it would be relatively straightforward to port the controller functionality to the Nucleo board as a next step, allowing it to run standalone without Python.
While I wait for more information about these errors, I’ll highlight the following from Shawn’s GitHub page:
OK, this is where I was getting confused. Shawn’s project and the UCLA demo are two totally separate projects. Shawn’s is simple, straightforward, and great for those getting started. The UCLA material is much more advanced and involved. We’ll help you with what we can when you get back to us with those error details.