Stormworks: Build and Rescue

Stormworks: Build and Rescue

41 个评价
Heading Hold Microcontroller
   
奖励
收藏
已收藏
取消收藏
Vehicles: Sea
标签: v0.10.27
文件大小
发表于
更新日期
41.653 KB
2019 年 7 月 22 日 上午 8:22
2020 年 6 月 21 日 上午 8:50
6 项改动说明 ( 查看 )

订阅以下载
Heading Hold Microcontroller

描述
Given a current heading, and a desired heading, output rudder commands to keep vessel pointed towards desired heading.

Currently it is setup to support a "Toggle and Go" setup whereby when a toggle button is enabled, the current heading is set to the desired heading. The microcontroller will then output rudder commands to hold the heading that the vessel was pointing towards when the toggle button was enabled. By using the Heading adjust left/right input nodes, you can bind physical buttons to slightly tweak the desired heading in one direction or the other. It also allows the player to manually manipulate the vessel temporarily to avoid obstacles or adjust approaches. When no further player input is detected, the controller will resume heading hold.

To disable the system, simply toggle the button off. When a new heading is desired, simply re-toggle the button and again, the current heading will be set as the new desired heading hold.

Node Descriptions

System Enabled (Input): Whether or not the system is enabled. This should be bound to the toggle button on your vessel that you will use to enable and disable the heading hold system.

Current Heading (Input): This will come directly from the Compass Sensor on your vessel. This controller handles all the conversions for you, it just accepts the raw input from the sensor.

Heading Adjust Left (Input): Allows you to adjust the desired heading by one degree to the left. Best if bound to a pilot seat hotkey or a Standard (not toggle) button.

Heading Adjust Right (Input): Allows you to adjust the desired heading by one degree to the right. Best if bound to a pilot seat hotkey or a Standard (not toggle) button.

Rudder Player Input (Input): This should come from your control seat. This allows the pilot player to manipulate the vessel manually (to avoid obstacles, adjust approach, etc.) temporarily. Once input is no longer detected, the heading hold system will re-engage automatically.

Rudder Output (Output): This is the output commands that will be sent to your rudder control surface(s). This is what actually turns the vessel to hold the desired heading.

Stored Heading (Output) (Optional): This is an optional output that simply outputs the heading that the controller is attempting to hold. It will be the heading that was the vessel's current heading when the system was toggled on.

Current Heading Output Degrees (Output) (Optional): An optional output that simply outputs the current world heading in degrees. This allows you to not worry about converting the current heading into degrees from the compass' -0.5 to 0.5 scale.
91 条留言
Operation: Hobbycraft 10 月 19 日 下午 6:47 
@Ozrul use a multiply
Captain 8 月 31 日 上午 8:05 
You already suggested a fix yourself, so why does it matter if you're not gonna do it anyway HAHA
Mr. Leonard  [作者] 8 月 30 日 下午 3:56 
You could always suggest a fix
tomatosoup 8 月 30 日 下午 3:54 
do you have beef with this dude or something, just deal with it
Captain 8 月 30 日 下午 3:50 
LOL still not fixed. To be expected from this guy.
Captain 8 月 7 日 下午 4:42 
"""Hey tomato, thanks for bringing that to my attention. You are right, there is definitely an error in the heading output value not matching up with the world heading. I don't have a lot of time today to work on it, but it looks like the displayed output heading is showing 180 when the vessel is facing north. See this image:

https://imgur.com/a/5LRVrNE

So it seems it is off by 180 degrees. I will get this fixed as soon as I have time and re-upload. Until then, the hold functionality does still work as expected.""""
Mr. Leonard  [作者] 8 月 7 日 下午 4:12 
Is it broken from an update Captain?
Captain 8 月 7 日 下午 2:03 
Aaaand it was never updated.
orangesodaplease 7 月 26 日 下午 7:57 
hey can u do a star wars shield generator that is customizeable? like if u hit it enough ittl go down?
tomatosoup 1 月 7 日 下午 4:53 
I did some weird math that converted the heading that comes from the keypad, to the number the heading hold PID wants.
360*(1 - (floor((keypadHeading - 1) / 360) + (keypadHeading - 1) / 360))=desiredHeading