I have wanted my rover to talk since the beginning. I started out using the esp32 talkie library, but it was very limited as it only had around 100 words to work with. Next thing I tried was using the Google online TTS service, the voice quality is very good but it’s very slow. I have always wanted the voice generated on the rover, I was originally looking at using one of the Raspberry Pi board to do it,
I recently discovered SAM speech generation From what i understand this is originally from an early 90s Atari computer and its been ported to esp8266 and esp32. For what it is the audio is pretty decent considering its all on the esp32 flash memory entirely offline. it would be cool if ardupilot could do this using lua.
Using that as a base I have created a mavlink compatible TTS system using a ESP32 and I2s audio output. Its still a work in progress but it can read out mavlink messages, I want to add some other parameters to get read out like waypoint number.
This is what I’m using for testing at the moment its just one of those cheap ai assistant boards.
I have made a basic visual navigation system using just an esp32-cam and a web browser, it’s basically doing automatic colour tracking of a point in front of the vehicle and adjusting the RGB range to keep the focus ahead on the road then steering towards the biggest blob. Its also got the husernet vpn so it can work remotely. its not very fast at barely 1fps but for my rover thats fast enough.
The sliders control the auto filter, the way it works is that it wants to keep the tracking box inside of the rectangle on the screen by taking a sample from the proble point and then adding the RGB Range value + and - to give the range of the filter.
It will ignore everything outside of the grey box, the top of this should be on the horizon to filter out the sky and anything above the rover. The sides should be adjusted depending on the speed and how twisty the path is, a narrower box would be better on a straight narrow road.
When the tracking box exceeds the grey box by the Exit Tolerance value, it will start to shrink it down based on the growth delay value to keep the tracking focused on the centre and down on the road. When it’s under that value it will increase it until the filtered area exceeds the box by the Exit Tolerance value where it will start to shrink again.
I will eventually look into a way of adjusting these automatically based on the rover speed and turn rate. I used Google Gemini for most of this as javascript might as well be Greek to me.
when processing on the same network its much faster
I have a better camera coming but with its automatic RGB+probe it can handle higher speeds much better than I expected even with it out of focus and part of the lens damaged.
Its just been using the Halow adapter for internet and now its spring it can stay running full time without having to sleep or heat the battery so it was time to start driving again, unfortunately I still have an unresolved issue with the hoverboards where they won’t start up properly, I have to physically unplug the 5v and plug it back in to the rp2040 controller that operates them to work, I’m not sure why, I think one of the hoverboards has a fault and it’s injecting a small voltage, enough to keep the RP2040 in some kind of failed start up state. To get around the issue I have just installed a dpdt relay that switches the positive and negative. it starts but its just a hack to get it working for now until I eventually replace them.
When I got the motors working again I went to do some waypoints but something was wrong with the GPS, I was pretty sure there has been some water intrusion since it wasnt lighting up, some of the sealant looked to have went dry and powdery and I thought that was where water has got in. Luckily it looks like the damage is limited to the canbus adapter mounted under it so I think the sealant around the GPS has been fine but the water has actually ran down the wire conduit that runs down the centre of the mount from the mast, Because the mast is sitting slightly forward it could run down into the bracket and the canbus node that sits at the bottom, so I need to seal it and possibly print it again with a conduit going up. I should also look at my other devices like the lidar and AI camera for water intrusion.
My second GPS is also not being detected, one of the antenna mounts has snapped but it should still be detected, so that will need to still be investigated.
on closer inspection it looks like the L431 can node is totally fine It was all lit up still before I removed it, that’s why I believed the water damage had to be on the GPS. I think the GPS should work fine as it looks like it was just the ground wire to the gps corroded off so it would probably work fine once its repaired it can go back to doing laps of the garden.
after just a few minutes with alchoholl and running a soldering iron along the pads, it almost looks new again. I reconnected the wires after cleaning and re tinning the pads and its back up and running!
I was also having some kind of weird issue with my rp2040 mavlink serial splitter where it stopped working after a few seconds, basically the usb process is done with a 1ms timer that causes the chip to become unresponsive for that time causing issues reading the rest of the serial ports, i had re-enabled the USB when trying to diagnose the motor issues not realizing that I had created another issue. once it was disabled it worked like it should.
So I have decided to build solar rover 2, solar rover 2 is a distilled version using ideas and parts from my urban rover, solar rover and 250g quad. by the time I modified and upgraded everything there would have been nothing left of the original rover and I would have been left with a pile of old parts so it just makes sense to build a second one to integrate all the new ideas into rather than tearing apart the old one.
After testing the power consumption of my 250g 1 hour quad, I realized that its power consumption was only 2.2w when idle with RC and video, an incredibly low number. so the main goal for the second rover now that i know how to keep them alive is to be as efficient as possible, The target is for it to be able to drive with less than 10W of power in order to travel as far as it can, so efficient running is far more important than efficient sleep on this. so I started thinking that less might be more for this rover, so rather than using another pixhawk I am using the most basic F4 controller I can find, It should reduce the power consumption significantly since its a single chip and no redundant sensors with no CAN or RTK just a basic M10GPS, and a pair of esp32 camera boards.
Since I am building a new one I could redesign the chassis. The stacking euro crates work well for development since they are cheap and easy to modify, but they aren’t secured together so it ends up being a lot of work to do something simple inside it as you need to unbolt or unstrap it all depending on how you secured it. it also tries to twist itself apart if you go over uneven terrain.
Solar rover 2 will use a similar design to my urban rover being built with aluminium extrusion on the bottom of a taller heavy-duty crate with a lid but using 6 wheels like the solar rover. This gets rid of the metal hoverboard chassis and probably 6kg of weight, at the moment the wheels are just hard mounted to the bottom but its eventually getting mars rover style rocker-bogey suspension, the extra wire for the wheels is there for it, but that is complexity for another day. I really thought about going with 4 wheels as it would be more efficient rather than 6, but it just wouldn’t look as cool.
The power system of the first solar rover was designed with specific goals in mind, the main ones were:
stop the battery from running out.
stop the 5v and 12v power rails from browning out if the main battery ran out and causing flight controller corruption,
keep it alive during winter by going into deep sleep and heating the battery.
black start capability
Run from a 48v ebike battery as I had a spare,
use hoverboard controllers as I had a lot of them I picked up very cheap.
it had to switch power for every device on the rover device as I was testing power consumption so needed to be able to check each module one at a time.
Getting sleep working on the esp32 has pretty much solved the long term power consumption problem, since It’s now possible to consume only a couple of milliwatts when it’s asleep the main battery should never run out of power, that makes all the extra UPS boards and backup batteries redundant.
The flight controller brownout corruption problem has been solved by replacing the matek h743 boards with F4 boards like pixhawk 2 and f4 also making the UPS redundant since it was fundamentally an issue with the H743 chip rather than the power supply. other manufacturers started to document issues similar to what I was finding. high end boards like the cube use a much stricter power management chip that doesnt allow startup unless the voltage is stable, avoiding the issue. .
The hoverboard controllers are getting replaced with simple foc controllers, They are just so much more efficient using less than a watt at idle compared to the hoverboards that use over 10w each. It also gets rid of the rp2040 controller and relay bank I needed to switch power and send commands to the hoverboard controllers. I can also set the esp32 simpleFOC controllers to light sleep and instant wake if i want to drop the power down to milliwatts at idle but at the expense of not being able to actively brake the wheels meaning the rover could roll.
The esp32 PLC board is being skipped and replaced with a 4ch relay board. I don’t need to be able to switch every single thing so it’s been simplified to just 4 for lights and 1 SSR for main power that can be switched from the esp32.
By dropping main power to 12v it gets rid of a bunch of voltage regulators that both use power and cause RF noise. Things like the flight controller can be powered directly from the battery rather than via a noisy switching voltage regulator same with the lights and a high quality 5v regulator takes care of everything else rather than having to go from 48>12 then each device having its own 5v regulator.
I was recently given a faulty 36v ebike battery, it was just some damaged wires, but the cells were all fine. So I bought a 12v 18650 battery case that holds 30 cells in a 3x10p configuration and spot welded the cells together into the new case. After testing, it shows a capacity of around 23ah. more than good enough for this.
The Raspberry Pi boards I’m using on solar rover use around 4 watts each, not a huge amount but I am replacing those with a few esp32 s3 cam boards and an amb82mini ai camera, they are much slower and more limited in scope but they also use a fraction of the power. I am also replacing the lidar with some sonar modules as they tend to be more reliable in bright sunlight and rain.
With all these changes I think I can get the idle power consumption down from 30w idle down to less than 10w Driving, with the greatly reduced power consumption I should be able to use a solar panel less than half the capacity to get similar performance resulting in a much more compact rover allowing it to go outside the park, The first rover is also so wide it cannot drive on a pavement without using up the whole pavement and getting uncomfortably close to parked cars forcing me to drive it on the road meaning I have to escort it everywhere. rover 2 should be able to fit on the pavement due to it having a much smaller wheelbase and solar panel, It also fits on my bike trailer now making it much easier to transport further afield.
It’s still a work in progress, The 3 simple FOC controllers, RP2040 Serial splitter, motors, flight controller and main esp32, and mLRS RC are mostly working,I have done some testing indoors in manual and acro mode so it drives with RC, I still need to get the telemetry from the motor controllers working, GPS, compass and cameras installed and the sonars, lights and solar panel wired in.
first tests show it only using 2.6w with the flight controller, recevier, gps, RP2040 serial splitter, ESP32 S3 and 3x foc controller running at idle, with the modem and esp32 camera running will probably bring that up close to 7W when idle.
I just couldnt get those other simpleFOC controllers to behave properlly, i think they are just poorly designed with lots of noise and poor voltage regulation. I bought one of these controllers to test and the difference is night and day, they just work and havent glitched or tried to self destruct once. probably due to the signal wires being nowhere near the power switching so i have ordered another 2 so that should hopefully fix all my motor controller issues.
The new design is so much more efficient that it can move on only 10w of power, at idle with everything on its only using 6W, compared to the 25W of the old rover. most of this is just due to a simplified minimalist approach.the panel going to be slightly bigger than the rover and only 50w making it much more compact.
yesterday I had it out for its first drive around the block and it managed around 75% before the cheap tapo camera i was using started to lag so i had to walk it back the rest of the way.
For driving i was using my Husarnet Serial VPN adapter. it’s basically just making a tcp>serial bridge and sending it over a ipv6 VPN, because its using ipv6 it was a pain to get working as a lot of libraries don’t support it, this is the main reason its TCP and not UDP as i couldn’t find an ipv6 UDP library. The main issue connecting with TCP is that if it disconnects you will need to manually click reconnect on mission planner it wont automatically resume.
The original program was just a proof of concept, it was getting barely 200bytes/s I suspected it was a combination of VPN encryption and serial writes slowing down the loop, so I have put the VPN process on its own thread onto core0 with the Wi-Fi and have 2 separate threads handling tx and rx, giving me over 1.5kb/s now.
I have taken the same vpn process setup and now applied to to a esp32 camera, with the resolution at 320x240 I am getting close to 30fps now, it gets dramatically slower with higher resolutions.
my ardupilot simpleFOC motor controller is working perfectly now, I have added PWM input so it will now work like a regular ESC, it’s update speed is much faster than mavlink servo packets but it can use either. FOC left and right motor control are in separate threads on the core0 that wifi normally uses so they can run much faster than sharing core1 with everything else, there was a small issue where it won’t start up properly if it can’t move its wheels. its something to with its detection, its only an issue on startup where the wheels seem to need to move slightly to be able to function properly. Its only around a degree but it starts to go in the wrong direction or cogging if it fails the detection. Once I set the motor.zero_electric_angle and motor.sensor_direction it stopped moving on startup and the motors always go the correct direction.
Current and rpm monitoring has been enabled, they are sent to the flight controller as named floats, I still want to add power limits and velocity mode to make it drive more predictably, torque control is difficult to steer over uneven terrain as each side looses torque as wheels get lifted off the ground. velocity locks all the wheels to the same speed acting more like locked diffs giving it much more predictable movement but it runs its own pid to make it work and tuning that has been problematic.
i designed a new tyre for it and printed it in TPU, the other tyres I made used some parts of other tyres and had some strange internal geometry, these are a clean build and can be printed with no infill.
Solar rover 2 is more ardurover centric with the idea that the flight controller will be on 24.7 and all controls run through it. At the moment its connected over LTE at around 2kb/s that works out to around 60gb a year so the 120gb it has will be more than enough to keep it on at all times.
I have been working though the rest of my code with gemini since most of it was originally copy and pasted together to make something function but was totally wrong.
Serial bridge has been optimised so it works rock solid over LTE at over 2kb, its essentially a transparent pipe so everything including FTP works perfectly. it might go faster but i haven’t tried to push it.
my mavlink serial multiplexer works properly now with buffers rather than trying to push every byte one at a time so is now much more stable with higher datarates.
the 5 SR04M sonars are wired into a RP2040 and sent to the flight controller over mavlink, the 2 at the front of the rover do some trigonometry between the pair of front ultrasonic sensors to check if It’s something in front of it or off to the side, then there are one on each side and one facing back.
I am wanting to use a joystick for control but mission planners joystick control is rather limited, so i have built a USB > mavlink adapter so I can use a usb joystick then send mavlink_msg_radio_rc_channels to the flight controller over telemetry either LTE or UHF, bypassing mission planners limitations. I have been using a really old cheap usb steering wheel up until now but its only got a few buttons and mission planner doesnt support more than one at a time.
the idea is that they will be able to connect each usb controller to a ESP32 S3 then to each other over serial then it can send all 32 channels over the telemetry.
Another thought was that EdgeTX and openTX support 32 channels but normally you cant use all of them, turns out you actually can if you connect it via usb. channels 17-32 will operate as joystick buttons.
I have decided to upgrade the lighting system, the 12v lights i was using aren’t very efficient and need switching hardware, its now running 144, RGB leds, with a 64 led grid for displaying 8x8 images.
It’s has had some test laps around the garden and it had some issues,
I have had to step up the voltage to 24v the SSR I was using overheated and glitched causing the 12v to get too low and the controller glitched and burned a controller the so to make sure that doesn’t happen again It’s got a small 3.3v UPS regulator to power the esp32 ESC controller separate from the motors, and since everything in the system is rated to 24v so it was just a matter of adding a second battery, so if the voltage is pulled down it can’t glitch or do anything weird on startup since it can now start the ESC esp32 with 3.3v without power to the motor mosfets and the higher voltage will half the current through the power system.
I have ESC telemetry working for currents and voltages so I am going to add some power limits, I want a total consumption limit and per wheel to limit any risk of overheating.
I was getting the occasional stutter from the motors, after some testing by monitoring the raw PWM value i could see it would jump around occasionally then i remembered i have seen this before when using RC PWM input with the original hoverboard controllers and all it needed was some 100 nF capacitors between the PWM signals to smooth it out and ground to stop the glitching.
I am waiting for a MPPT charge controller since the one I was using wont work with 24v batteries.
Simwheel mavlink interface is complete with modes, relays, do set servo, geofence, avoidance, gimbal modes and 12 analog inputs from the wheel, peddles, joysticks and hat.
Because I was using a bunch of ESP32 S3 boards and spacing and wiring was starting to become an issue, since most of the functions I was using didn’t need many pins I looked at ways of stacking them for functions. There are solder pads on the bottom of the esp32s3 boards separate from the pins where add-ons get attached to the esp32 like the i2s audio output board.
The first runs the ESP32 Husarnet VPN and a mavlink bridge that lets me connect to it over LTE
The second is the main controller, Is main job is to gather vehicle sensor information and send that to my server along with receiving commands.
Third is for TTS and the RGB leds, text to speech takes a lot of memory and RGB leds need a lot of cpu time if you are doing complex moving patterns so they run on their own board and assigned to core 0 and core 1.
the last one is the data gathering board, that gets things like ais, adsb, rtcm and weather from the internet.
some
To receive data they all share the TX incoming from the flight controller. to send data they all have a serial bridge set up so each ESP32 forwards the mavlink packet down the stack to the next chip until it gets to the bottom where its sent to the flight controller.
I have finally got it driving without any issues so i took it outside for some basic testing and tuning.
The tyres are a massive improvement over the solid hoverboard tyres or the hard plastic tyres i was using before, they really smooth out the vibrations and let it grip.
Now that its driving and its proximity sensors are all working I want to make it driving some distance by itself. So I’m adding driving cameras for monitoring along with the the visual navigation camera next so it can follow a path. It works but there are still some issues with the way I have it sending commands, I need to get it working with guided commands rather than rc override so it automatically engages when i enable guided mode.
I had been using some tyre designs I found online but they didn’t quite do what I wanted so I designed some from scratch, my main goals were:
It had to be rounded so that it could turn on the spot without the sidewall of the tyre digging in,
Have tread deep enough to grip and climb a kerb without slipping
they needed to be printed in TPU with internal support to give it some suspension as all the weight is in the wheels. The hard rubber original and PLA tyres I was using before shook the rover so much that the cameras were just a vibrating blur and some bolts managed to back out. I found the spiral gyroid support worked best with low infil percentages where it gives more distributed support rather than at points in a sparse grid.
The cheap little LTE WiFi hotspot I am using has been annoying me, I used to use a mobile phone but it uses a lot of power and you can’t easily switch it off and on or restart it remotely so I changed over to the LTE hotspot, It works but it has some downsides, the signal is nowhere as good as a phone, It drops the connection for more frequently.
So my next plan is to build my own LTE WiFi hotspot using a esp32 and a SIM7600 modem. The main reasons I want this to reduce the power consumption and give me modem telemetry.
I bought a esp32 with a SIM7670G a while ago to test but didn’t get anywhere with it as I couldn’t find any good examples and AI was getting nowhere but recently I decided to have a other look at it. After some back and forth with Gemini I eventually figured out that the 7670g doesn’t have network adapter capability it was a AT command only adapter for things like httpget or JSON. It won’t work with network libraries like VPN or NAT. The good news was that it was only using around 0.8W compared to the dongle using 4 watts so there is a possibility to save some power, even if the 7600 uses double the power 1.6w would be a decent improvement.
So after some more reading I have ordered the esp32 devboard with a SIM7000 modem that has PPP capability. It looks almost identical apart from the model number and 3x the price. Hopefully the power consumption isnt too bad
The expressif libraries already have support for NAT and SIM7600 PPP connection. So it’s just a matter of pulling out the functions I need and putting it all together.
I have been thinking about how to use it and how much to integrate into it, I looked at adding the Husarnet VPN into it but i dont think it has enough memory or cpu to run that at the same time as the networking especially since its a esp32 and not the faster S3. so i think its just going to have to be kept as lean as possible to maximise the networking performance.
solar rover 3 (that will eventually be rebuilt from the parts of solar rover 1) will be designed to stay out all winter again so having the modem esp32 its self monitoring voltages, temperatures and managing power and deep sleep would minimise the amount of hardware needing power when just trying to survive the winter, it should be able to startup and talk to the server only using around 2W compared to over 10w it needed before and it should be able to do it in 10-20 seconds compared to the 2 minutes it took for the dongle modem to start up. if everything else is asleep i don’t need to worry about network performance, so using it for monitoring when sleeping wont effect it when its active.
other than power the other main reason I want to make my own hotspot was so that i could get direct access to the modem telemetry like signal strength and packet loss. these values can then be added to the mavlink radio packet and sent to the flight controller giving signal information on mission planner like its a 3DR radio. I also want it to send warning messages or set it to HOLD mode depending if the signal gets low or critical or packet loss gets too high so loss of connection is avoided rather than just driving until fail-safe that it does now. if the signal is totally lost then smart RTL could be used to backtrack until a connection is re-established.. another option is dual modems where if connection is lost it can change over to the other network and re-establish a connection.
unfortunately after some testing i got it to work but I found that the TTGO-T-SIM7600E-L1C lacks flow control so the modem is limited to 115200 baud and speed tops out at around 0.06Mbit not ideal, to get decent performance i will need to get one of the ESP32 S3 based boards that connect over USB bypassing the lack of flow control on the serial port. probably the waveshare board
the good news is that tests so far show its only using around 1w at idle, a 3x improvement over the LTE wifi dongle.
Solar rover 2 is storage, its designed to drive continuously but there just isn’t enough light for that.
so im rebuilding solar rover into solar rover 3. this is going to follow the design goals of the original of living outside and surviving the winter while driving at least a short distance each day. I have stripped down the original solar rover, its just a crate with some foil now. The parts getting carried over are the wheels with new TPU tyres, some aluminum extrusion, amd82-mini camera, matek i2c power sensors, GPS, lidar and some weather sensors, everything else is getting updated. its basically going to look like the solar rover 2 but with black tyres.
I had a lot of issues that stopped the original from being able to meet the goal of driving each day, power was always an issue, I had to figure out how to put everything into a deep sleep to preserve the very little power it got in the darkest days where it only got 2 or 3 watts for a couple of hours. with the rover powered up and everything running it was using almost 35w just idling, adding relays to shut down the motor controllers brought that down to around 10w but even 10w would totally drain a 48v 20Ah battery in just 4 days. so i need to be able to cut power to everything. I used an elaborate setup consisting of a ESP32 PLC controller so i could control power to each device on its own for very granular control, this made testing much easier as i could see what each thing used and prioritize what could run and how often to stay in the power budget, then once i got deep sleep working it was effectively immortal with power consumption under 1mw.
I have built the new version with the most efficient components to maximize its battery life so it can have enough energy do something like move rather than just checking in that its alive. I have simplified the rover significantly as the best way to save power is to just eliminate the need for the part entirely. The ESP32PLC controller RTK GPS 2x raspberry pi boards, esp32 with the weather sensors. 12v lights, hoverboard controllers, wifi camera, have all been removed and replaced with pulsed latching relays, simpleFOC motor controllers, weather sensors and addressable LEDS connected to the main esp32 that also does the telemetry uplink simplifying the setup. the main reason I didn’t do this before was simply my coding abilities consisted of copy and pasting and i had not figured out threading at that point so i needed 2 boards to handle it all without stalling. now that AI coding software has advanced to the point it can handle my human generated slop without spitting it back out. it managed to reduce my code by 75% as it turns out most of it was duplicate from copy and pasting. I have tried a few times to use AI to fix it but usually it just gave back unusable nonsense. Its also possible my code has improved enough for it to figure out what its supposed to actually be doing.
I eventually got a ESP32-S3-A7670E-4G that has the modem and esp32 S3 connected over usb giving it much faster speeds, best i have seen so far is 3mbit but thats more than enough for what I am using, the best news is that its using less than half a watt when idle, that is a 8x improvement over the cheap LTE usb dongle i was using before. I suspect there is probably a small Linux computer in the LTE dongle and thats why it uses so much power and takes up to a minute to start. this is connected in around 15 seconds letting it start up and shut down using a fraction of the power. at the moment im using the 4g hotspot example images that are supplied so i haven’t managed to add any mavlink integration yet. its only supported with the expressif IDF, so its something i will work on at some point.
another showstopper was flight controllers, H743 controllers can have their flash memory corrupted if they are not used with a power management chip to stop it trying to start if the voltage is low. this caused a lot of problems as i thought it was just a faulty Matek H743 board but after the third one i had to try something else so I went to the beaglebone blue, it has a lot of problems that i could work around but it ended up having flash corruption problems too since its a linux computer it didn’t like being switched off without being shut down resulting in corrupted memory. after this I went back to a cheap no brand pixhawk and that worked showing it was possible but I wasn’t happy about one of those boards, so I managed to find a used pixhawk 2 and its ran flawlessly since. the only small issue is that it uses a lot of power compared to something like a basic 405 with all its heated IMU, extra sensors and chips.
since i was this far in with esp32 controllers i figured why not use one for the flight controller, the esp32 is very resilient when it comes to dirty power and i don’t need any exotic hardware support like CAN so a esp32 ardupilot flight controller looks like the way to go. after reading about progress here I decided to assemble one. all i needed was a esp32, IMU and an optional SD card reader and with such a low number of parts the power consumption was much lower than a pixhawk and not far from the level of a F405 controller, The wifi probably consumes most of that. using a devboard with servo pins already made it almost plug and play.
The main issue that stopped the first solar rover moving very much was the motor controllers. the hoverboard controllers are decent for the price you pay, they are powerful and flexible but its still fundamentally a hack to get them working and they are far from reliable or power efficient. the hoverboard controllers need a lot of supporting hardware to operate them, they run very hot so cant be used sealed up, each board needs its own relay to switch it off and on and its own serial port for control and telemetry because i needed so many serial ports an esp32 wouldn’t work so i used a RP2040 pico clone called a zero. I also used it for my mavlink serial bridges but I have had an ongoing issue where it would randomly just stop working. i could run every test i could think and change boards and it would work fine but once it was in the rover it would fail to start up randomly, it was a rare occasion that could be fixed with a restart but usually it just wouldn’t start unless i physically unplugged and plugged in the 5v power to it. my theory was the hoverboards were interfering with it somehow by possibly injecting power or something else was causing dirty power to put it in a failed boot state. It wasn’t until i was rebuilding solar rover 2 that something similar happened again but just some sonars and a lidar connected. because it had only ever happened when connected to the hoverboards i just assumed the problem was connected to that but now i was getting the problem in a different application i started to look more into it. after some googling i eventually found that RP2040 startup issues are caused by the RP2040 lacking any internal flash memory so they need an external SPI flash chip and not all are made the same, the flash in some of the cheaper boards is slower than the original used in the raspberry pi RP2040 pico, there is an option for selecting to run it slower in arduino but where i have went wrong is i thought “raspberry pi pico” was the generic board but you need to scroll all the way down to the bottom where it actually says “Generic RP2040” that then unlocks the extra menus that i had never seen before where you can set the flash type and speed. by setting the /4 divider it brings the flash memory speed down to where it is stable. it could just run the /2 if conditions were ideal but some noisy power and it wont start, that’s why bench testing it inside would work fine but when in the rover it would fail.
this was what originally pushed me to find replacement controllers and to finally settle on simpleFOC, they are not the most reliable but are extremely efficient and based on esp32 making them very familiar to program. because i have full access i added PWM input for low latency direct control from the flight controller with mavlink telemetry for monitoring.
all the parts of the system emmit heartbeats so they can be monitored,
flight controller is component 1
3 simple foc controllers are set as servo component 1, 2 ,3. each are sending paramaters using named floats, they are not ideal but i cant get ardupilot to read the ESC mavlink packet.
Onboard computer 1 is the main esp32 that manages everything including power management.
All the i2c battery sensors are connected to it so it can monitor the solar, main battery and backup Battery voltage, power, current and capacity.
All the relays are controlled by this esp32 via a PCF8574 so it can power down the rover and go to sleep if the voltage gets low.
it reads mavlink sensors and data from the other computers and logs the data to the server,
it connects the flight controller over tcp to the server for mission planner to connect via socat.
it has all the weather sensors connected to it. so they can still be monitored from mission planner while everything else is shut down as it always emits a heartbeat keeping the connection alive even with the flight controller off. when in sleep mode power is cut to everything other than this esp32 allowing the total power consumption to drop to just a few milliwatts with main power and modem relays turned off and this chip asleep.
onboard computer 2 is the esp32 that handles the AV tasks so the TTS generation and the 144RGB leds are handled by this esp32. all mavlink messages are read out by the TTS so i have set up other parts of the rover to be able to send messages to be read out. like if the aI camera picks something up it can say what the obstruction is or if something is overheating.
onboard computer 3 is the esp32 that handles the online data harvesting then formatting it for ardupilot like AIS, ADSB, weather, waves, pollution.
peripheral is the rp-2040 that acts as a serial bridge for the motor controllers and lidar,
uartbridge is the rp2040 that links the onboard computers.
I am looking into an alternaltive to the serial bridges, i might change them over to wifi at some point to simplify the setup as none of it is critical its just sensor data.
another issue was using drone engage for video and telemetry. when it connected everything worked perfectly but cloud.ardupilot.org can have issues at times letting you log in, so for reliability you need to host your own copy unfortunately you need to do some special router configuration to make it work that i couldn’t do on mine. power consumption is also an issue, its only 3 watts for a pi zero2W but that is a lot compared to something like a esp32S3 cam that is only using around 0.8W. On solar rover 2 i have fixed this problem with husarnet vpn on esp32 but its a total overkill solution. i dont need it appear to be on the same network and i don’t need encryption it just slows everything down, I just need it to send data to a serverthe that i can view from another client. getting telemetry working was relativity simple, just a serial>TCP bridge on the esp32 and and a computer with a public address that can run SOCAT to bridge the TCP streams so both the rover and mission planner can connect as TCP clients, This setup is so much faster than husarnet and needs so few resources that it can just be added to one of the other boards removing the dedicated esp32 and reducing power consumption. https://hub.docker.com/r/alpine/socat
getting the video working has been more of a challenge, originally i wanted to have my AMB82-mini AI camera stream video but the software just doesn’t exist for that board to thesend a video stream like h264 to a server so plan B is a ESP32S3 cam. but trying to find a way of sending video from a esp32 to a server that can then be viewed from a client has been challenging almost every video example wants the camera to be the server but that is not possible using LTE without paying a lot for a static ip and running a router onboard. so i need to find a way of sending video directly to a server that could then serve the video to a browser bypassing the need for any VPN setup.
my first plan was to try and copy what i was doing with socat but I still needed a way of sending a video stream to it and that wasn’t possible, so my next plan was a websocket server to serve uploaded images to the client since the esp32 doesnt actually do video but a stream of jpg images and after getting an idea of what i was needing to make it work i started looking for esp32 cam websockets when i found this, its essentially 2 scripts, one acts as a server and receives jpg frames from the esp32 and the second serves it to a webbrowser. it needed some modifications to get working in docker and on a esp32 S3 cam but now its running and its so much faster than Husarnet since i dont need to worry about encrypting anything it just spams jpeg images to the server. GitHub - Neumi/esp32_camera_webstream: Streams ESP32 camera images to web backend and forwards them to a website in realtime. · GitHub
now that i have a way of streaming video i wanted to try and adapt it to the amb82-mini camera, and went looking through its examples for a way to upload images to a server. I got it working by sending jpg images like esp32 does bypassing all the video problems entirely, its nowhere as sharp or fast as a proper X264 stream and its using a lot more data but its enough for my needs and speeds im going, this also works with the NN object tracking overlays meaning i can finally see what its tracking remotely. I can also make a ardupilot specific OSD, i have made a basic one years ago that had voltages and a few other parameters but now its streaming properly i will look into a proper overlay.
I have been trying to find a way of easily sharing the robot with the public in a simplified way so I have integrated discord into the main esp32 s3 and the AMB82 AI camera, this way it can post its vitals as a bot on discord from a mavlink telemetry stream like satelites and voltages and photos from its camera online for people to follow, it is also capable of taking commands from discord so eventually i can let people type where they want it like !forward 100, !left 90 to go or what to point the camera at. !forward, !mnt iss, !mnt dog at the moment its just posting a photo when someone types !photo.
I will probably share it with a big QR code on the side of the rover.
The amb82-mini AI camera will be getting a mic connected to it as I eventually want to hook up a LLM to it so it can have a conversation with people and respond to verbal commands.
the plan is something like this
speech is recorded with a i2s mic on the amb82-mini and sent to whisper API where it is converted to text and sent back to the amb82-mini. where its posted using the the LLM and to discord TTS along with a photo so the LLM and people can reply with !say.
since the camera will be connected to mavlink telemetry I want to be able to ask it the status of parameters. like “what is the value of servo output 4” and I want it to be able to reply “the value is 1500”, because i have onboardcomputer2 running the TTS all I need to do is put the reply into a mavlink message and it will be read out automatically.
Since it has the NPU it can do real time tracking of objects in the coco database like people, cars, cats, dogs, and various other objects. so something like " track the closest person" would follow them in real time at 7fps rather than seconds per frame of using the LLM.
I have integrated the sendTrackingStatus mavlink packet so it can feed back to the flight controller so it can follow with the gimbal automatically.
I want the Vision LLM to work out what its looking at and what it needs to do to complete the action, that can then be sent back to the rover as a command like guided or move the gimbal.
or “this is from the onboard camera, look for the path in the photo, if it cannot be found move the gimbal and try again, once path is centred in camera use the gimbal angle to set a guided command to get back on the path.”
I eventually got around to looking into this and its much more than I initially realized, It’s not just labelling everything on screen, its conceptual tracking. so you can describe an object for it to mask or box. so most tracking models have to be pre-trained on every variation of what you want to look at to get good results, this breaks down the object into parts so a dog isnt just a dog, its a mammal, with 4 legs, brown black white fur, ears, teeth, collar, lead, so you can set it to look for variations of objects like “dog with red collar” i dont think its very useful on its own but i think when combined with a LLM it can bridge the gap between the slow LLM and real time control.
it can also do depth estimation. you need to calibrate it to your camera to get good results
The main use I’m looking at is for segmentation, it understands what a road is. so you can say track the road and it will automatically segment the road and find the centre.