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
Rudderfeedback Sensor Robertson/Simrad RF300
#1
Hi,

My Setting is a PI4 with OP2 and an Pi Zero-W with Tinypilot

I managed to get my Sensor RF300 working and sending NMEA0183 Rudder position to the OP2.
The RF300 a Sensor that sends a freequency (center at 3400 HZ) and a change of 1 degree gives a cahnge of 20HZ.
The sensor has only two wires 12v and GND and the produced (ripple)-frequenciy is stable for an input from 10 to 15V.
A simple circuit and an Arduin Nano Clone transforms the freequency into NMEA and send it with 38400 Baud to
the OP2 over USB.

From there it goes to the Tinypilot (WIFI) and it is visible/configurable in the Pypilot Plugin in OpenCPN on the PI4.

This is working, and y also have Rudder-limit Switches for safty ....

I would now like to get the Rudder information directly into the Arduino were Motor.ino is runing, to avoid latency ....

So my thinking is instead of phasing a NMEA sentence to the PI4, to output a (PWM) voltage the witch will serve to the Arduino, runnting  Motor.ino as input for the Rudder reference. 

My question is how do I get a reference voltage to keep the precision  ???
Should I output from the rudder-sensor-arduino two voltages, one as reference voltage and one as rudder-pos-voltage ???
How do I connect and do I have to modify motor.ino for that ???


Thanks for any input on that and
save sailing
Andreas
Reply
#2
Hi,

it came to me that it might be easyer to:

take the voltage reference from the Motor.ino Arduino and read it by the Rudderfedback Arduino as an external reference Voltage and
have it in to consideration when it comes to output the Rudder-position Voltage ......

Any opinion on this ?

Greetings
Andreas
Reply
#3
Curious how you transform the data into NMEA and send them via wifi? I have 3 rudder feedback sensors on my boat, one could be eliminated if I could share that data to open plotter wirelessly! Two of the sensors are already connected to an Arduino one is the sensor for the main engine the other is for the auxiliary engine, the third is connected to Sean's motor controller for tiny pilot. Latency from the main to the auxiliary is not so critical as long as its reasonable... is it possible for the Arduino that links the main and the auxiliary to use Wi-Fi data to sync the engine positions?
Reply
#4
(2021-05-13, 12:46 AM)rastam4n Wrote: Curious how you transform the data into NMEA and send them via wifi? I have 3 rudder feedback sensors on my boat, one could be eliminated if I could share that data to open plotter wirelessly! Two of the sensors are already connected to an Arduino one is the sensor for the main engine the other is for the auxiliary engine, the third is connected to Sean's motor controller for tiny pilot. Latency from the main to the auxiliary is not so critical as long as its reasonable... is it possible for the Arduino that links the main and the auxiliary to use Wi-Fi data to sync the engine positions?

Hi ratam4n,
the NMEA sentence goes via USB cable to Openplotter and from there via WIFI somehow, I guess SIGNALK to theTinypilot. If you have a Rudderfeedback connected to the TP you shoud have the data also in Openplotter and beeing able to broadcast them from ther in SIGNALK or NMEA via WIFI to were you want.

My Arduino NANO is not able of WIFI, but there are some that are or you can use an ESP32.
With them I guess you will be able to insted of my USB-Cable to broadcast the NMEA sentence via WIFI TPC/UPD.

The impotant part for you is this: (wher "Rudderangele" is a INT Variable with the Rudderangle value in degrees, 0 is centen and +- are degrees to port/stb)

   //Generate Rudder sentence

    NMEA = "XXRSA,"; //RSA=Rudderangle sentence
    NMEA = NMEA + String(Rudderangle);
    NMEA = NMEA + ".0,A,,";
    CalcCRC(); // Calculate checksum
    Serial.println(NMEA);
 
// Calculate checksum
void CalcCRC() {
  //Using the NMEA string without Dollar sign and asterix
  //Create a CRC by doing bitwise XOR with each character in the string.
  CRC = 0;
  for (z = 0; z < NMEA.length(); z++) {
    CRC = CRC ^ NMEA[z];
  }
  NMEA = "$" + NMEA; //Place Dollar at the start of string
  NMEA = NMEA + "*"; //Place asterix at the end of string
  if (CRC < 16)NMEA = NMEA + "0"; //If CRC is less than 16 then the Hex output would be 1 charcter - Pad the 1st character with zero
  NMEA = NMEA + String(CRC, HEX); //Append the CRC
}

My whole code as ino file is here:
https://1drv.ms/u/s!AuBO4GQT9nyN8XzP9OouVGI8aGuO

Save sailing
Andreas
Reply
#5
Could you not just connect a max485 onto the serial output of the 'Rudder Angle Arduino' (leaving USB in place) & another MAX485, listening on the servo Arduino or TinyPilot Pi (this is just NMEA-0183).

This way you have a single, consistent datasource and have a direct connection.
Reply
#6
How bad is the latency? Maybe the latency from wifi is a bigger issue?

You could for example connect your rudder feedback arduino to the usb of the tinypilot eliminating wifi.

Otherwise, what you want is a DAC. I'm not sure you need to worry about voltage 64kh, unless you experience inaccuracy over temperature?? The rudder stops should be set to have a few degrees extra in case of this.

To make a DAC with arduino, the simplest way is to use PWM output varying duty cycle (not frequency) with rudder angle. I would use fastest frequency po.ssible and low-pass filter it with say 10k and 0.1uF capacitor as a starting point and feed this into the rudder feedback. You might power this arduino from the rudder feedback pins of the motor controller.
Reply
#7
(2021-05-13, 02:47 PM)seandepagnier Wrote: How bad is the latency?   Maybe the latency from wifi is a bigger issue?

You could for example connect your rudder feedback arduino to the usb of the tinypilot eliminating wifi.

Otherwise, what you want is a DAC.   I'm not sure you need to worry about voltage 64kh, unless you experience inaccuracy over temperature??   The rudder stops should be set to have a few degrees extra in case of this.

To make a DAC with arduino, the simplest way is to use PWM output varying duty cycle (not frequency) with rudder angle.     I would use fastest frequency po.ssible and low-pass filter it with say 10k and 0.1uF capacitor as a starting point and feed this into the rudder feedback.   You might power this arduino from the rudder feedback pins of the motor controller.

Hi Sean,

thanks for your reply.

I  dont´t know how bad the latency is, but I yust feel better if the sensor-data got to were they are used. Also for safty, beside
the end of rudder switches I´m using.

I also hope to have an verry accurate Ruder-feedback for further developments of Pypilot (absolute and learning) ;-)

I have ordered an MCP4726 witch is an 12-Bit DAC with an Pin for Voltage-Reference (1US$) wich I plan to connect to the TP-Arduino.

I modyfied my Rudder-NMEA.ino maps 80 degrees of rudder movement (2600-4200Hz of the RF300) to 0-4096 PWM´s. So this is woking perfect (high precison and resolution) when y check it at the serial monitor.

So it looks like everything is on a good way
Save sailing
Andreas
Reply
#8
you could also conceivable connect the arduinos together via i2c or spi, one arduino just samples rudder. This would work as well without needing analog or worrying about voltage references, but would require modifying the motor.ino source code.
Reply
#9
(2021-05-13, 06:36 PM)seandepagnier Wrote: you could also conceivable connect the arduinos together via i2c or spi, one arduino just samples rudder.   This would work as well without needing analog or worrying about voltage references, but would require modifying the motor.ino source code.

two arguments against that:

first: Modyfing motor.ino is  far above my actual knowlege, I´m happy beeng able to select and modifiy the options it gives to us.
second: I would have to modyfy every future update you make, so I better leave it as it is.

Reconsidering I guess a 10 bit resolution is good inough for the PWM of the voltage. This will give an accuranciey of better then 
a 10th of degree of rudder possition movement ......

So I will not use the MCP4826 and instead use the TimerOne library and an set analogReference(EXTERNAL) to have the correct
Voltage refererence
Reply
#10
(2021-05-12, 08:58 AM)xfactor99 Wrote: Hi,

My Setting is a PI4 with OP2 and an Pi Zero-W with Tinypilot

I managed to get my Sensor RF300 working and sending NMEA0183 Rudder position to the OP2.
The RF300 a Sensor that sends a freequency (center at 3400 HZ) and a change of 1 degree gives a cahnge of 20HZ.
The sensor has only two wires 12v and GND and the produced (ripple)-frequenciy is stable for an input from 10 to 15V.
A simple circuit and an Arduin Nano Clone transforms the freequency into NMEA and send it with 38400 Baud to
the OP2 over USB.

From there it goes to the Tinypilot (WIFI) and it is visible/configurable in the Pypilot Plugin in OpenCPN on the PI4.

This is working, and y also have Rudder-limit Switches for safty ....

I would now like to get the Rudder information directly into the Arduino were Motor.ino is runing, to avoid latency ....

So my thinking is instead of phasing a NMEA sentence to the PI4, to output a (PWM) voltage the witch will serve to the Arduino, runnting  Motor.ino as input for the Rudder reference. 

My question is how do I get a reference voltage to keep the precision  ???
Should I output from the rudder-sensor-arduino two voltages, one as reference voltage and one as rudder-pos-voltage ???
How do I connect and do I have to modify motor.ino for that ???


Thanks for any input on that and
save sailing
Andreas
I have a similar situation with the same rudder feedback but have no idea how it is internal. Looking with and oscilloscope when connected to a Simrad autopilot you see a square wave with varying frequency with the rudder position and a big offset (about 12v).

I am lost about how to power the RF300 if I don't have the simrad autopilot. Perhaps feeding 12V through a resistor or inductance?. Once that extracting the signal may be done with a high pass filter.

How did you did it?
Many Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)