Jump to content

how do you link servos to sas


CoolinHi
 Share

Recommended Posts

  • 2 weeks later...

Welcome to the forum!

 

On 9/2/2021 at 4:10 AM, CoolinHi said:

so im building a sam missile launcher and want to know how to make my sas aim the turret at a target using servos or rotors as when i tried to use pitch and yaw it wouldn't auto aim 

KSP doesn't offer us a way to map stock SAS pitch/yaw/roll inputs directly to servo/rotor controls. We can however trick KSP into achieving the same result you're after.

We start by creating a 'bucket' attached to a probe core (and an extra reaction wheel), which will contain the payload/device that we want to point-and-track targets. This bucket we then suspend in a set of three rotating gimbals, using servos, and taking care to balance it such that the CoM of empty/full bucket always stays precisely in the intersection of the gimbal centers.

We can't directly control the servos to do the steering, so we leave them unlocked and unmotorised. BUT: since we have suspended our device with three degrees of freedom, to the probe core it's as if it's floating freely in space, and its SAS can effortlessly point it at any target and keep tracking it.

 

I created a craft as a proof of concept of this: https://kerbalx.com/swjr-swis/SAM1

Spoiler

eNzXNmt.png

GhIoMVY.png

035ACeM.png

 

 

Notes:

  • There is a risk of 'gimbal lock', where axes can become aligned in the same plane, losing you one degree of freedom. In the time I've tested this, it's not happened to me. But it's possible.
  • KSP's SAS code gets confused when switching away and back to the device, causing a deviation to build up from where it should be pointing. I haven't found a way to solve or prevent this.

 

 

On 9/3/2021 at 11:35 PM, Vanamonde said:

I think you will need to figure this out and then tell the rest of us how to do it because I haven't seen it done. 

As requested. :D

Edited by swjr-swis
Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...