'PI controllers for 4 motors in a Raspberry Pi 4
I am trying to create a code for a Raspberry Pi4 where I want to control 4 motors (there is not a limited lenguage it could be Python, C or C++ code as long as it works) . I already did the simulation in Simulink with a cascade Pi controllers (3 Pi controllers for control the location and 4 Pi controllers for each motor - I attached an image to be more clear) and the simulation works already good; however, I am not sure how to do it into the Raspberry Pi.
The main idea is that the little car has to move to different given coordinates (X, Y and Z coordinates, but Z is always 0) controlling the positon and the velocities from each motor. My understanding is only to code the Outer PI, Inner PI and the Bi(teta) (see the images I attached) because the motor model, the dynamic model and the kinematic model is done with the robot mobil, so it does not have to be code. In the case of the reference they have to be given in a data sheet (e.g excel file).
The motor driver I am using is two L298N (1 per 2 motors).
Here is the image of the simulation with the cascade P - (https://i.stack.imgur.com/XDrFo.jpg)
Here is the image of the Bi(theta) matrix - (https://i.stack.imgur.com/iMJNU.jpg)
I have never done something like this, if someone can give me a hint or explain me how it can be done I would really appreciate it!!
I hope my explanaition was good enough but if not feel free to ask for a better clarification.
Thanks in advance an have a great day!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
