back to pid
seems like I am going around in circles. As I cannot get a good result with hysteresis, I will try again with PID. Here is the image with kp = 0.1 and ki = 1. Current is averaged over 20 samples at a sample time of 1e-5. Main sample time is 4e-5 to correspond with a PWM period of 3000.

this is much weaker than when originally tuning the PID controller. I should be able to repeat the old result by reducing the averaging to 1.
DISREGARD THE PREVIOUS IMAGE. I HAD IT CONNECTED IN A THREE WIRE CONFIG RATHER THAN A 6 WIRE CONFIG.
here is the image with no averaging:

and with averaging of 20.

with a load on:

I THINK THAT I SHOULD BE USING A LOAD FOR ALL MY MEASUREMENTS.
try to remove the ki and use kp = 0.1
dnw
kp = 1
dnw
kp = 10

kp = 5

kp = 3
kp = 1.5
dnw
guess that kp is around add ki = 1

with kp = 1 and ki = 1:

this is really ugly and draws lots of current.
kp = 0.1 and ki = 1 seems pretty good still - work towards that
kp = .5 ki = 1

maybe it is oscillating due to the ki - try:
kp = 0.5 ki = .5

getting worse keep ki at 1 and lower kp to 0.25

a bit better but now I remember that kp = 0.1 and ki = 1 was oscillatory so I should be going for less than that
try kp = 0.1 and ki = 0.5

looks okay try to add kd = 1

does not look much different - try kd = 10

does not look much better and has induced some noise... remove Kd
maybe try to reduce the average width to 10

looks a bit better - try to go to average width of 4 (equate with one pwm width)

looks worse - 10 looks like a good number but I would really like to have it over an integer number of PWM cycles - try 8

okay - try 12

okay but still oscillatory - need to reduce ki and kp
try kp = 0.05 ki = 0.5

a bit slow - try kp = 0.1, ki = 0.3

still a bit slow - 0.1 and 0.5 seems to be the best that I can do for the moment
I may need to add som integral saturatino control
try kic = 1

gone more oscillatory try kic = 0.5

0 Comments:
Post a Comment
<< Home