Jump to content

KAL-1000 Issues with priority and some questions


adsffm

Recommended Posts

Hello,

Before getting into the problems that I'm having, I'll briefly explain what I'm trying to do.

Basically, I want to be able to control throttle of an engine with yaw input. As long as yaw keys are pressed, the throttle should change but as soon as I release yaw keys, the throttle should reset to default value.

The way I'm trying to achieve this is with two KAL controllers, named "Control kal" and "Default kal".

The Control kal, in it's editor, has two points at the start and end with values 0 and 100 respectively for the engine throttle, it has the priority value set to 5 and is has play position set to 2.5 initially, with the play length being 5 in total (So the position is in the middle.)

The Default kal in it's editor has the Control kal's play position value assigned. What I was trying to do with this, is have two values at the start and end with both set to 2.5 and priority value set to 1. With this, I thought I would be able to change Control kal's play position as long as I'm pressing yaw keys, but as soon as I would release the keys, the Default kal would take over and reset the Control kal's play position back to 2.5.

I have ran into several issues. First of all, for some reason, KAL-1000 controllers editor does not allow for play position values of other controllers to be higher than 1.0, meaning that if you have one controller with play length of say 5 (Which is the default length), the other controller would not allow you to change first controllers play position beyond the 0.0 - 1.0 domain.

Second of all, I don't really understand how the priority value of KAL controllers work, seeing as if Default kal is set to play with repeat loop, it will be constantly setting the Control kal's play position to middle, as programmed, but Control kal's play position cannot be changed at all during this, not with the yaw keys nor manually. 

In conclusion, I want to achieve a control system similar to how wing Elevons are controlled. If you press pitch keys, it will pitch up or down but as soon as you release the keys, it returns to default position. Is there any way currently to achieve this or are there any tricky workarounds? 

Any information will be greatly appreciated. Thank you for reading.

 

P.S: I tried recording gifs of what is happening ingame, but cannot compress under 100mb without decreasing the resolution too low to see anything. Sorry.

Link to comment
Share on other sites

I don't really understand what you want to do. But if you set the "play position" input of a KAL to the yaw axis and set that to "absolute control", then the play position of that KAL will be in the center if no yaw key is pressed and will move to the start or end of the tracks when yaw keys are pressed. (It will also not be moved by SAS or manual trim due to issue #22946.) So you can have the default value set in the center of the track on that KAL and the left or right yaw values at the start and the end of the track.

On 1/8/2020 at 5:01 PM, adsffm said:

First of all, for some reason, KAL-1000 controllers editor does not allow for play position values of other controllers to be higher than 1.0, meaning that if you have one controller with play length of say 5 (Which is the default length), the other controller would not allow you to change first controllers play position beyond the 0.0 - 1.0 domain.

What keeps you from setting the play length of the KAL that you want to control with another KAL to 1?

On 1/8/2020 at 5:01 PM, adsffm said:

Second of all, I don't really understand how the priority value of KAL controllers work,

If you have one value that is controlled by two KAL, then the one with the higher priority will overrule one with a lower priority. E.g. if you have one KAL giving control inputs for 100% and another giving inputs for 0%, then the resulting value will be 100% if the first one has higher priority, 0% if the second one has higher priority, and 50% (the average of all KALs) if both have the same priority.

One more issue to note is that KAL don't always generate control signals, they only do that if their play position is set to a "new" value. So if you set the "play position" input of a KAL to an axis with "absolute control", then this "absolute control" will continuously set the play position to the current value which causes the KAL to generate control signals on all its outputs all the time. But if you set it to the same axis in "incremental control" then the KAL will only generate control signals when you are actually moving this axis. When the axis isn't moving, then no control signals are generated and the setting of a target may be overwritten by e.g. a lower priority KAL that is generating control signals (for whatever reason).

Has this answered your question(s)?

Link to comment
Share on other sites

51 minutes ago, AHHans said:

Has this answered your question(s)?

Yes, everything is clear now. I am very inexperienced with robotics/advanced tweakables in KSP so I had no idea about the absolute control option.

Thank you so much for help.

Link to comment
Share on other sites

25 minutes ago, adsffm said:

Yes, everything is clear now. I am very inexperienced with robotics/advanced tweakables in KSP so I had no idea about the absolute control option.

Don't worry, we've all been there.;)

Link to comment
Share on other sites

I assume you are using the KAL's because there is some sort of animation (like walking) that you are trying to accomplish.  Correct?

...else the KAL is probably not required if you are just trying to use yaw like a push-button motor controller.  You can toggle absolute for motor control in the action key assignment.  I did something similar with motor servos that pan in the direction of my turns so headlights will track with my yaw inputs, and then return to standard forward position when not turning.

Edited by XLjedi
Link to comment
Share on other sites

32 minutes ago, XLjedi said:

I assume you are using the KAL's because there is some sort of animation (like walking) that you are trying to accomplish.  Correct?

Actually I'm trying to build a drone and I want to control the torque on the rotors (two out of four, depending on which direction I want to turn) with yaw keys. For some reason I thought the only way to control robotic parts was via KAL :confused:

Thanks for the info though! I appreciate it.

Link to comment
Share on other sites

1 hour ago, adsffm said:

Actually I'm trying to build a drone and I want to control the torque on the rotors (two out of four, depending on which direction I want to turn) with yaw keys.

Why don't you say so? We were just discussing about quadcopters in another thread:

https://forum.kerbalspaceprogram.com/index.php?/topic/190880-controlling-a-quad-copter/

In there you can find the discussion of (and links to) two quadcopters with different control schemes. Feel free to shamelessly copy ideas from anyone else, everyone does that. :cool:

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...