Setup Pypilot motor controller with MacArthur HAT - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: MacArthur HAT (https://forum.openmarine.net/forumdisplay.php?fid=29) +--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=31) +--- Thread: Setup Pypilot motor controller with MacArthur HAT (/showthread.php?tid=4638) |
Setup Pypilot motor controller with MacArthur HAT - MigGat - 2023-05-17 So today I received my pypilot motor controller and tried to set it up using this tutorial: https://github.com/pypilot/workbook/wiki/Step-14-The-Pypilot-Motor-Controller Connected the controller to 12V supply, ok But when I tried to connect to the Rpi UART0, i see that it's already used by MAIANA. Acording to MacArthur HAT docs, UART3 and UART5 are also used (or can be used) by NMEA0183 connections. So I tried to enable UART4 which aparently use GPIO 8 (CE0_N) and 9 (MISO). By doing so, i see that a new device appears as "ttyAMA1", but when I change the Pypilot app to "Enable autopilot" instead of "IMU only", i get the warning saying "The device /dev/ttyAMA0 in UART0 should be added to the list of serial ports pypilot manages": But even if I add an alias to ttyAMA1, and go to Pypilot Serial settings and add that device, the same message stays there I have no idea what i'm doing wrong or how can I start to diagnose, any help will be much appreciated RE: Setup Pypilot motor controller with MacArthur HAT - Sailoog - 2023-05-17 Ops sorry, you are doing nothing wrong. The code of openplotter-pypilot app assumes that if you enable autopilot mode, /dev/ttyAMA0 (UART0) will be always used. This checking was added because if no serial devices are assigned to pypilot, it will start fighting for all the serial devices even the already configured in other applications. But now with the MacArthur HAT you are forced to use another UART if you are already using UART0 for MAIANA or dAISY. I will publish a new version of openplotter-pypilot fixing this ASAP (maybe tomorrow). In the meantime you can try adding the device from openplotter-serial app and enable autopilot mode in openplotter-pylot app. If I am not wrong pypilot should start. RE: Setup Pypilot motor controller with MacArthur HAT - MigGat - 2023-05-17 Actually you're right. Even if I get the warning everytime I start pypilot app, it DOES work fine. I'm testing it at home, but the motor controller engages and can move the motor. So aside for the annoying warning, there's no major issue (and no rush at all IMO). RE: Setup Pypilot motor controller with MacArthur HAT - Sailoog - 2023-05-17 OK, thanks for reporting. just in case, if you use UART4 you are disabling the NMEA 2000 feature in the MacArthur HAT. If I am not wrong you can also use UART3 or UART5 and NMEA 0183 1 or NMEA 0183 2 features will be disabled respectively. RE: Setup Pypilot motor controller with MacArthur HAT - Sailoog - 2023-06-08 Already fixed in openplotter-pypilot 3.2.13 RE: Setup Pypilot motor controller with MacArthur HAT - MigGat - 2023-06-08 Just checked. Perfect, thanks! RE: Setup Pypilot motor controller with MacArthur HAT - braydengirard - 2024-05-07 (2023-05-17, 03:13 PM)MigGat Wrote: So today I received my pypilot motor controller and tried to set it up using this tutorial: https://github.com/pypilot/workbook/wiki/Step-14-The-Pypilot-Motor-Controller Could I ask for a picture of how you connected the serial connection from the motor controller to the MacArthur hat? I am having a hard time understanding where the Red, Black, Blue and Green wires should be connected on the MacArthur Hat. I have been messing around with a combination of the black and red in the 1wire 3v header and the green and blue in the NMEA 0183 TX / RX ++ -- and +- and I can not seem to get the motor controller to be recognized. I have had solid red lights on the motor controller, solid red and solid yellow, and also a flashing green TX light on the MacArthur hat. But no matter what I do I can't seem to get pypilot to recognize the motor controller. Thanks! RE: Setup Pypilot motor controller with MacArthur HAT - braydengirard - 2024-05-07 (2024-05-07, 03:24 PM)braydengirard Wrote:(2023-05-17, 03:13 PM)MigGat Wrote: So today I received my pypilot motor controller and tried to set it up using this tutorial: https://github.com/pypilot/workbook/wiki/Step-14-The-Pypilot-Motor-Controller I actually solved this, for anyone else looking who is connecting a Pypilot Motor controller to a MacArthur hat the data wires (in my case blue and green) need to go to the Tx- and Rx- of the NMEA0183 #1 connection. You can then connect the black and red wires (3v and ground) to the 1Wire connection (just leave data empty if you aren't using other 1 wire devices). Then on the actual motor Controller make sure if you are connecting a Raymarine ST4000 motor (or something similar) the positive and negative leads from the motor go to Motor A and Motor B connections on the Pypilot motor controller (try both polarities if things are running backwards). Finally the simple part is to connect 12v external power to the motor controller on the + and - 12v connections. Now on OpenPlotter on the Raspberry Pi 5 you need to enable UART2 (NMEA 0183 1) or if you use NMEA 0183 2 then UART4. This part got me as these are not the same as on the Pi4. PyPilot will still say no motor is connected (I think this is a bug because I'm using an unexpected UART # ???) but the autopilot will work and spin the motor when I change heading in the web interface. Hope this helps someone and if I am giving any incorrect info please let me know, still figuring this all out! RE: Setup Pypilot motor controller with MacArthur HAT - Sailoog - 2024-05-07 Ops, I am surprised you made that work because these NMEA 0183 connectors were not designed for use with no NMEA devices. The Pypilot controller is not NMEA, it is UART and will only work correctly connected to Raspberry UART interfaces. I think your system is only working in one direction right now. When we designed the MacArthur HAT, we thought that the pypilot controller would be fine to connect directly to the unused Raspberry UART interfaces via the GPIO header, but the pins are too short so we will have to find a solution. RE: Setup Pypilot motor controller with MacArthur HAT - braydengirard - 2024-05-07 (2024-05-07, 07:12 PM)Sailoog Wrote: Ops, I am surprised you made that work because these NMEA 0183 connectors were not designed for use with no NMEA devices. The Pypilot controller is not NMEA, it is UART and will only work correctly connected to Raspberry UART interfaces. I think your system is only working in one direction right now. Ok so if I understand correctly it should be connected blue data wire to pin 8 (GPIO14) and green data wire pin 10 (GPIO15) and then still red and black wires to the 3v and gnd of 1 wire port? or are there spots on the GPIO header for the power and ground as well? If this is the proper way but the pins are too short how would you recommend I connect my motor controller to the setup? Is some sort of serial adapter to USB an option? If so what would you recommend? I have a long trip coming up and need to make sure I can get this working! Appreciate all the support |