OpenMarine
Rudder control from app - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Rudder control from app (/showthread.php?tid=5090)

Pages: 1 2


Rudder control from app - fgorina - 2024-01-13

Hi

I am developping a PyPilot interface for the M5Dial. I use the tcp connection to port 23322 and it is working changing the mode, the command and I think tacking. It uses the touch pannel and the encoder which makes it very intuitive.

But I don't understand the commands when you are disengaged and want to move just the rudder.

After trying to understand the source, I think the commands to move the rudder are:

servo.position and the value should be the desired position of the rudder in degrees. - port, + starboard
servo.command and the value the direction as -1 port, +1 starboard

But for the moment I have no way to check this is ok. 

Have anyone any suggestion?

Thanks

Paco


RE: Rudder control from app - seandepagnier - 2024-01-14

Yes that is right.

Just try sending servo.command to set the motor speed for manual control and keep sending it as long as moving. It is best to set it to zero again to stop moving (otherwise it will timeout but control is less precise)


RE: Rudder control from app - ironman - 2024-01-14

Nice interface! Is that open source?

To illustrate what Sean said, you might have a look here: while the button is down in standby mode, I repeatedly send the same command. Also note the difference between +1 and +10: in the +1 mode I send a different value, making the actuator move slower thus facilitating hooking it onto the rudder.

https://github.com/marcobergman/pypilot_ray/blob/4e8b90be06f4ef6a2291bd8d5ea0bf5781ec863a/ray.py#L421


RE: Rudder control from app - fgorina - 2024-01-15

Will send it to GitHub but I need to -it configuration for WiFi etc which is a bit annoying. Hope to have it up in a week. Now fighting with a tiny[ilot that does not want to connect to the WiFi (changed access point)

(2024-01-14, 11:59 AM)ironman Wrote: Nice interface! Is that open source?

To illustrate what Sean said, you might have a look here: while the button is down in standby mode, I repeatedly send the same command. Also note the difference between +1 and +10: in the +1 mode I send a different value, making the actuator move slower thus facilitating hooking it onto the rudder.

https://github.com/marcobergman/pypilot_ray/blob/4e8b90be06f4ef6a2291bd8d5ea0bf5781ec863a/ray.py#L421

Thanks. Very useful. So just send servo.command with value 1 or -1 or 0


RE: Rudder control from app - ironman - 2024-01-15

In fact, 2 resp -2 is what I do. And 0.2 and -0.2 for a slow move. But as you see I repeat sending this about 20 times per second.


RE: Rudder control from app - seandepagnier - 2024-01-15

I am pretty sure any value greater than 1 (or less than -1) will be clamped to the maximum speed.


RE: Rudder control from app - matze - 2024-01-18

Isn't servo.position_command the correct command to use? servo.position is rejected as non-writable.


RE: Rudder control from app - seandepagnier - 2024-01-18

for absolute position yes. For relative (speed command) it is servo.command not servo.position. Perhaps it could be renamed?


RE: Rudder control from app - fgorina - 2024-01-23

I find that sending servo.position_command it does not change the servo.position


RE: Rudder control from app - fgorina - 2024-01-23

Also when sending servo.command = -1, I vave the behaviour that every 3s I have like a command that pushes up servo.position up nothing more connected)!!!

When I stop of sending servo.command servo position grows once again till 60.

May be because there is no controller connectes?