View Single Post
Old 06-13-2018, 06:18 AM   #3265 (permalink)
arber333
EcoModding Lurker
 
Join Date: Jul 2011
Location: Slovenia
Posts: 70
Thanks: 0
Thanked 20 Times in 13 Posts
Quote:
Originally Posted by MPaulHolmes View Post
The PI ratio was just a variable that was there for when the "auto" PI test was running. It gave a starting point for how to check a bunch of values. So, if you had the PI ratio be 100, the "run-pi-test" would do:
Kp = 100
Ki =1

Kp = 200
Ki = 2
.....

but it doesn't come into play when you are independently setting Kp and Ki. So, let's say you did this:

pi-ratio 50
kp 1000
ki 10

the variable named "pi-ratio" would still be 50, even though now Kp / Ki = 100.

The rotor time constant can vary a lot from one motor to another. The motor will run horribly if you are way off. It will run OK if you are a little off, and it will run the best if it's perfect. The "run-rotor-test" only works on an unloaded motor. I"ve only ever tested it on a bench with no transmission. If a transmission is hooked up, you man need to change the default commanded Id and Iq in the rotor test function "RunRotorTest" from
IdRefRef = 300
IqRefRef = 300
To something bigger. Those numbers just worked OK for me on a bench with a unloaded motor at maybe 60v or whatever it was I was using for the test.

If you can't get the run-rotor-test to work, you can just try guesses from 5 up to 150 (5mS up to 150mS for the rotor time constant):

rotor-time-constant 5
rotor-time-constant 6
...
rotor-time-constant 150


and see what gives the best acceleration.

Arber, does your ABZ encoder have a single index pulse per mechanical revolution, or is it 4 per mechanical revolution? That's the only difference from motor type 2 to motor type 3. One possibility is your encoder doesn't like one of the settings below:

I would try changing "DFLTCONbits.IMV = 0b00;" to
"DFLTCONbits.IMV = 0b01;", or DFLTCONbits.IMV = 0b10;, or DFLTCONbits.IMV = 0b11;
Those are the possible required states of A and B, when the index pulse happens, and I don't know what state A and B are in when the index pulse happens on your encoder, so you would just have to try them all. This is why companies pick a specific motor and specific position sensor and just make a specific controller for it. Everybody has their own standards.
Sorry i totaly missed your post there....
You just explained everything to me! My encoder has chip generated signal obtained from rotated magnet. That means signal is basicaly generic encoder AB phase shift with single pulse per circle. All signals are square weaves and at least 90deg of square is overlapped by next signal. Z signal is 1/4 of AB signal period, so is quite short pulse at the rising edge of A and falling edge of B.

This was the reason that Leaf motor wasnt willing even to start turning in mode 3. It just shook there and i could hear amps straining until inverter block was overheating.
In mode 2 it was turning good, but if i used U higher than 200V everything started downhill....

A
Attached Thumbnails
Click image for larger version

Name:	ABZ.jpg
Views:	88
Size:	32.0 KB
ID:	24385  
  Reply With Quote