Homing and optimisation issues, massive ferror, help!
- 1ChipCarver
- Offline
- New Member
- Posts: 7
- Thank you received: 0
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!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- 1ChipCarver
- Offline
- New Member
- Posts: 7
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- 1ChipCarver
- Offline
- New Member
- Posts: 7
- Thank you received: 0
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.
- 1ChipCarver
- Offline
- New Member
- Posts: 7
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This is way too much. You should first set it to 0 as it is masking other PID errors.
Please Log in or Create an account to join the conversation.
- 1ChipCarver
- Offline
- New Member
- Posts: 7
- Thank you received: 0
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.