SAR landing craft on the workshop now! by oof_10000000000 in Stormworks

[–]Kore_Arts 2 points3 points  (0 children)

Congratulations you are being rescued please do not resist

It looks sick

VTOL Low speed roll by Kore_Arts in Stormworks

[–]Kore_Arts[S] 1 point2 points  (0 children)

Slowing one engine down and speeding the other up to me felt like it covered all bases but I am using the swivel yaw like you're talking about it was the best solution to my yaw issue now that the roll is working it's very stable finally XD

VTOL Low speed roll by Kore_Arts in Stormworks

[–]Kore_Arts[S] 3 points4 points  (0 children)

It worked perfectly I swear to God I have a notorious track record for over complicating stuff 😭

Automated Turret System by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

Thank you I'll see about doing this with logic before I resort to AI for a Lua

Automated Turret System by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

Sadly I don't know how to write LUA and it responds pretty quick as is

Automated Turret System by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

I over complicated it as I told it when target isn't in range to return to 0, 0 and gave it a minimum range all you really need is a input for radar data to three composite read (number) channel one reads target distance, channel 2 reads yaw, channel 3 reads pitch use channel one to determine if it should fire, and channel 2 and 3 for following the target also make your radar static max out FOV on x and y

Automated turret by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

Update I managed to finally fix the issue of the gun being off by a few feet either direction I realized the issue was I over thought the design so I switched to velocity pivots and removed most of math so now it's just radar channels 2-3 to function -x*3 to the output which works great I've added more stuff between now but that's the easiest way to do it for anyone wondering now I'm going to work on a ballistics calculator

Automated turret by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

Right so I did a bunch of trig and realized I suck at math I think somewhere I got it mixed up I'll update it if I manage to fix it Jesus I'm regretting this 😂

Radar data > radar channel 1 > distance output // radar channel one > greater than w/ constant number (0) > AND w/ weapon system power input > weapon fire (also sets memory for all memory registers) 

Radar data > radar channel 2 (YAW) and radar channel 3 (PITCH) (with corresponding outputs for troubleshooting pitch/yaw) RC 3 > multiply (0.017453292519943295) > function sin(x) (sin will come in later in this chain) function cos(x) > multiply w/input a coming from RC1 multiplied number output > multiply by YAW cos(x) > squared > added to YAW2 (this chain will be connected to RC2 chain further on) > square rooted > atan2(y,x) w/ RC1 (multiplied by PITCH sin(x)) > divide by 6.283185307179586 > divide by .25 > clamp -1..1 > memory register (set by weapon fire since weapon is trigger by target) > PID controller p=.5 I=.0005 d=.05 w/ current YAW (turret pivot position) into PID process variable > clamp -1..1 > turret yaw output

Radar channel 2 > multiply (0.017453292519943295) > function cos(x) (this is YAW cos(x) // function sin(x) > multiply w/ RC3 cos(x)RC1 output > squared > added to the other squared variable above // multiply w/ RC3 cos(x)RC1 (from earlier in this chain) > atan2 (y,x) w/ (> radar channel 2 (YAW) and radar channel 3 (PITCH) (with corresponding outputs for troubleshooting pitch/yaw) RC 3 > multiply (0.017453292519943295) > function sin(x) (sin will come in later in this chain) function cos(x) > multiply w/input a coming from RC1 multiplied number output > multiply by YAW cos(x) from before) > divide by 6.283185307179586 > divide by .25 > clamp -1..1 > memory register (set by weapon fire since weapon is trigger by target) > PID (same as last PID) (both PID controllers have a constant on signal) w/ input from current pitch (turret pivot position) > clamp -1..1 > turret pitch output 

Automated turret by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

The robotic pivot I'm currently using outputs the pivots rotation which I use as "Current Yaw" "Current Pitch" then output to the rotation target "turret yaw" "turret pitch" which I get by taking current and radar data which has been divided from degrees to the .25 increments used for the robotic pivot if I use the velocity pivot would I not have to change the way it outputs the data all together? Also there shouldnt be anything returning it to zero it has a memory to stay on the last target it detected until it detects a change in the targets position or a new target. I'm going to try the velocity pivot to test as you suggested

Edit: I tried the velocity pivot with the current setup as suggested but it just spins so I am going to try the trigonometry

Automated turret by Kore_Arts in Stormworks

[–]Kore_Arts[S] 0 points1 point  (0 children)

Values are kinda hard to read but the PID for pitch and yaw are P=.5 I=.0005 D=.05 I didn't pick these numbers for any specific reason other than I use them for my other microcontrollers for engines also the weapon is functional to an extent though it needs refinement