This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Signal K Wind to 3 phase DACs...
#1
Hello,

I am trying to write a flow that will use the Apparent Wind data in Signal K, convert that from Radians in to 3 analogue voltages 0v to 10v, phase shifted +120 degrees, and -120 degrees to drive the old analogue Stowe wind instruments on my boat.

I have PI5 and 2xGravity: 2 Channel I2C DAC Module, 0-10V - DFR0971 connected up on the i2c GPIO output pins.

I have worked out a function to convert radians to 0 - 10volts, and then write that voltage out to the DACs and phase offset them.... but I can't get the DACs to output the correct voltages.  My function appears to output the correct byte values, but a volt meter across the output pins is wildly off.

I'm using the i2c Out node to drive the DACs but I'm doing something very wrong.  The address of the DAC also keeps changing from 5F to 5B and back again at random point seven though the dip switches on the DACs are always set to 5F.

Here is my current flow, set for just 2 phases.  I was going to try and add the third when I got one working!  I'm very stuck and would love some help!

https://github.com/MrGorsky999/Signal-K-.../tree/main

TIA, Al.
Reply
#2
I am making some progress with my little project.

I have reliable outputs on my DACs now. That was because I needed to configure them before Node Red started outputting values. A bit of code run first cleared that up I think...

Anywy, I wanted to ask a more general question. Once I've got this working in Node Red, I think long term it should run as a plug in for the Signal K server. I could also just run it as a little script on my PI accessing the Server K using Websockets. Is there any advantage to using one over another? If I was to update my wind direction data say 10 times a second is that to much data for a Websocket connnection? It seems to me if I can integrate my little script into Signal K as a plug in it's a more elegant solution. It will automatically run when the server starts and is operated from "within" rather than and external python script running and polling the server for data all the time.

I'd love to know your thoughts....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)