DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Message
Author
AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#1 Post by AlyMac »

DHC-4 Caribou - VOR2 Indicator whether on Pilot setting or co-pilot - when I check the
hardware
Rotary Encoder: HSI OBS dial
arduino mega 2560
Channel A
pin * pin *

Ive tried all pins but it doesnt seem to work. The wiring is correct as the encoder will work with Autopilot heading.

Any ideas

User avatar
Ralph
Posts: 7930
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#2 Post by Ralph »

It can also be HSI 2 / Co-pilot HSI.

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#3 Post by AlyMac »

Sorry Ralf - I dont get it mate.
What have I done wrong here? The wiring is perfect and the encoder
https://www.youtube.com/watch?v=H2V0Yk1b4SQ

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#4 Post by SimPassion »

AlyMac wrote: Tue Nov 14, 2023 2:07 pm Sorry Ralf - I dont get it mate.
What have I done wrong here? The wiring is perfect and the encoder
https://www.youtube.com/watch?v=H2V0Yk1b4SQ
Are you targeting the CoPilot side and showing the Pilot side in the stream ?

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#5 Post by SimPassion »

Additionally, could you please past your script for the dial between code tags here ?

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#6 Post by AlyMac »

The instrument should work regardless of where one puts it on the panel. I tried "Pilot" and "Co Pilot" settings but it doesnt work mate.


The instrument for the DHC-4 VOR2 is the same as the one I downloaded.
-- DHC-4 Caribou VOR2 for nav 2
local obs_set = 0
local av_state = 0
local loc_state = 0
local deltatf = 0
local mod_obs = 0
img_add("background.png",87, 140, 320, 320)

loc_flag = img_add("loc_flag.png",195, 362.5, 42, 40)
tofrom_dy = img_add("tofrom_dy.png", 150,216, 40, 168)
tofrom_nt = img_add("tofrom_nt.png", 150,216, 40, 168)
face_dy = img_add("face_dy.png",90, 140, 320, 320)
face_nt = img_add("face_nt.png",90, 140, 320, 320, "visible:false")
loc_dy = img_add("loc_dy.png", -50, -180, 600, 600)
loc_nt = img_add("loc_nt.png", -50, -180, 600, 600, "visible:false")
azimuth_dy = img_add("azimuth_dy.png", 20, 70, 460, 460)
azimuth_nt = img_add("azimuth_nt.png", 20, 70, 460, 460, "visible:false")
bezel_dy = img_add("bezel.png", 0, 0, 500, 560)
bezel_nt = img_add("bezel_nt.png", 0, 0, 500, 560,"visible:false")
group_night = group_add(face_nt, bezel_nt, azimuth_nt, loc_nt, tofrom_nt)
group_day = group_add(face_dy, bezel_dy, azimuth_dy, loc_dy, tofrom_dy)

function pwr_lt_state_callback(pwr_on, tofrom, pnl_lts)

av_state = pwr_on
visible(group_night, pnl_lts[1] >= .2)
visible(group_day, pnl_lts[1] < .2)
if tofrom == 0 or av_state == 0 then deltatf = 0
elseif tofrom == 1 then deltatf = -41
elseif tofrom == 2 then deltatf = 41
end

move( tofrom_dy, nil, (216 + deltatf), nil, nil, "LINEAR", .2)
move( tofrom_nt, nil, (216 + deltatf), nil, nil, "LINEAR", .2)

if tofrom > 0 and av_state == 1 then loc_state = 1
else loc_state = 0
end
move( loc_flag, nil, (362.5 + (loc_state* -19)), nil, nil, "LINEAR", .2)
end

xpl_dataref_subscribe("sim/cockpit/electrical/avionics_on", "INT",
"sim/cockpit2/radios/indicators/nav2_flag_from_to_pilot", "INT",
"sim/cockpit2/switches/instrument_brightness_ratio","FLOAT[32]", pwr_lt_state_callback)

function cdi_deflect_callback(h_def)
h_def = var_cap(h_def, -10, 10)
if loc_state == 1 then loc_ang = -math.deg(math.atan(h_def * 50/180))
else loc_ang = 0
end
rotate(loc_dy, loc_ang)
rotate(loc_nt, loc_ang)

end


xpl_dataref_subscribe("sim/cockpit2/radios/indicators/nav2_hdef_dots_pilot", "FLOAT", cdi_deflect_callback)

function obs_deg(deg_mag)
obs_set = math.abs(deg_mag)
rotate(azimuth_nt, obs_set*-1)
rotate(azimuth_dy, obs_set*-1)
end

xpl_dataref_subscribe("sim/cockpit2/radios/actuators/nav2_obs_deg_mag_pilot", "FLOAT", obs_deg)


function knob_direction_callback(direction)
if direction ==1 then
mod_obs = obs_set +1
if mod_obs == 360 then mod_obs = 0 end
xpl_dataref_write("sim/cockpit2/radios/actuators/nav2_obs_deg_mag_pilot", "FLOAT",mod_obs)
elseif direction ==-1 then
mod_obs = obs_set -1
if mod_obs == 0 then mod_obs = 360 end
xpl_dataref_write("sim/cockpit2/radios/actuators/nav2_obs_deg_mag_pilot", "FLOAT",mod_obs)
end
end

obs_knob = dial_add("knob.png",410,462,80,80,knob_direction_callback)

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#7 Post by SimPassion »

Hi @AlyMac, at first, I've mentioned to use code tags please, at the moment you're editing your post ;-)

Yes we all have this one, this is why we would need the hardware part for which you didn't put yet the reference ... ???
So, please mention if it's own made, or existing and put the related script between code tags ...

Again code tags is this one :

image.png

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#8 Post by AlyMac »

Sorry Ralph
It is the stock Hardware download which seems to come with the gauge itself. DHC-4 Caribou - VOR2 Indicator dial

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#9 Post by AlyMac »

or do you mean that I need to take the rotary encoder out of the wooden panel and see if there is writing on the back of it ?

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: DHC-4 Caribou - VOR2 Indicator - hardware doesnt work

#10 Post by SimPassion »

AlyMac wrote: Tue Nov 14, 2023 3:52 pm
or do you mean that I need to take the rotary encoder out of the wooden panel and see if there is writing on the back of it ?
No need for this, just wondering where you've found the hardware part, as it doesn't seem to be present in the "DHC-4 Caribou - VOR2 Indicator" instrument ... Not even any hardware function is directly and automatically linked to any instrument

so, either you've downloaded it from elsewhere or made your own at some point ... so, please again copy and paste your script between code tags so we can start to help you

"DHC-4 Caribou - VOR2 Indicator dial" doesn't exists in the Online Store

image.png
image.png

Post Reply