SDC2130, PID integrator component gets reset every few seconds.

7 years 2 months ago - 7 years 2 months ago #29528419 by sd1074
I've got a very tricky bug\problem here. I don't know maybe it's a hardware issue. I've been struggling with it for several days already.

After playing a lot with config parameters, at some point I noticed that in a closed-loop speed mode sometimes there is a sudden drop in power.
I used board: SDC2100 v1.4 1104
Firmware: May 25, 2013 version
I had two pads shortened on P5 to enable the firmware to work ( dev.roboteq.com/dev1/index.php/forum/10-...version?limitstart=0 )

All the pictures here are with firmware version RCB100 08/25/2011 because at last, when I ran out of possible ways to solve this problem, I decided to try to roll back to an older version of the firmware on which I did not experience this problem. I also removed the wire between P5 two pads. This didn't help.

I noticed that it's only when KI is non-zero, the problems can be observed. So I set KP and KD to zeros. Picture motor2.png attached to the post demonstrates that every few seconds loop error becomes equal to the set point (~35 in this experiment)


What is kind of interesting is that if both motors are on, those loop error peaks occur at the same time (see both_motors.png). They are like synchronized.


Then I dig a little deeper. I wrote a small script to print Error and Power on a motor (script attached: catch_the_bug.mbs). And I found out that every few seconds the power suddenly drops to zero, even though the error is still the same (see line 283 of the attached full_log.txt). This consequently results in error starting to grow, and power grows slower (see the log). This doesn't look an expected behavior from an I-controller.

My motor controller Profile.xml is attached.

Other things I tried:
- Reset to default settings: didn't help
- When KI==0 there is no drops. Controller is stable.
- With some configurations I noticed there the problem was observed only when an external resistance force was applied to the motor

Please help.
Attachments:

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

7 years 2 months ago #29528420 by Griffin Baker
The attached files aren't showing up. I think the reason more or less is that they have to be in a zipped folder.
If you'd like go ahead and send us an email with your files to This email address is being protected from spambots. You need JavaScript enabled to view it.

Also in the closed loop speed, are you setting the max speed rpm of the motor to the full potential. The default is set to 1000 RPM's. If the motor is rated for 3500 RPM's, then in this mode, the speed will basically get choked so that it stays at 1000 RPM's or less.

Also in this mode, the Integral gain will have influence over the proportional gain. If you set them starting at say the following, does the same thing happen?
P:0
I=5
D:0

You will want to tune the I and a little P as needed.

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

7 years 2 months ago #29528421 by sd1074
All files are in the zip now in the first post.

Also in the closed loop speed, are you setting the max speed rpm of the motor to the full potential.

The max rpm is set to 1000, yes, but my set point in the closed loop experiment is just 35.

Due to some technical diffficulties (it was an existing system which we modified), the encoders are attached with a gear reduction of 2.6. So encoder RPM=35 actually means Motor RPM=91. Motors are rated to 4600RPM.

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

7 years 2 months ago - 7 years 2 months ago #29528422 by sd1074

Also in this mode, the Integral gain will have influence over the proportional gain. If you set them starting at say the following, does the same thing happen?
P:0
I=5
D:0


In my experiment the settings were: P=0, I=1, D=0.
I just tried setting P=0, I=5, D=0 as you suggested. The result is almost the same (see attached pic).

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

7 years 2 months ago #29528423 by Griffin Baker
Thanks for the files. From the looks of the loop error for both motor channels that looks normal. If the motors are the same and use the same command, and hardware, it would show why they are in sync with each other.

I'll take a look at the rest of the stuff, but if you haven't already done so, have you disabled the loop error detection in the closed loop parameters? This may possibly be a cause for the motor power to go to zero unexpectedly.

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

7 years 2 months ago #29528424 by sd1074

I'll take a look at the rest of the stuff, but if you haven't already done so, have you disabled the loop error detection in the closed loop parameters? This may possibly be a cause for the motor power to go to zero unexpectedly.

Yes, I have. I think I tried disabling almost all safety parameters.

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

7 years 2 months ago #29528425 by sd1074
I replaced wait(2) with wait(0) in the script. And made the output shorter, so that the serial port can keep up with the motor controller CPU. New script:
loop1:
	error = GetValue(_E,2)
	power = GetValue(_P,2)
	print(error, ",",power, "\r")
	wait(0)
goto loop1

This allowed me to generate a log with 1ms resolution (in the attached zip-file). First value is the error, and second value is power. You can see how power drops on lines 174, 482, 2838, 3146, 5810, 7259, 5467.
Attachments:

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

7 years 2 months ago #29528426 by Griffin Baker
I'm going to hook up your settings with one of my controllers and motor. Unfortunately I may not be able to exactly replicate your situation as the controller version I have is newer.

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

7 years 2 months ago #29528427 by Griffin Baker
From your settings, everything looks right except you'll need to disable the pulse inputs for the corresponding encoder lines. So pulse input 1 and 2. Capture type to "disabled", and action "none". I think we'll need a better log to get what we are looking for. So please do the following.

In the Run tab, set the following channels.

Motor command 1
Motor power 1
Speed RPM1
Motor command 2
Motor power 2
Speed RPM 2

Run your motors for a minute or 2. Then stop both motors.
On the bottom there is a save log button, click on that and upload that log file.

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

7 years 2 months ago #29528428 by sd1074
Attachments:

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

Moderators: tonysantoni
Time to create page: 0.176 seconds