Re: [microtransat] AI code

20 views
Skip to first unread message

m castle

unread,
Apr 16, 2026, 8:36:55 AMApr 16
to Microtransat
Hi Alec,
Thank you for posting your code, I would like to make some suggestions to help test the code, and possible ways to improve it.  I have developed lots of Arduino code previously, including on an ESP32 (as your code uses).  I don't have experience with freeRTOS, but I think it might be an overkill.  

I think the main problem to be solved is testing the navigation code, and previously I did some work using AI to generate test code that interacts with the navigation code.  I wrote (AI wrote) some code to generate NMEA messages for a boat travelling in a certain direction, I fed the NMEA messages into the navigation software, and the nav software gave steering commands back to the test software.  Using this setup I found some bugs such as the steering went wrong when the boat was on a northerly course, oscillating between +10 and -10 degrees. 

My suggestion is to run the ESP32 firmware on a PC with test software, so you can simulate travelling around some waypoints in a circle. I wrote the test software in Python, since AI seems to be good at writing Python.  You can add in a simulated compass by generating random course changes, and see how the navigation responds. 
I think you don't need a RTOS, especially since it's best to switch off the ESP32 for as much of the time as possible.  I'm thinking about using a Raspberry Pico, as it has lower power consumption than a ESP32, and can be switched into lower power modes.
Michael    


On Thursday, April 16, 2026 at 09:00:23 AM GMT+1, Alec Adams <alec...@gmail.com> wrote:


Hello Alec and Shirley here. We have almost finished a program for our boat using AI. Neither of us have coded before but we did take a months course on the internet on coding before starting this venture and it's taken months and it is still not finished as we have to add feedback for the rudder and mast position .  Not sure about making it public on GitHub yet but we can do a text version of what we have so far. At the moment it has an SD card and an Oled on it for testing. We also have a  flowery notebookLM description of what this code does https://notebooklm.google.com/notebook/d5379604-a77b-4666-a839-7f20a2e9dadc. This is the code any suggestions or ideas, we would be grateful for.  Repository: alfromuk/mighty.git
Files analyzed: 21

Francis Roussel

unread,
Apr 16, 2026, 10:28:02 AMApr 16
to Microtransat
Bonjour à tous,

Pour suivre mon idée d'une petite boîte noire destinée à être facilement construite et pour être placée entre le Rx de radiocommande et les servos de n'importe quel voilier existant, j'ai testé et adopté le ESP32 S2 avec la platine SD qui a l'avantage de se placer dessus sans avoir de circuit imprimé à faire, le GPS  Beitian BN-280 bien que cher  par rapport à d'autres a l'avantage d'être très compact. L'écran https://fr.aliexpress.com/item/1005011907100931.html bien que petit me semble suffisant si on veut absolument un écran, je préfère me servir de la fonction wifi et utiliser le smartphone comme écran pour les quelques configurations et bien pratique pour récupérer les fichiers de trace GPS lesquels  codés en GPX permettent une visualisation immédiate du tracé sur https://www.mygpsfiles.com/fr/ lequel permet d'afficher facilement plusieurs traces ou d'autres.(je peux fournir la routines tant pour le wifi que pour le gpx).
Enfin pour les servos un seul gpio est nécessaire et si c'est pour piloter un moteur brushed j'utilise https://fr.aliexpress.com/item/1005006112400103.html.
C'est le cas pour mes gros servos treuils de voile avec comme retour de positionnement un AS5600.
Enfin 3 GPIO pour récupération du signal d'un Tx de radiocommande (safran, voiles et coupure de la transmission pour passage en mode autonome=
Pour la girouette idem un AS5600 et le BNO085 comme IMU.
Sauf erreur je pense que le compte de gpio sur le S2 est bon

fr

Hello everyone,

To pursue my idea of ​​a small, easily built black box to be placed between the radio control receiver and the servos of any existing sailboat, I tested and adopted the  ESP32 S2    S2 with the  platine SD   slot. This has the advantage of being mounted directly on top without requiring a printed circuit board. The Beitian BN-280 GPS, although expensive compared to others, has the advantage of being very compact. The screen (https://fr.aliexpress.com/item/1005011907100931.html), while small, seems sufficient if a screen is absolutely necessary. I prefer to use the Wi-Fi function and use my smartphone as a screen for the few configurations required. This is also very convenient for retrieving GPS track files, which, encoded in GPX, allow for immediate visualization of the track on https://www.mygpsfiles.com/fr/, which makes it easy to display multiple tracks or other data. (I can provide the routines for both Wi-Fi and GPX).

Finally, for the servos, only one GPIO pin is needed, and if it's to control a brushed motor, I use https://fr.aliexpress.com/item/1005006112400103.html.

This is the case for my large sail winch servos, which use an AS5600 for position feedback.

Finally, 3 GPIO pins are used to receive the signal from a radio control transmitter (rudder, sails, and to cut the transmission for switching to autonomous mode).

For the wind vane, the same applies: an AS5600 and a BNO085 as the IMU.

Unless I'm mistaken, I think the GPIO count on the S2 is correct.

fr

Alec Adams

unread,
Apr 17, 2026, 12:54:08 AMApr 17
to Microtransat
Hi Michael, thanks for your answer. Every time we have tried to make a simulator we have had a hard time to get it to work. In the end it seemed that we spent more time trying to get a simulator up and working than working on the code itself. Hopefully walking round a field will give us the data we need. We did spend most of October following the instructions that AI gave us to build a simulator from the ground up. The laptop was split in to with one side running Windows  and the other side running Linux, Only to find out that we had made a copy of Aurdupilot which we could have downloaded from the Windows store in a few minutes. All that work, the air turn blue for a while. We did try to use the downloaded version but again we spent more time messing with it rather than sorting out the code we wanted. As for freeRTOS we like that system and feel that it does split the complex mathematics up but we are always looking to improve the code and you are the second person that has said it might be overkill. 
Reply all
Reply to author
Forward
0 new messages