Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

PID + PID Tuning Utility #35

Open
IhorNehrutsa opened this issue Jun 24, 2021 · 9 comments
Open

PID + PID Tuning Utility #35

IhorNehrutsa opened this issue Jun 24, 2021 · 9 comments
Labels
new feature New feature or request

Comments

@IhorNehrutsa
Copy link

I propose to move out the PID controller from the StepperMotor class to separate class and files.
The PID controller is not a property/characteristic/attribute of a motor.
This simplifies the StepperMotor class and allows to use of a third party PID library.

It may be
https://github.com/br3ttb/Arduino-PID-Library
with detailed explanation here
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

There is also a PID auto-tuning library
https://github.com/br3ttb/Arduino-PID-AutoTune-Library

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 24, 2021

I started working on this, but I wasn't able to finish it today. I'll publish the commit within the next couple of days.

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 24, 2021

52c3023 makes PID its own class. I haven't implemented it yet, but that will be soon. My plan is to use the PID loop to control the update time for an interrupt timer. Thoughts on that or any of the commits so far?

@CAP1Sup CAP1Sup added the new feature New feature or request label Jun 28, 2021
@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 29, 2021

I'm getting close to getting PID fully working, I should finish it tomorrow or Wednesday if everything goes smoothly. Autotuning will come later, but at least you'll be able to use the basic manual tuning.

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 30, 2021

I'm just going to move everything to the SimpleFOC library. I'm going to create a separate branch for it, so make sure that you work on that branch if you wanted to make any changes (it turns into a nightmare) and PR the SimpleFOC branch

@xerootg
Copy link

xerootg commented Jun 30, 2021 via email

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 30, 2021

@xerootg that would be terrific! Could you pull the latest commits on the SimpleFOC branch, then create a pull request on it? That would allow me to work with you to bring the functionality to the Intellistep. It would certainly be interesting to have it.

@IhorNehrutsa let me know, I'll give you perms to review PRs, that way we can all work on it

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jun 30, 2021

@xerootg is the motor quieter with SimpleFOC? I'm curious as to if it's just better to look at the SimpleFOC code and steal reference their code. I think that my PID implementation is on the horizon of working, so it might actually just be better to stick with what we have already and adapt some of the code

@xerootg
Copy link

xerootg commented Jul 1, 2021

I wouldn't say that I have tuned the driver very well, as I wrote just enough code to make it spin. It needs some tuning in regards to base frequency and I haven't quite wrapped my head around their model for duty cycle in relation to torque.

@CAP1Sup
Copy link
Owner

CAP1Sup commented Jul 6, 2021

@IhorNehrutsa commit 8396fe7 implements custom PID. It's really fast and I had a good amount of success with it. Those values should get you started, although I won't pretend that I know what I'm doing. I also added the start of the Python tuning utility.

@CAP1Sup CAP1Sup changed the title PID PID + PID Tuning Utility Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants