Homing and optimisation issues, massive ferror, help!

More
31 Aug 2023 07:48 #279453 by 1ChipCarver
Greetings!

I'm a mech engi student and as a part of a course I have to set up a LinuxCNC control system of a model aeroplane wind-tunnel testing setup. It consists of a model aeroplane inside a wind tunnel that is moved into different orientations by 2 servos, and forces on the aeroplane are measured by a sensor. So there are 2 relevant axis, B and C, one servo per axis, and thus 2 angluar joints. Should be pretty simple, right?
Now, I've assembled the 3D model in Vismach, created the HAL file by myself, and the .ini file with the Pentapod config's .ini as a rough template (basically all relevant parts are new). The animation moves corrrectly and terminal reports no errors when I start it up by "linuxcnc [.ini name]".

But for the life of me, I cannot get it to home properly, the following errors are gigantic, and even changing and testing ANY setting in the Calibration window makes the whole thing go haywire (it starts rotating wildly, and if I recall correctly even estop doesn't stop it). 
Homing starts in the correct direction, but blows past the home switch and the limit switch and stops at roughly double the angle at which the simulated home switch stands (I've capped the wcomp for joint1 at 43 degrees, because that's when the aeroplane starts hitting the walls of the tunnel). I had to increase the FERROR and MIN_ERROR TO 300 and 50 (degrees) to not simply error-out immediately. 
I've turned every dial and lever I could think of, but I'm running out of ideas and frankly, time. So I could use a few sets of eyes to take a look at the HAL and .ini files for any glaring errors.

I'm adding the files down below. The existing PID settings are just the last ones I've tried. And I've tried a lot of combinations that would make sense. The comments in the files are in Croatian, but I think everything's arranged in a way that should be easy to follow. If not, ask away. And keep in mind, I'm just a student, and this is a slightly-more-than-basics course, so no advanced stuff is expected from the professor. Everything that we were taught is in those files.

Thanks!
Attachments:

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

More
31 Aug 2023 08:10 #279455 by rmu
It is not clear from your hal files how the servos are interfaced. I would check if the limit components are really doing what they should (and not run into saturation, that could explain the following errors), also, for velocity mode servos and proper units, FF1 should be 1.

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

More
31 Aug 2023 09:21 - 31 Aug 2023 09:43 #279458 by 1ChipCarver
Sorry, perhaps I should've clarified, there's no actual hardware. All is simulated and run on a laptop that, judging by the latency-histogram, has no business controlling actual hardware.
Setting Pgain and FF1 was the first thing I tried. Pgain to increase the response, and FF1 for the ferror. Can't remember if it helped in any way. I don't have access to my laptop at the moment. 
We are expected to come up with values for velocity and acceleration that made sense for the application, and that was it as far as we're concerned.
The purpose of all this is just to teach us the basics of optimising the controller, some of the syntax, and make us interested in making our own actual machines. Which it did. In due time.
Last edit: 31 Aug 2023 09:43 by 1ChipCarver.

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

More
31 Aug 2023 10:20 #279460 by JPL

Homing starts in the correct direction, but blows past the home switch and the limit switch and stops at roughly double the angle at which the simulated home switch stands
Thanks!
 


In that case there's probably something wrong with your homing parameters:

#Joint1_homing
HOME = 0
HOME_OFFSET = 70
HOME_SEARCH_VEL = 15.0
HOME_LATCH_VEL = -5.0
HOME_FINAL_VEL = 15.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
#HOME_SEQUENCE = 1 ---- MAKNUTI # KASNIJE


First thing to do is to set :HOME_OFFSET = 0

This way you can verify that it is homing where the limit switch is. If it doesn't work as expected I would suggest to have look here first: linuxcnc.org/docs/html/config/ini-homing.html#_homing_sequence.

Note that there will be quite a bit of overshoot since the MAX_ACCELERATION value for this axis is relatively low. Increasing it will help correct this error.

Once satisfied you can set back the HOME_OFFSET value to the desired value.



 
The following user(s) said Thank You: 1ChipCarver

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

More
31 Aug 2023 10:23 #279461 by rmu
So position comes from integrating velocity. I would try P=500 and FF=1, but IMO it should even work with FF=1 and P=0 as there are no external disturbances.
The following user(s) said Thank You: 1ChipCarver

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

More
31 Aug 2023 18:52 #279505 by 1ChipCarver
Hi there..
Thank you for the link, I've already studied that section
As far as I can see, it is indeed attempting to home in the correct direction when I set HOME_OFFSET = 0. And as far as my understanding goes, the Homing sections are set up correctly. Show Hal Configuration window clearly shows the home switches trip when/where they should, but the joint simply keeps going, instead of reversing and moving at HOME_LATCH_VEL until it trips correctly.
I've since quadrupled MAX velocity and acceleration, but nothing's changed.

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

More
31 Aug 2023 18:56 #279508 by 1ChipCarver
Tried that aswell, same thing happens. Looks like I'll have to go straight to the professor and ask him.

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

More
01 Sep 2023 12:10 #279567 by rmu
Check your speeds and acceleration, search velocity much larger than maximal velocity on an axis doesn't make sense. Reduce allowed ferror. Use FF=1 and all other gains = 0. Increase acceleration. Then it should work.

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

More
01 Sep 2023 17:07 - 01 Sep 2023 17:10 #279592 by JPL
As rmu said and also Deadband= 100 ???
This is way too much. You should first set it to 0 as it is masking other PID errors.
Last edit: 01 Sep 2023 17:10 by JPL.

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

More
02 Sep 2023 21:42 #279679 by 1ChipCarver
Hi there, thanks for replying.

The values in the .ini are just the final ones I tried to run. I initially set it up properly, with values that made sense: obviously search velocity should be lower than max velocity, initial deadband was 0, f-error was in the single digits, min_f-error was in the tenths, etc. Then I upped Pgain to increase the response time to motor-pos-cmd, set FF1 to 1...1,015, but the behavour was not improving at all. So I started fidgeting with other settings that could theoretically help, changing values here and there and looking what that does to the simulation but to no avail. Other colleagues on this project have temporarily abandoned it because they too were having the same issues. Because of other assignments that are due next week I've also had to stop trying to make this work for now. I've also had issues loading the forum website and posting replies, hoping this one goes through.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum