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
How to configure an Arduino Nano as a motor controller for Pypilot
#1
I have an issue with my pypilot setup. It was previously correctly configured and I was able to test the movement of the linear actuator by simulating a manual Tack. The next project step was to configure the anemometer.  This proved more difficult than anticipated. Eventually I made a major error and used Ai. This resulted in the entire setup being corrupted, which mean a clean reinstall. Now I have the problem with pypilot

My setup is a RPi5 with NVME bottom hat. A BME280 and IMU. The motor controller is an Arduino Nano connected to the Rpi by USB cable. The Arduino is connected to an H-Bridge Relay controlling a linear actuator. Nothing has physically changed since my previously working version of Pypilot (ie no change to the wiring or connections). This leads me to believe I have a software configuration issue.

In the Op4 Serial Devices window I have UART0 enabled.
The window shows the following:
     
USB Port                             Device /dev/                  Alias/dev/                          vendor  product   serial            remember
1f000300000.serial:0.0         tty/AMA0         
No hub                               3-1.1.0                          ttyUSB0      ttyOP_Arduino     0403   6001    A5069R            dev
No Hub                               3-2.2:1.0                       ttyACM0                               1a86   55d3   5D01123585
Hub port 4:1                        3-2.4.4:1.0                    ttyACM1     ttyOP_gps            1546   01a7                           dev
                                          107d001000.serial:0.0    ttyAMA10
                                          107d50c000.serial:0.0     ttyS0

The tyACM0 device is the USB dongle for the anemometer


In the Connections window it shows
    device/dev/         alias/dev              data       Connection    ID    bauds
    ttyUSB0              ttyOP_arduino   NMEA0183   Pypilot          1   auto
    ttyACM1              ttyOP_gps         NMEA0183  SignalK       gps   38400

In the Pypilot 4.011 Serial window is /dev/ttyOP_arduino

In the Pypilot Services window is Enable Autopilot Pypilot Version: 0.71 Detected IMU: ICM-20948

Clicking the Control Button shows a RED AP. Clicking it makes it change to GREEN. The Arduino is Engaged with alignment warning. Rudder 0
The Red and Green column just flicker as lines at the bottom of the window.

The Arduino has the Red power led illuminated and the RX and TX leds constantly flicker

Clicking the Tack to Starboard or Port button results in the Tack window closing and no response from the actuator.

SignalK Dashboard shows yellow underlining for gps i2C and Pypilot

In OpenCPN the gps, compass and IMU all provide data to the gauges.

I don’t know what the issue is but suspect either the configuration between the Serial and Pypilot OR the ‘alignment warning’ in Autopilot Control.

Any suggestions on how to identify the problem and rectify it/them would be greatly appreciated.


Tom
Reply
#2
since you wired your own h-bridge, if the green and red flicker it is probably communicating but maybe configured wrong for the hardware.

I wouldn't test at first with tack buttons but with the << < > >> buttons when not engaged. Can you try that? I think your motor.ino you flashed probably doesnt drive the right pins for whatever h-bridge you wired to it.
Reply
#3
(2026-11-02, 06:33 AM)seandepagnier Wrote: since you wired your own h-bridge,  if the green and red flicker it is probably communicating but maybe configured wrong for the hardware.

I wouldn't test at first with tack buttons but with the << < > >> buttons when not engaged.  Can you try that?  I think your motor.ino you flashed probably doesnt drive the right pins for whatever h-bridge you wired to it.

Very quick reply.   Thank you

I assume you mean the << <> >> buttons in the Web Control window.   I've just noticed the Web Control button is ghosted out.  

The tack function was working with my previous configuration on the same hardware; until Openplotter it got corrupted when attempting to configure the anemometer.  I have not made any changes to the physical wiring or the Arduino sketch.  Both flickering LEDs on the Arduino are red along with two power LEDs.   Is it possible the motor.ino sketch has changed since my working version??? 

Tom
Reply
#4
(2026-11-02, 07:36 AM)Tom60 Wrote:
(2026-11-02, 06:33 AM)seandepagnier Wrote: since you wired your own h-bridge,  if the green and red flicker it is probably communicating but maybe configured wrong for the hardware.

I wouldn't test at first with tack buttons but with the << < > >> buttons when not engaged.  Can you try that?  I think your motor.ino you flashed probably doesnt drive the right pins for whatever h-bridge you wired to it.

Very quick reply.   Thank you

I assume you mean the << <> >> buttons in the Web Control window.   I've just noticed the Web Control button is ghosted out.  

The tack function was working with my previous configuration on the same hardware; until Openplotter it got corrupted when attempting to configure the anemometer.  I have not made any changes to the physical wiring or the Arduino sketch.  Both flickering LEDs on the Arduino are red along with two power LEDs.   Is it possible the motor.ino sketch has changed since my working version??? 

Tom

Ooops.   Just realised I hadn't ticked the box to activate the Web Control button.   Unfortunately the Tack buttons here also didn't work.
Reply
#5
you would have to share your wiring diagram or schematic and explain what you flashed to the processor for me to be able to suggest why it might not work
Reply
#6
(Yesterday, 10:42 PM)seandepagnier Wrote: you would have to share your wiring diagram or schematic and explain what you flashed to the processor for me to be able to suggest why it might not work

It is most unlikely that it is a physical issue as pypilot was working until I corrupted the OS installing another function.  However I will check all the connections to ensure nothing is physically broken.

Is there a command I can run to confirm data is being sent to the Arduino as I am not confifent I have correctly implemented the configuration in the Serial window???

Regards

Tom
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)