| |||||||||||||||||||||||||||||||
Adding Radio ControlUpdate 01-10-2021I have been using the mower to take photos of grass. Everything works fine and I collected about 1000 images. The problem is getting images of 'not grass'. Concrete and pavements are ok, but in order to capture the inside of a bush involves me climbing into the bush with Moana and a laptop. I can't get many photos this way and I've been getting some strange looks from the neighbours. I need a better plan. Wheels Revisited (again)One problem is the locomotion wheels. Although ok for grass, when it comes to gravel, roots, bark etc, they dont really cut it. So the first thing to do is upgrade the wheels yet again. As we were in a second lock-down, I was quite limited for choice but lawnmower wheels seemed to be an 'essential item' so I bought some on-line which have an 210mm diameter and better grip. I knocked the bearings out and epoxied these onto the original wheels as a stopgap, but this seemed to work quite well so I've not done anything further. ![]() Integrating Radio Controls with ArduinoI was thinking it would be really useful to remotely control the mower so I can drive it in and out of bushes without needing to dive in there myself. Hopefully, this will speed up my image capture process as it will take ages otherwise. Rather than modifying my Xbee link and adding a joystick, I thought I could use a radio control transmitter (as used to control planes and drones) to steer the mower and hopefully enable/disable the camera remotely. Further research shows that RC transmitters also support telemetry back from the model. I will need to work out how to do this later but for now, I need to work out how to integrate radio control with the autonomous lawnmower. RC transmitters support several channels. I reasoned that I need at least two joystick channels (throttle and steering) but it would be very useful to have multiple switch channels to control features on the mower (eg camera enable, kill motors, turn on distance sensor etc). I bought an 8 channel transmitter which may be an overkill but I reasoned that I can reuse the transmitter on several projects so having room for expansion is worthwhile. And when I work out the telemetry side, I should be able to send status text and codes back to the transmitter. Since radio control models are full of servos, the RC receiver outputs PWM signals, one per channel so it is possible to use pulseIn() to measure the pulse width. This ranges from approximately 1000uS to 2000uS at extreme ends of the joysticks (measured on an oscilloscope). This is a whole new world for me and it took a little time to learn about radio controlling models. However, once I understoold the binding to transmitters, I wired one channel up to an arduino, used pulseIn() and all worked fine. However, when using multiple channels, pulseIn() did not work as it is a blocking call and you need to know the sequence the channels are decoded. I decided to write an interrupt library to overcome this and after some fine tuning it works well, being extensible from one channel up to 8. I am currently using 4:
These last two are on a three position switch. A three position switch essentially gives you two controls on a single channel. The Radio Control LibraryI wrote this as a arduino library since it will be useful on a multitude of projects. The only requirement is that you need to connect the PWM outputs from the RC Receiver to an arduino pin that supports interrupts. This limits your choices on an UNO (onluy 2 pins) but on an ardiono Mega, there are many to choose from. However, as most projects are on a UNO, I used the PinChangeInterrupts library as well, so extra interrupts can be use on a UNO. I don't usually dump all the code in the documentation but this library is a little unusual as it uses interrupts so this is in case I need to recall it later. The code, examples and keywords.txt are in the RadioControl subdirectory under the libraries directory (under arduino home). You can then include the library using the Arduino IDE library manager. RadioControl.h
RadioControl.cpp
RadioControlExample.ino
With Moana's pimped wheels, driving across dirt and into bushes was much easier. The radio control technology is very mature, it is possible to control the mower from hundreds of meters away. I managed to get over 1000 images in 30 minutes so my foray into Radio Control has been well worth the effort. Another couple of sessions and I should have respectible image set and then focus on selecting an appropriate ML agorithm. Here you can see the radio receiver mounted on top of the Pi ![]() And this is moana ready for some off-grass image collection. ![]() Maybe a small video here of moana being driven to collect photos Sepember 2021 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||