Closed loop speed control

5 years 4 months ago #29530604 by intolubbe
I have an Astroflight 3220 motor (8 pole) with a US Digital EC-35 encoder that combines commutation and encoder (2000ppr). Open loop is fine and the encoder speed tracks what the motor is doing (Hall speed is 1/2 of actual speed). I can't get closed loop speed to work. If I put in KI=1 and give the motor any G command that makes it move it runs away to the max rpm (2000). The only way to stop that from happening is to put the ICAP in single digits, but I still don't get accurate speed control. It doesn't hunt around or anything, it just won't go the speed it supposed to. I'm using my old HBL1650 with current firmware, but I plan on using my new MBL1660s. I have a model boat with 3 water jets that I need to run matched at various rpms.

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530605 by TechSupport
The counter should count positive when going in the forward direction. Swap your A and B channels.

Please Log in or Create an account to join the conversation.

5 years 4 months ago - 5 years 4 months ago #29530616 by intolubbe
Replied by intolubbe on topic Closed loop speed control
I did find a commutator problem; the ?BS was the opposite sign from ?S. Negative ?BS for a positive !G command. That is fixed now and all the signs are correct, but the closed loop control still runs away with KP 0, KI 1, and KD 0. The ?BS speed is half the ?S speed. It is an 8 pole motor because I ordered an 8 pole EC35 commutator kit and everything matches up on the scope.

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530618 by TechSupport
It is 4 pole pairs or -4 pole pairs if the brushless is reading incorrect sign readings.

Make sure that your feedback is set to "other" since you are going by encoder use.

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530621 by intolubbe
Replied by intolubbe on topic Closed loop speed control
BLFB is set to 1

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530632 by intolubbe
Replied by intolubbe on topic Closed loop speed control
I've been poking around and found the ?E query (I generally don't use Roborun+). The only way I can get closed loop to be stable is to set KP at 3 or 4, which I guess is .03 and .04. Anyway, if I set !G to 250 i get ?M=500 and ?E=500. I am in closed loop and it doesn't matter if I have feedback set to hall or encoder. ?F is alway 0 whether I'm using hall or encoder feedback. If I set !G to 125 then M and E go to 250. It appears that the controller isn't seeing the feedback, even though ?S reports the correct RPM.

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530633 by TechSupport
In speed mode for going to a specific speed, use !S instead of !G.

!S 500 will go to speed 500RPM's.

Please Log in or Create an account to join the conversation.

5 years 4 months ago #29530634 by intolubbe
Replied by intolubbe on topic Closed loop speed control
That's nice to know, but doesn't answer my question; why does it appear that the encoders are working but the closed loop error is equal to the commanded rpm? The actual error is less than 100.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.158 seconds