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
no rudder feedback
#11
I need the 0-1.1v range to measure current accurately, and it's also a more accurate reference.

If you use the 0-5 range it will change all the other measurements.

If you attempt to use 1.1v range for some inputs and 5v for others, it needs a very long delay switching channels which is a problem.
Reply
#12
Thank you Sean,

in my test setting I only read tha rudderfeedback, but I understand your point and will change back
to 0-1.1V and the power-divider for the reading of analog sensors that are giving 0-5 V if I need.

Save sailing
Andreas
Reply
#13
Hi Sean,
the rudder feedback is working nicely and the upgrade you made the pilot control panel loocks great.

Two minor problems:

I manage the Rudder-calibration from he Pypilot/Client tab. I dont manage to get it calibrated from
the Pypilot/Calibration/Servo tab. Do I really have to press both buttons for the rudder centered and
than again press both when the rudder is at an angle of e.g. 40 degrees. Anyway how I try I dont get it
calibrated from here.

There is a slider bar to change the setting (degrees) of the autopilot (in compass mone). It works
when the AP is engaged, (Just a little fast for my taste). The problem i see is that when the AP is not engaged (Standbay),
and you move the slider bar ist engages the AP automaticly. I don´t know if this is your intention ?
I think the AP shoul only engage when you press the AP-button.

It is not a big thing and I hope I did not explain to bad

Save sailing
Andreas
Reply
#14
I am trying to integrate Pypilot with an old Alpha Marine Systems 3000 Autopilot. The Alpha linear actuator has a 10k ohm potentiometer built-in which I'd like to use.  I've been bench testing rudder feedback on ADC pin 4 with a 10k ohm rotary potentiometer. I added 35100 ohm resistance to a 5V voltage divider circuit on the Arduino to bring the voltage down to 0-1.1 volt reference values . The rudder position indicator seems to be working well. I can see readings between -30 to 30 in OpenCPN, in NMEA messages and in the servo calibration tab. However, I am encountering two problems:
- In the servo calibration tab, when I try to calibrate and press "Rudder is Centered" and "Rudder at Range" buttons, nothing seems to happen. I don't see any values written to the Offset field. 
- Using the pypilot plugin in, the SYNC MAX_RUDDER flag is always triggered. I tried setting various min rudder position/max position values in between -100 and 100 and changing the potentiometer angle. Nothing seems to get rid of this flag. 

I am using the latest Pypilot version from Github and the openplotter distribution for OpenCPN + plug-ins (1.02 alpha)

Really appreciate your advice. Thanks!
Reply
#15
There are 3 values used for the rudder feedback:

servo.rudder.offset - set to ensure 0 gives neutral rudder position,  It is floating point from -1 to 1, but usually near zero if your rudder feedback is well balanced.
servo.rudder.scale - scale factor to make the angle correct.  This can be negative if the rudder feedback is opposite to the motor direction.
servo.rudder.range - min/max angle allowed for the motor to move the rudder


If you are getting rudder values from -30 to 30 from the nmea output, then the rudder feedback should be working, but maybe the direction is reversed.

Be sure to click rudder at range when starboard not port, or negate the servo.rudder.scale value, or flip the + and - wires of the potentiometer.   

There were some changes to use the arduino eeprom to remember motor specific settings and this may have introduced a bug.  Could you try:

git checkout 484c08c182

sudo python setup.py install

Let me know if you still get the max rudder flag.
Reply
#16
(2019-02-15, 06:42 AM)seandepagnier Wrote: There are 3 values used for the rudder feedback:

servo.rudder.offset - set to ensure 0 gives neutral rudder position,  It is floating point from -1 to 1, but usually near zero if your rudder feedback is well balanced.
servo.rudder.scale - scale factor to make the angle correct.  This can be negative if the rudder feedback is opposite to the motor direction.
servo.rudder.range - min/max angle allowed for the motor to move the rudder


If you are getting rudder values from -30 to 30 from the nmea output, then the rudder feedback should be working, but maybe the direction is reversed.

Be sure to click rudder at range when starboard not port, or negate the servo.rudder.scale value, or flip the + and - wires of the potentiometer.   

There were some changes to use the arduino eeprom to remember motor specific settings and this may have introduced a bug.  Could you try:

git checkout 484c08c182

sudo python setup.py install

Let me know if you still get the max rudder flag.

Thanks Sean, really appreciate your reply. I tried your suggestions and also the different git version but unfortunately didn't succeed. Calibrating to starboard might have been an issue but now I get the MIN RUDDER flag instead. The servo continues to move only in one direction. I tried various configurations to connect the potentiometer wires but that didn't solve it. I see a voltage of between 0-1.1v when I test the middle wire with a multimeter. This middle wire is connected to the analog pin.  In pypilot calibration, the rudder zeros out around .55v and rudder angle of -29 and 29 is indicated at around 0 .1 and 1v.  Pressing the rudder at center and rudder at range doesn't seem to do anything. I can't get to a 30 degree angle because at that point the voltage drops to zero or 1.1v and the angle reads as "FALSE". Maybe that's an issue? I did try calibrating with a range of 10, 20 but that also didn't work. 

In the configuration menu in the pypilot plug-in, I tried setting the minimum and max rudder angles at a range of values between -100 and 100 for both max and min but that also didn't clear the flag.
Reply
#17
I fixed the problem just now in the servo calibration ui. Sorry about that. Try the latest git, it should be fixed. Try also updating the motor.ino sketch, although I don't think that is the problem it is better to be

If the input to rudder sense is very near 0, or near the 1.1v threshold (or above) then rudder feedback is disabled and you will see the value of False. This makes it possible to just unplug the rudder feedback and work without it rather than triggering a fault. I don't use a resistor in series to the potentiometer to drop the voltage, because the input pin would be left floating if the feedback is disconnected.

Instead I use a voltage divider from the rudder sense pin with 100k and 30k resistors. I realize this is two resistors instead of one but

1) it will keep the voltage out of range if disconnected.
2) it puts 5v across the potentiometer giving better immunity to noise on the longer wires
3) It also keeps high impedance on the input which makes it a lot less likely to fry the arduino somehow from voltage spikes or noise, and creates a RC filter.

I also put a small resistor in series with the potentiometer say 200 ohm to prevent problem from shorts, since shorting the 5v to 0v on many arduino clones destroys the linear regulator unfortunately. Another way is to put 100 ohm in series with the vin of the arduino which also saves the regulator from shorts, and helps avoid the absolute maximum rating of 15 volt input on many of these parts that use ams1115 reglators. I do both on my controllers.


The pypilot plugin you are using in opencpn is out of date. I think if you upgrade, it will also work from the plugin.

Also try the client, and look at the servo.rudder.offset, servo.rudder.range, and servo.rudder.scale values.

Let me know how it goes. I just tested everything and had good results.
Reply
#18
(2019-02-16, 10:58 PM)seandepagnier Wrote: I fixed the problem just now in the servo calibration ui.   Sorry about that.   Try the latest git, it should be fixed.  Try also updating the motor.ino sketch, although I don't think that is the problem it is better to be

If the input to rudder sense is very near 0, or near the 1.1v threshold (or above) then rudder feedback is disabled and you will see the value of False.   This makes it possible to just unplug the rudder feedback and work without it rather than triggering a fault.    I don't use a resistor in series to the potentiometer to drop the voltage, because the input pin would be left floating if the feedback is disconnected.

Instead I use a voltage divider from the rudder sense pin with 100k and 30k resistors.  I realize this is two resistors instead of one but

1) it will keep the voltage out of range if disconnected.
2) it puts 5v across the potentiometer giving better immunity to noise on the longer wires
3)  It also keeps high impedance on the input which makes it a lot less likely to fry the arduino somehow from voltage spikes or noise, and creates a RC filter.

I also put a small resistor in series with the potentiometer say 200 ohm to prevent problem from shorts, since shorting the 5v to 0v on many arduino clones destroys the linear regulator unfortunately.   Another way is to put 100 ohm in series with the vin of the arduino which also saves the regulator from shorts, and helps avoid the absolute maximum rating of 15 volt input on many of these parts that use ams1115 reglators. I do both on my controllers.


The pypilot plugin you are using in opencpn is out of date.   I think if you upgrade, it will also work from the plugin.

Also try the client, and look at the servo.rudder.offset, servo.rudder.range, and servo.rudder.scale values.

Let me know how it goes.  I just tested everything and had good results.

Thanks very much Sean! I did some testing today and was able to get the potentiometer calibrated with the appropriate rudder readings and no flags. The new UI looks really nice too! I updated motor.ino, pypilot and the OpenCPN plugin to the latest git version for it to work. It all seemed good but when I connected the motor driver to 12v to test the servo,  it didn't behave as it should have. There is no movement whatsoever. I see PWM is working and voltage comes through my motor driver but its in the +- 13mv range where before it was in the +-13v range. It's almost like everything is off by a factor of 1000. Disabling rudder sense didn't help where that fixed the issue previously.  I'm using a Pololu driver which had always worked in the past. My wiring is the same as before and the motor driver works well with a test program.
Reply
#19
(2019-02-22, 06:50 AM)donovanes Wrote: nected the motor driver to 12v to test the servo,  it didn't behave as it should have. There is no movement whatsoever. I see PWM is working and voltage comes through my motor driver but its in the +- 13mv range where before it was in the +-13v range. It's almost like everything is off by a factor of 1000. Disabling rudder sense didn't help where that fixed the issue previously.  I'm using a Pololu driver which had always worked in the past. My wiring is the same as before and the motor driver works well with a test program.

Can you pull older versions of motor.ino from git until one works?

What type of pwm are you using?  RC style or vnhsp30 style?   To get the second type you need to uncomment a #define, so updating git you would have to make this change before compiling.

If it is RC style, be sure the right straps are set on the arduino and ensure it is in the right mode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)