Jump to content

Rovers and SAS - how does SAS work on terrain?


Recommended Posts

I don't understand what you mean by this, so please elaborate. You can change your CoM with your rover design, you can change how wide and long your wheelbase is. Both of those are irrelevant to the topic of this thread, which it's possible you haven't grasped yet. More and more, I'm of the opinion that this is the issue: people aren't doing the mental geometry with respect to what happens when you turn on a gradient. But, in any case, I'm quite certain you cannot change the manner in which SAS operates.

...you are aware that SAS can operate on engines with gimbal, on RCS, on wheels themselves, and anything else that generates force, right?

SAS only has omnidirectional torque if you specifically gave it omnidirectional torque. If you give it directional controls, it will use those, and only those, because nothing else is available to it. I don't know what you mean by "manner in which it operates", but I can tell you SAS will not invent brand new magical forces to compensate for what you don't give it, so yes, you certainly can change the resultant behavior of SAS systems by designing a rover that only permits certain forces. It's really bizarre that you keep saying "everyone" agrees with how SAS works when it's not even clear that you understand the difference between SAS and a reaction wheel. I imagine you probably do, but you conflate terms regularly and aggressively and the entirety of what you've had to say has been built upon this extremely narrow understanding, so who can really tell?

But I beg you, don't elaborate. I don't think I could hear "in case you haven't grasped it" one more time without gagging. That thing I said about being patronizing? Yeah. It's all I can stomach, I'm out.

Link to comment
Share on other sites

...you are aware that SAS can operate on engines with gimbal, on RCS, on wheels themselves, and anything else that generates force, right?

Yes, I edited my post to make this clear just in case, but I apparently edited it too late.

I don't know what you mean by "manner in which it operates"

I mean in the terms of the question posed in the original post of the thread, which has since been determined as "SAS will attempt to resist orientation changes". This is what everyone agrees with. If you're talking about something else regarding SAS (eg, whether or not it can use reaction wheels, or RCS, or anything else in the execution of its function), well, that's not the topic of this thread. I know because I created the thread and thus set the topic. It looks like you're responding to the question "how does SAS execute its function?". But I didn't ask that question. I asked how its function is defined when on terrain.

it's not even clear that you understand the difference between SAS and a reaction wheel.

If I say "SAS resists orientation changes", is that incorrect in your view, because the reaction wheels (etc) are actually providing the torque? If instead I said "reaction wheels resist orientation changes", I'm sure we'd agree that this would be more misleading. So your suggestion seems to be that any time we talk about SAS, we say everything without omission. For example, instead of saying "SAS will try to keep your aircraft stable", we should say "SAS will employ reaction wheels, RCS, control surfaces, and any other tools at its disposal to keep your aircraft stable". But nobody ever says this, because the desired implication is pretty obvious.

Edited by allmhuran
Link to comment
Share on other sites

Okay. I am one who doesn't try to completely dismiss someone else's claim without trying to really understand what is being sought. I'm not sure exactly what the question is that's being answered anymore, so I'm going to go all the way back to the original post, and try to start over.

It's not that I at all disbelieve what you are saying about the physics of the situation (although the free body diagrams you show are missing several forces and moments). In any case, it seems to me the questions are more of a practical nature, rather than a pure theoretical physics nature.

Let's say I'm driving a rover along a nice flat surface, with SAS on to assist with stability in turns. My heading is east, my pitch is zero, my roll is zero.

Yes, from a theoretical standpoint, I can agree with the baseline assumptions. Practically speaking, there are few places where you can find completely flat terrain in KSP, but it does exist.

I would also like to throw out a baseline assumption that we're talking about a rover with an appropriately low CoM with a wide enough wheel base, and that it has only torque available to the SAS.

Then I reach the bottom of a hill and start driving the rover up a 20 degree incline. My heading is still 90, but my pitch is now up 20. When I turned on SAS my pitch was zero... so will SAS try to fight the pitch caused by the terrain incline?

Yes, it will. Depending on the rover, this can be a really good thing or a really bad thing. But if we go with the baseline rover assumptions, this SAS fighting the wheels into the terrain will give the wheels more down force. From a practical KSP standpoint, pushing the wheels into the terrain will generally allow better acceleration. However, I also find that the SAS doesn't push hard enough that the back wheels come up, in this scenario.

Similarly, let's say I'm half way up the hill and turn right. As the turn is executed the rover would naturally roll further and further to the right until you were travelling along the face of the hill. Will SAS fight this as well?

Perhaps this is the root of some of our miscommunication. I see now that you are talking about this from an attitude perspective. The new attitude (after turning) is more "right roll" than it was before the turn. However, if you are turning right, the rover naturally wants to roll left due to inertia, with the CoM being above the point of leverage (the wheel tread-ground contact). Again, from the practical standpoint, this left roll from inertia is a pretty powerful force. So there probably is a component of SAS input that fights the roll change due to attitude, but whatever contribution is there is dramatically overpowered by the SAS fighting the tendency for the rover to roll over from inertia. Also, practically speaking, after the rover is jostled around a little, the SAS gives up on trying to hold the "up hill" attitude and assumes the new state.

In a worst case scenario, let's say I'm driving laterally along a hill, with the upslope to my left and the downslope to myright. Then I turn SAS on. Then I turn left (up the hill).

So I think here again you are referring to roll due to attitude change. Yes, from a pure physics perspective, it will be fighting back some. From a practical standpoint, this reaction is still washed out by the overpowering roll due to inertia, which the SAS is actually fighting. Also, right here, I don't believe the SAS is even fighting to get back to the "lateral attitude" anymore. So after some jostling, it's not even trying to roll right anymore, and it's actually trying to roll left to prevent inertia from flipping the rover. This is all during the dynamic state. After reaching some static state uphill, it's completely possible that the SAS would hold the left wheels up off the ground.

If SAS tries to maintain my roll, then it will try to maintain the roll to the right, which would actually contribute to flipping the rover during the turn (since it will actually cause the rover to attempt to lean out of the turn) rather than maintaining stability through the turn.

This is a true statement, but is predicated on "if SAS tries to maintain my roll." Which I am trying to assert that it, in fact, doesn't try to maintain all of that roll. Perhaps some component of it is maintained. Assuming it is maintained, it's still being washed out by the roll due to inertia, which you can watch the SAS actively fight.

If, right now, SAS does fight these orientation changes, then this would lead me to a suggestion: rover stability mode, in which SAS attempts to keep the wheels on the terrain (equivalently, match the rover pitch and roll to the orientation of the underlying terrain).

I would certainly agree that there's room for improvement in the current SAS, in many areas. Possibly even an active SAS, that applies yaw and roll into the turn (like the concept in your motorcycle picture), vice a reactive SAS (that only attempts to lean into the turn after the inside wheels lose contact with the ground). Although that's half the fun for me driving my Jeep (managing roll and yaw in the turn).

You could turn off SAS when first starting the climb, or while turning on the hill. But this would defeat the purpose of SAS in the first place, since turns are when it's needed.

I would assert that you don't need to turn SAS off right now. I can turn it on at the North Pole and drive half way around the planet to the South Pole0. SAS isn't trying to flip my rover upside down, in an attempt to return to the original attitude from when I turned it on at the North Pole. The SAS doesn't actually work that way for vehicles on the ground. Again, crest any hill with a rover at speed with the SAS on, it will maintain it's current attitude while flying through the air and isn't trying to return to the position it had when it was turned on.

I will also state that how all this is going to work together into something useful still depends on the rover design. In a further attempt to understand all of what you are saying, I repeated these experiments with my rover on Dres. Dres turned out to be a great place to test, because the terrain is fairly smooth when transitioning terrain mesh cells, has gentle contours, and some rolling hills. These things were reasonably available from my landing site, so I went back to that and did the exact tests above. I suppose as I keep saying, your results may vary based on rover construction. I've specifically designed mine to be SAS friendly at high warp, and rugged over rough terrain. This post is fairly pic heavy.



Relatively Flat Terrain - Straight ahead and with a left turn.

This test was run by only pressing W. No attempt was made to manually hold heading. Torque is disconnected from standard rover steering controls, so no torque is applied through steering (as can be seen in the trim inputs) during the turn. The turn was done by holding the left turn momentarily (maybe 1/4 of a second).

Javascript is disabled. View full album

SAS OFF: It's not evident from the pictures, but SAS off tended to "fishtail" a bit. (Yes, the rear wheel motors are disabled.) It also didn't reach as high of a top speed, likely due to the front wheels not digging in as much. After about 10 to 15 degrees of turn, the rover flipped.

Javascript is disabled. View full album

SAS ON: The rover reached a higher top speed. Enough that I ended up doing the turn in a slightly different area, but the terrain was still flat. The left turn reached about 40 degrees of turn before reaching the point where it flipped, and this is with the rover going faster than the SAS OFF test.

Results: The rover held heading better with SAS. However, with SAS on, the rover did have a tendency to hold front or rear wheels off the ground when transitioning over very small slopes in the terrain. It did not, however, try to flip the rover head or tail first while trying to maintain pitch, though this rover is certainly capable of it.



Uphill - Straight ahead, no turn.

This test was run by only pressing W. There was no attempt to maintain heading going up the hill.

Javascript is disabled. View full album

SAS OFF: There was a bit of fishtailing again, and the rover slowed to less than 2 m/s at one point. It did go mostly straight up the hill.

Javascript is disabled. View full album

SAS ON: The rover was going faster by the time it reached the base of the hill. Yes, there was some initial SAS attempt to pitch down into the terrain. The rover did not slow nearly as much as the SAS off test, and despite the lower gravity of Dres, it did not lift the rear wheels off the ground. The rover also maintained more speed going up the hill.

Results: So from this I would surmise that you are indeed correct. Going uphill, the SAS fights the change in gradient. I would assert that in this specific case, that's a good thing since it's providing more grip to the front wheels, which are the ones providing motive input. However, this could be a bad thing for rovers that already have a tendency to dig in and flip forward.

So yes, the SAS does things here that might or might not be helpful. So it depends a bit on the situation, rover design, and player style.



Following Lateral Hillside

This test was run by maintaining a heading while getting established laterally on the hillside's slope. After established and up to speed, the rover was turned uphill, which is left in this case.

Javascript is disabled. View full album

SAS OFF: Flippty flip flip

Javascript is disabled. View full album

SAS ON: The rover was able to do the turn without flipping over, and after the turn it settled to a new, wheels in contact with the surface, orientation.

Results: From a practical standpoint, even if the SAS is providing some right-roll due to attitude in this case, it's providing more input that's preventing the rover from flipping.



Time Warp - Straight ahead, 4x physical warp, no turning input.

As a bonus, I also ran a "straight ahead" test with time warp. Personally, this is one of the places I rely on SAS the most, though it's not exactly in your question about terrain. It does, however, have a major impact when navigating over terrain with timewarp. This test was run by only pressing W while at 4x warp. No turns were input.

Javascript is disabled. View full album

SAS OFF, under 4x warp, the rover wanted to turn left with no user input.

Javascript is disabled. View full album

SAS ON, under 4x warp, the rover held very close to the original North heading.



Can the SAS be better? Heck yes. But I'd also say that from a practical standpoint, I'm confident enough to say that SAS is helpful if it fits into the user's playstyle and rover design. I make a point to never make blanket statements about suitability, because it's always going to depend on more than just pure theory. How the user drives and how the rover is designed plays a huge role in how useful SAS can be, just like driving and design affects rover survivability. SAS isn't set up in such a way that it's waiting for a chance to flip the rover back to some initial state when it was first turned on. But it might also not be the best choice in every case.

I do drive with SAS on constantly, but I still have to help it along. For me and my rover, driving with SAS off pretty much guarantees a fishtailing, wheel hopping crash. That may not be the best choice for you and your rover. This is the reason why I steer clear of threads like this. Because there isn't a pure "yes/no" answer. It's going to depend on a lot of variables than just a choice of OFF or ON.

That also might not even be what you are trying to get at here. If your whole point is that SAS can be better for rovers, then yes, I completely agree. But I do disagree that it's as much doom and gloom as some people make it out to be.

Cheers,

~Claw

Edited by Claw
Link to comment
Share on other sites

the free body diagrams you show are missing several forces and moments

Sure, I'm only showing what's relevant to the topic.

This is a true statement, but is predicated on "if SAS tries to maintain my roll." Which I am trying to assert that it, in fact, doesn't try to maintain all of that roll.

Right, this is the key question. A rover driving along a concave terrain surface, such as the first example where it goes from flat ground to an uphill slope, or across various other terrain polygon intersections, will have its new orientation "forced" by the terrain. But in this scenario, where the terrain is convex or planar ("planar enough" if you like), that's not the case.

Now, I'm not sure what you mean by "it doens't try to maintain all of that roll" (emphasis added)... If you mean that SAS *knows* I'm on terrain and therefore won't do its usual thing of trying to preserve my orientation, then that goes back to the original question posed in the OP. And if it does indeed do that, well good! That means SAS has some kind "terrain following" mode which is good for rovers.

In any case, I just did another test, with yaw input and steering input decoupled. What I found was that wheel steering input does not override SAS. In other words, SAS will fight against yaw caused by wheelsteer, which I did not know. So then I tried steering using coupled yaw, which (of course) overrides SAS yaw, and noticed that in this scenario the yaw input actually disables SAS roll stability every time I touch it. In this brief gfy, watch as the roll needle goes to zero every time I touch left yaw, then when I release it it returns to a right roll:

http://gfycat.com/GloriousAmusedIrishterrier

Edited by allmhuran
Link to comment
Share on other sites

Sure, I'm only showing what's relevant to the topic.

Well, what is shown in your FBD isn't wholly correct either, but that's really besides the point from the practical matter. I think I now understand from that diagram the point that you are trying to make. (At least I hope I do.)

Right, this is the key question. A rover driving along a concave terrain surface, such as the first example where it goes from flat ground to an uphill slope, or across various other terrain polygon intersections, will have its new orientation "forced" by the terrain.

Yes indeed.

But in this scenario, where the terrain is convex or planar ("planar enough" if you like), that's not the case.

Sometimes, but again it really depends. SAS does fight back, but sometimes just the bumping up and down, along with whatever the local gravity is, and how much torque is available, the design of the rover, etc... is enough that the rover ends up flattening out against the terrain. However, I do agree that it is capable of doing so, and is especially prevalent on lower gravity worlds (Minmus and, as I'm discovering, Dres).

Now, I'm not sure what you mean by "it doens't try to maintain all of that roll" (emphasis added)... If you mean that SAS *knows* I'm on terrain and therefore won't do its usual thing of trying to preserve my orientation, then that goes back to the original question posed in the OP. And if it does indeed do that, well good! That means SAS has some kind "terrain following" mode which is good for rovers.

I'm not sure if it's an inherent piece of the SAS that "knows" it's on terrain, so much as just a function of it's general programming. But similar to what I mentioned above, the SAS is often slowly overridden and jostled into a new position. Because of the jostling and overriding, it doesn't actually remember what the roll state was before the turn (in this example). So it doesn't try to put back "all the roll" it had before the turn started.

Also, if you drive a rover around with only steering controls (uncoupled from torque controls), you can watch the SAS turn into the circular override arrows. That's similar to what happens when SAS is on for a rocket (or other craft in space) and you override it with torque controls. I haven't done any SAS programming probing to verify, but I believe this override is actually coming from the SAS/rover/terrain interaction.

In any case, I just did another test, with yaw input and steering input decoupled. What I found was that wheel steering input does not override SAS. In other words, SAS will fight against yaw caused by wheelsteer, which I did not know.

Yes, that's what I was trying to explain in a previous post. And it's not a particularly intuitive thing to explain to people when they can't understand why SAS is causing a problem with their particular design. SAS isn't smart enough to know that the yaw in this situation is actually desired.

So then I tried steering using coupled yaw, which (of course) overrides SAS yaw, and noticed that in this scenario the yaw input actually disables SAS roll stability every time I touch it. In this brief gfy, watch as the roll needle goes to zero every time I touch left yaw, then when I release it it returns to a right roll:

If it's case two, then yeah, there might be something strange going on with that setup. Possibly SAS related due to the turn as you have been explaining, but it's also there before you start turning. So without playing with it myself, I don't have a certain explanation for that. I certainly am not disbelieving you, I just don't know in that case. Was it "zero" earlier (before starting on the hill?) And if SAS is disengaging while you are turning, then I don't think it's really "remembering" a right roll, but idk.

Cheers,

~Claw

Link to comment
Share on other sites

Well, what is shown in your FBD isn't wholly correct either, but that's really besides the point from the practical matter. I think I now understand from that diagram the point that you are trying to make. (At least I hope I do.)

As I wrote, I drew it with the torque at the CoM for clarity. It does seem like you're on the same page though, with respect to rover orientation changing roll relative to the terrain.

I'm not sure if it's an inherent piece of the SAS that "knows" it's on terrain, so much as just a function of it's general programming. But similar to what I mentioned above, the SAS is often slowly overridden and jostled into a new position.

Yeah, agreed, if it's jerked or jostled it will resettle. Not something that matters to this particular topic but certainly something that matters with rovers in general.

If it's case two, then yeah, there might be something strange going on with that setup. Possibly SAS related due to the turn as you have been explaining, but it's also there before you start turning. So without playing with it myself, I don't have a certain explanation for that. I certainly am not disbelieving you, I just don't know in that case. Was it "zero" earlier (before starting on the hill?) And if SAS is disengaging while you are turning, then I don't think it's really "remembering" a right roll, but idk.

Yeh, that's the "start lateral, turn uphill". I initially engaged SAS a little earlier as I set up the direction for the run, so at the start of the gfy it's already trying to roll back to the original orientation.

I think sometimes people see a thread like this and think it's saying "waaah, SAS is broken, KSP sucks, etc etc" and go into defensive mode. In fact I get that rather a lot, because I'm not asking the typical "i'm new, need help" style questions, I'm usually investigating some specific case (such as here). But I'm not saying it's bad or wrong or needs to be fixed, I'm just trying to figure out exactly what the behaviour is. In this case, in a quest to improve the stability of

. Edited by allmhuran
Link to comment
Share on other sites

When SAS is in pure "stability" mode (the "lowest tech" version of SAS, not the more complex modes you get later), it tends to reset itself over time to the new attitude. Even if you do get SAS fighting you at first when you go up a hill, after several seconds, it will become reset to the new uphill attitude, and in fact fight you when you start to flatten out again. The idea that because you set it when you were on the flat, it will forever be holding you to that flat isn't how it works in my experience. It will only fight you for a few seconds, and then it will have been reset to the new attitude it's been having for the last few seconds.

THink about what happens when you're in space with SAS on, and you pitch up manually with SAS on, using the 'S' key. You can fight the SAS and force it to pitch up, and after you let go... does it rotate all the way back to where you stared? No. It tends to stick to its new attitude.

SAS will have the effect you're talking about, but only for a second or two before it starts to adhere to the new attitude it's been at.

You can also force a reset even faster than that by turning SAS off and on again quickly. Turn it off right at the base of the hill, turn it back on again after you pitch up to the slope.

Edited by Steven Mading
Link to comment
Share on other sites

THink about what happens when you're in space with SAS on, and you pitch up manually with SAS on, using the 'S' key. You can fight the SAS and force it to pitch up, and after you let go... does it rotate all the way back to where you stared? No. It tends to stick to its new attitude.

Yeah, this is not unexpected. In stability assist mode you can move its control point via user input (but interestingly, for rovers, not wheelsteer). When you release the input, SAS will take up the new position. Similarly, as Claw wrote, any jolts and other large changes caused by external factors can cause SAS to give up its previous position in favour of a new one. This can be terrain, or if you deliberately push one aircraft into another... not recommended by see my atmospheric docking challenge video for an example. In these cases, SAS will take up a new "hold point" at the post-jolt position.

But if you yaw smoothly without bumps (eg, a smooth turn on a relatively bump free slope), SAS will tend not to reset roll. Or so it would appear... but there are a few oddities involved. For example, that gfycat linked in my previous post shows that SAS is actually disabling the roll control while I yaw (which is what it usually does before accepting a new hold point when you release control), and yet it still takes up a right roll position after I'm done. Like Claw, I'm not sure exactly what's going on there, but that's the situation I was getting at in the OP.

What it seems to come down to is whether input on one control axis causes SAS to let go and reposition all axes when the input stops, or if it only resets the control point for the axis on which input is being issued.

Edited by allmhuran
Link to comment
Share on other sites

SAS being toggled off when you hit an attitude key is one of the most important reasons to decouple the rover controls from the attitude (wasdqe). One of the first rovers I built would do a forward roll if you hit s to slow down from high speed. After decoupling the controls the SAS would pitch back when slowing and prevent the somersault.

Link to comment
Share on other sites

MechJeb has a "Stability Control" option in the Rover Autopilot module.

I use it in my Munar circumnavigation and I feel like it's doing better for a ground based rover than SAS does.

But I don't know if only the controller is more balanced than the on in the stock ASAS, or if it actually is designed to help with driving.

Can someone confirm this?

Link to comment
Share on other sites

Yeh, that's the "start lateral, turn uphill". I initially engaged SAS a little earlier as I set up the direction for the run, so at the start of the gfy it's already trying to roll back to the original orientation.

I think sometimes people see a thread like this and think it's saying "waaah, SAS is broken, KSP sucks, etc etc" and go into defensive mode.

Well, that's an easy thing to happen when the communication mode is pure text. Also, I am not seeing the right roll SAS input that you do in the gfy when subjecting my rover to similar tests. So as I dig through your thread, it was unclear to me if you were saying "does this thing happen?" or "This thing is happening to me, and I think this is what causes it."

To SAS in general, it used to be the case that giving input to SAS would only cause that channel to unlock. (Give roll input to a plane, the SAS keeps it's pitch & yaw input.) That was changed several versions ago, and now all three channels unlock when providing input to any one channel.

The thing about your video is that SAS unlocked, so it should have reset all axes anyway. So I'm not yet convinced that it's because of the change in attitude without more testing. Perhaps it's something that's happening after the turn.

For example, the outer wheels compress when you turn, and SAS is unlocked. Upon rolling out, SAS reengages and the suspension (which is compressed) tries to expand. Perhaps for your smaller rover, SAS is detecting that. And maybe with less torque available, that reaction (the trim) is more obvious. (This is just another possible thought. I'm not saying it's _the_ cause.)

There are a couple other things I'm thinking too, but perhaps I will try to replicate your rover and fiddle with it a bit to see.

Cheers,

-Claw

Link to comment
Share on other sites

So as I dig through your thread, it was unclear to me if you were saying "does this thing happen?" or "This thing is happening to me, and I think this is what causes it."

Kinda went like this:

- Playing around with mechs le me sees SAS behaving in a way I didn't expect in a couple of specific situations.

- Having not played KSP in a few months, I figure my knowledge might be a bit out of date. Post this thread asking, essentially, "does SAS behave any differently on terrain than otherwise?".

- Run a few tests, see the effects described.

- Spent a lot of energy trying to explain that I'm not asking about what SAS is, or what controls it can utilize, etc, but something very specific about a certain situation. Thread kinda gets derailed/goes off topic with a few participants not quite on the same page, instead providing more general SAS info. This is not entirely unexpected, I'm operating well past the edge of the normal KSP gameplay envelope (trying to completely stabilize the BD armory aiming reticles for bipedal robots controlled by KOS AI on uneven terrain. LOL.)

- Back on track!

To SAS in general, it used to be the case that giving input to SAS would only cause that channel to unlock. (Give roll input to a plane, the SAS keeps it's pitch & yaw input.) That was changed several versions ago, and now all three channels unlock when providing input to any one channel.

The thing about your video is that SAS unlocked, so it should have reset all axes anyway.

Cheers for the answer on axis coupling, that's good info.

As it happens I have, in the meantime, addressed the issue in other ways and I think I've got the mechs about as stable as they will ever get. The reticle jerks about a degree or two as the legs move (which is a bit odd given the way the thing is constructed, but that's an entirely different issue). But a degree or two is probably acceptable. Most of the remaining shake is coming from the torso shaking around on the hip joint, and there's nothing that can be done about that.

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...