Stormworks: Build and Rescue

Stormworks: Build and Rescue

Striker 2020 年 3 月 16 日 下午 7:58
How in the world do you control RPS in a predictable manner?
I have been searching for days now still can't figure this out. As soon as I throttle up the engine up to a certain amount engine just runs off to max RPS. Yes I get that, no resistance and engine will spins to max part, that is fine... I know why it happens.

Question is how do I control this so when my throttle lever is at .5, I get 50% of the max rpm etc...

I tried using a clutch, clutch and gears, aircraft props, screw (boat) nothing seem to put the right amount of load/resistance in the engine.

I have been trying to make an airplane and I am finding only way to get predictable thrust is to control the prop pitch, well I want a fixed pitch propeller plane (not a variable, constant speed prop) and want to control fuel +air to get the rpm (just like in a real plane or a sim).

Is this even possible to do? Any help would be appreciated. Thanks! I am losing my mind over this :sadelf:
引用自 Goobs:
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.
< >
正在显示第 1 - 15 条,共 15 条留言
Nhalok 2020 年 3 月 16 日 下午 8:38 
You could do this with a PID controller. If you have your throttle control go to an appropriate multiplier and then to the setpoint of the PID you can have the engine vary the throttle to maintain your desired rps.

As an example; if your desired max engine rps was 20, the "appropriate multiplier" would be 20. Selecting 0.5 on your throttle control would go through this multiplier (an f(x) block set to x*20) and yield a 10. The PID would then have its output wired to the throttle and will vary it to maintain its setpoint of 10.

So, to recap. Setpoint should be wired up as described above, output goes to engine throttle, process variable comes from engine rps and you can wire the on/off to either a constant on, a button or even your seats occupied node so it turns on when you get in. Settings I would recommend to begin with would be P 0.1, I 0 and D 0.1.

If everything I have said may as well have been in Greek, post a link to your creation and I will wire it up for you. I hope this helps!
最后由 Nhalok 编辑于; 2020 年 3 月 16 日 下午 8:40
Ra-Ra-Rasputin 2020 年 3 月 17 日 上午 2:30 
A PID controller is often the solution here, but there are also microcontroller solutions that you could use to have much more customizable control than a PID.

The downside of PID is that it struggles for instance remotely controlling a throttle lever if you want a genuine physical representation of the throttle that you can override by hand. You could still use a PID by simply making the throttle lever match the PIDs throttle number of course, but it's quite an amusing coding challenge to actually make it use a throttle lever.

The other downside of PID is that it's hard to comprehend. Often fine tuning a PID is trial and error with what seems like magic numbers. Even if you understand exactly how it works, it's nearly impossible to calculate a solution that would work in most cases.

Otherwise, however, its effectiveness can't really be argued against.
Striker 2020 年 3 月 17 日 上午 8:28 
Thanks guys. This engine running away sounded fun at first but quickly became a chore especially when I got into more advance (not the advance mode) /complicated creations. It's almost like engine has no forces acting on it, as if it is in space withe parts having zero resistance.

I wonder what the thinking behind this was from the developers point of view. Maybe they went for realism but then again, real engines have, friction from oil, metal components, air etc... on top of that there are governors to help with this. (this is me ranting)

Anyways, I will try to figure this PID thing out, it sounds complicated. Thanks again.
最后由 Striker 编辑于; 2020 年 3 月 17 日 上午 8:29
Unit 744 2020 年 3 月 17 日 上午 9:33 
Whenever I have an issue like this, I always make my own micro controller (utilizing LUA if the computations are sufficiently complex). Sure, it takes longer to get a good result than just using someone else's micro controller. The upsides, though, are,

1, you have infinite customization to get the exact behavior you want,
2, the customization is often more intuitive than the PID 'blackbox of magic' or properties boxes of a micro controller you do not understand,
and 3, the behavior is (or can be made to be) more reliable.

An additional upside, if you are a nerd, is that it is a great programming exercise to keep you fresh and on your toes!
Woodspeople 2020 年 3 月 17 日 上午 9:43 
It is also worth adding that the function x/((y*z)+1) works fairly well
(where x = throttle (0-1), y = rps, and z = small multiplier ~0.05)

you can reduce Z to increase rps, or increase it to reduce rps.
最后由 Woodspeople 编辑于; 2020 年 3 月 17 日 上午 9:44
Striker 2020 年 3 月 17 日 上午 11:10 
引用自 Unit 744
Whenever I have an issue like this, I always make my own micro controller (utilizing LUA if the computations are sufficiently complex). Sure, it takes longer to get a good result than just using someone else's micro controller. The upsides, though, are,

1, you have infinite customization to get the exact behavior you want,
2, the customization is often more intuitive than the PID 'blackbox of magic' or properties boxes of a micro controller you do not understand,
and 3, the behavior is (or can be made to be) more reliable.

An additional upside, if you are a nerd, is that it is a great programming exercise to keep you fresh and on your toes!


Good to know! Didn't know you can use LUA. Yep I am a nerd I guess, I sit in C# all day :), well guess I can add "LUA" to my resume too :)

Thanks!
最后由 Striker 编辑于; 2020 年 3 月 17 日 上午 11:10
该讨论串的作者已表示此帖子解答了原先的主题。
Goobs 2020 年 3 月 17 日 下午 4:54 
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.
Striker 2020 年 3 月 17 日 下午 4:59 
引用自 Goober Noopydoops
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.

That is very generous of you, thank you, I will try that out now.
Striker 2020 年 3 月 17 日 下午 5:24 
[quote=Goober Noopydoops;1870622978438430504
Obviously, I take the lazy goof route.
[/quote]


Works like a dream, you sorted out my problem. I have been playing with the PID but couldn't get it to work, your creation helped me realized it actually needs to be powered on with a switch :steamfacepalm:

I guess I am a lazy goof before a nerd... Really all I wanted to do was just control the throttle, this should carry me though the next few ours.

Now I have to figure out why my float plane doesn't come off the water, seems too much drag... but... thats a discussion for another thread!

Thanks again!
最后由 Striker 编辑于; 2020 年 3 月 17 日 下午 5:27
Ra-Ra-Rasputin 2020 年 3 月 17 日 下午 5:51 
It's a question of drag, lift and direction of thrust!
In Stormworks' Bullet, like in just about every other physics engine, water is jello gunk when it comes to drag. A bullet-shape pontoon has a lot of drag, when you can get away with a wide ski instead.
Striker 2020 年 3 月 17 日 下午 7:40 
引用自 Ra-Ra-Rasputin
It's a question of drag, lift and direction of thrust!
In Stormworks' Bullet, like in just about every other physics engine, water is jello gunk when it comes to drag. A bullet-shape pontoon has a lot of drag, when you can get away with a wide ski instead.

Well this is what I have: https://steamcommunity.com/sharedfiles/filedetails/?id=2025922711
flies nicely off of a runaway but, a brick in water.
Ra-Ra-Rasputin 2020 年 3 月 18 日 上午 4:14 
Here you go

https://steamcommunity.com/sharedfiles/filedetails/?id=2026179080

There's a button inside there that enables the assist flaps for taking off, and landing in water. When taking off water do not enable the flaps for the plane. Simply glide along the surface and pick up speed until you can pull up. It should do so naturally once you reach high enough speed.

I also tuned your engines to provide more power for no extra fuel cost. You probably have to adjust the sensitivity of the controls and the trim quite a bit. I made some tweaks to make testing much quicker like hardwired the throttle to 1.

I sealed your cabin with doors and a hatch on top. The hatch is more for emergency use than entry, but it's useful if you land in water so you don't flood the cabin.
最后由 Ra-Ra-Rasputin 编辑于; 2020 年 3 月 18 日 上午 4:15
Striker 2020 年 3 月 18 日 上午 7:14 
引用自 Ra-Ra-Rasputin
Here you go

https://steamcommunity.com/sharedfiles/filedetails/?id=2026179080

There's a button inside there that enables the assist flaps for taking off, and landing in water. When taking off water do not enable the flaps for the plane. Simply glide along the surface and pick up speed until you can pull up. It should do so naturally once you reach high enough speed.

I also tuned your engines to provide more power for no extra fuel cost. You probably have to adjust the sensitivity of the controls and the trim quite a bit. I made some tweaks to make testing much quicker like hardwired the throttle to 1.

It swims and flys now! I tried those fins too but I placed them downwards and then set the constant value to make them angle.. I guess I had to place the towards the direction of travel.

I sealed your cabin with doors and a hatch on top. The hatch is more for emergency use than entry, but it's useful if you land in water so you don't flood the cabin.


Yeah, when I built this my tech level didn't have those doors.

Thanks for your help! I have yet to understand physics in this game, it seems this game has very minimal/simple aerodynamics. I am used to playing Kerbal Space program with mods which give pretty decent physics.
Ra-Ra-Rasputin 2020 年 3 月 18 日 上午 7:34 
The physics is actually more complex here, it's just that its interpretation of air is significantly more thick, which means physics behave differently.

In Kerbal, even with FAR, you won't have body lift, you have to have specific lifting surfaces. In Stormworks you can make a plane without wings just fine, so long you have some way of controlling it to keep it in balance.
最后由 Ra-Ra-Rasputin 编辑于; 2020 年 3 月 18 日 上午 7:37
Lawrence Wahba 4 月 21 日 下午 10:21 
引用自 Woodspeople
It is also worth adding that the function x/((y*z)+1) works fairly well
(where x = throttle (0-1), y = rps, and z = small multiplier ~0.05)

you can reduce Z to increase rps, or increase it to reduce rps.



Late to the party, but yeah...

This is a good fuction, but i found it to limit the overall power too much, or too less depending on the multiplier.
If you combine this with a conditional, it kinda works, though.

What I did:
Created an input signal for the clutch, because I was using two separate microcontrollers for engine and throttle (optional).

If RPS is GREATER than (my case: 15) AND if Clutch signal is LESSER than (my case: 0.1), a numerical switchbox can signal the function above to kick in with a multiplier even greater (my case: 1.5).

It's not smooth, but it is a way to turn on an idle mode without the need of a direct player action.
< >
正在显示第 1 - 15 条,共 15 条留言
每页显示数: 1530 50