Beacon (IR?) for simple navigation outdoors
TL/DR: Circuit recommendations for simple robot navigation outdoors seeked, perhaps IR.
I've been tasked with developing a "working" prototype of a robot navigating on a driveway outdoors. If approved, I'd get paid for the effort, parts, and for the documentation. "Working" = it's more about showing what's possible with fairly low-tech solutions, pitfalls, costs etc., than something that has to be scaled up.
In this first version it would be ok to only have the robot going back and forth, more or less in a straight line, in next project I might want to expand it with more advanced sensors and navigation (e.g. GPS-RTK), but that's out of scope right now.
In addition to travel back and forth, the robot will be equipped with another separate device that I can disclose first after the project is completed. The other device has its own circuit and power source. Some simple serial communication might be needed between the P1 and the separate device.
I've been studying (and discussing with ChatGPT) different options, putting reflective markers on ploughing poles, using long distance RFID-tags, Bluetooth solutions etc. As the first version should be quite simple, I thought about using a IR-beacon (or a few) at the start of the driveway, and equip the robot with two IR-receivers. So the robot would just "home" in on the beacon, similarly as many robot vacuums do.
Line-following would probably be even easier than IR, but no permanent painting can be done on the driveway, also snow/ice/uneven asphalt will play a factor.
The driveway is ~30 meter x 3 meter wide, so distance might become a problem with IR. I'd though be satisfied with getting 5-10 meter range. Let's assume the robot is only working during dark hours without any light interferences. The weather is a factor, but for this POC I'd ensure no harm will be done to the robot or to the electronics, I'll also 3D-print enclosures for the electronics.
The robot I'd use is a Wild Thumper I already own, it's equipped with a Propeller Project Board and working pretty well.
Any thoughts on this?
If IR is the "easiest", any circuit recommendations for the beacon and for the receivers?
Comments
I work for a laser tag company. Our "taggers" use IR, so the parts are common on both ends. That said, we do run the IR LED through a lens and at very high power (about 1A when the output is on). The LED tolerates this because the modulation frequency is 56kHz, and the bit timing is pretty short (longest is 2.4ms using SIRCS protocol). We play outdoors in the daytime without a lot of problems. We once did a night test and got about 1500 feet.
Thx Jon! I thought laser tags use laser, but guess IR is safer than laser. Good to know long distance is possible with proper design.
I remembered I bought the set including the book "IR Remote for Boe-Bot", so will refresh my memory around IR using a BOE or an PAB. For this POC the beacon could even be a Sony Remote controller if the range is > 5 meters.
Hi,
you don't say much about the precision needed and other restrictions, so it's hard to answer.
For low cost odometry is interesting, a compass and ultrasonic beacons are possible perhaps too. Synchronised Ultrasonic beacons would give distance from time of flight like GPS satellites. One would have to find a way to deal with wind.
Precision differential GPS is hard to beat though....
Christof
Valid comment!
It does not need to be that precise for this first version, it would be ok if the robot veers 0.5 meters or so to each side of the imagined center line as long as it corrects itself. Lenght wise it would need to stop before hitting a wall, so need to put a sensor for that purpose.
Using a compass would indeed help as long as it does not need to be completely flat, have varying experience from compass sensors. The robot has DC-motors and no odometry is built in, an home-made solution would be to paint a white strip on the black wheel, and using a proper sensor count the revolutions. This assuming no wheel slipping.
Using a Lidar Lite-3 (range up to 40 meters) I have could also work for odometry, that is, measuring how the distance changes to whatever is in front of it when the robot starts.
D-GPS is something I'm planning for the potential follow-up project. As I've understood the technology, one needs to get correction data continuosly from a base station via RF/Wi-Fi/cable for the precision to be better than traditional GPS.
Thanks for your suggestions, gave more options to consider. Initially I'll try IR inside with an Activitybot to understand the technology and pros and cons.
Some years ago, I had a little robot with P1, which had a ultrasonic ping sensor and a compass. It could explore a room and build a map of the room with obstacles scanned by the ping sensor. For odometry I only calibrated speed. It worked more or less. I always run into problems with the very limited amount of ram of P1. So I would go at least with P2 for this project to avoid these problems. Nowadays we own a vac robot, which also builds up a map with it's 360° lidar.
Perhaps you have seen my experiments with camera and blinking beacon? In principle this is a nice idea, because it is quite simple, cameras are very cheap precision sensor arrays and if you have more than one beacon in one picture, you can calculate distance. Unfortunately with low light my camera went into a very slow mode for long exposure times. https://forums.parallax.com/discussion/175897/thoughts-about-robot-navigation-using-blinking-beacons-and-camera-s#latest When working with pictures, P2 comes into it's limitations though.
Perhaps you could also swap the entire setup, give the robot a colour, which is nowhere else in that place. Have one camera (or more) on a pole. Searching for a colour blob in a picture is very simple and fast. Just convert the picture into hue values. Then build for each X and Y direction the average position of all pixels of that hue value.
Thanks for your ideas and comments!
Actually similar kind of crude mapping I started with a long time ago with a BoeBot and ping sensors. Very quickly I recognized that 256 bytes of RAM is limited for this purpose. Then attached a Memory Stick Datalogger to have "unlimited" storage, but then got distracted by the Propeller ActivityBot. If you happen to find the mapping program and want to share it, I could at least try it inside where it's probably more reliable than outside.
Yes, I remember I saw your experiment, very innovative! If Tensorflow Lite would work on the P2, it might be fairly easy to use image or sonar data classification for recognizing different landmarks, I've actually tested a simple neural network on a P1 for classifying images, but run quickly out of memory. With the 40 meters range of Lidar Lite-3, it would in theory be possible to use it outside in our yard. I however guess some kind of fuzzy logic or neural networks might be needed as there are not any flat surfaces apart from our house.
So, would the camera then communicate the calculated X and Y positions to the robot via some RF?
...
Yes, that's the idea. Of course only possible, if the area and application allow it. Even WLAN might be a possibility in some cases.
Have taken a plunge on the IR-idea to get started somewhere.
The schematic for the IR Beacon in this tutorial shows a 1kΩ resistor, while the text mentions a 220Ω resistor.
What happens/might happen if I don't use a resistor at all for the beacon? Any risk of damaging the pin/P1?
I'm asking as I'd like to maximise the distance, of course I'm open to other solutions as well.
the inverted option - stationary sensors detecting and directing the machine (in conjunction with onboard avoidance) might work with some of the options used in RoboCup indicated here:
The type of datamatrix-like code used for identifying robotic soccer players on a field through external imaging is called an AprilTag.
AprilTags are visual fiducial markers that are similar in appearance to QR codes but are specifically designed for robotics and computer vision applications. They are square 2D barcodes that can be easily detected and localized using computer vision algorithms[8].
Key features of AprilTags include:
AprilTags are commonly used in RoboCup and other robotic soccer competitions to:
While not explicitly mentioned in all robotic soccer systems, AprilTags have become a popular choice for external vision systems in robotics competitions and research due to their reliability and ease of use.
Citations:
[1] https://developer.nvidia.com/blog/jetson-project-of-the-month-this-autonomous-soccer-robot-can-point-shoot-and-score/
[2] https://github.com/nicomazz/Soccer-Robots
[3]
[4] https://techxplore.com/news/2023-08-open-source-python-based-platform-2d-simulation.html
[5]
[6] https://www.instructables.com/Autonomous-Soccer-Robot/
[7] https://www.restack.io/p/robotics-answer-robot-soccer-competitions-cat-ai
[8]
[9] https://www.snexplores.org/article/ai-nimble-robots-reinforcement-learning
[10]
[11] https://www.academia.edu/8994417/A_Dynamic_Identification_Method_for_Robotic_Soccer_Game
[12] https://rustfest.ch/talks/using-rust-for-playing-soccer-with-robots-at-robocup/
[13] https://devmesh.intel.com/projects/ball-detector-for-a-soccer-player-humanoid-robot-using-deep-learning-18776
[14]
Don't do that -- you don't want the pin circuitry limiting current through the LED; do that with a resistor. In my experience IR LEDs can handle more current than other LEDs -- but for a very short period. For example, in my laser tag work I pump 1A through an IR LED. That said, it's in short bursts of 56kHz modulation so the LED can take it.
It's always best to consult the datasheet. The IR LED datasheet I found at Parallax says the LED has a Vf of 1.5v and can handle 100mA for 20ms. If you're going to use a P1 pin you can bias the LED to 20ma with a 90-ohm resistors. Remember, too, that your IR receiver will be expecting a modulated signal. You can use a P1 counter to do that.
Here's a quick method to create an active-high modulated output on any pin. Note that it always uses CTRA (for brevity/simplicity).
Here's the output captured by a Logic Analyzer when I specified 38kHz for 5ms.
Thanks! I thought of AprilTags earlier, and in a well-lit and somewhat controlled environment I suppose they work well. My project has its own challenges, being outdoor in wintry and dark conditions, and while I'll avoid rain and snow, I can't really control the environment that much. But I do have some OpenMV cams which directly support AprilTags, so I'll definitely try some indoor navigation at some point.
At my university where I work, we actually last summer purchased a BostonDynamics dog which I understood reads ArUco-codes, similar but not identical to AprilTags.
Thanks Jon! I did actually search for a datasheet for the IR LED, but did not find it. On the other hand, I would anyhow have asked as I'm more of a software than a hardware guy 😀.
Thx for the code snippet, I'll try to convert it to C once I understand it. For my navigational purposes, and if I want to try same as in the IR Beacon tutorial, I'd also need to vary the brightness, but it should be easy enough for me to convert the BlocklyProp program to C.
I forgot to mention, but I was able to use 850NM Photodiodes and ADC to navigate towards a Sony IR-remote, however the distance was indoors max 1-2 meters (tried with many different resistor sizes), so I'd like to try with a modulated signal instead.
Andy Lindsey of Parallax came up with a neat trick using modulated IR that is useful. If you look at the sensor datasheet, you'll see that the sensitivity is best at the center frequency (e.g., 38kHz) and falls off as you move away from that center frequency. What this means is that you can detune the IR output and check to see if there is a response from the receiver. This allows you to do measurements. Years ago Andy used this technique to make one BOE-bot follow another. In laser tag we detune the IR output frequency to reduce range of the tagger (useful for indoor venues).
I find Blockly utterly useless (except for teaching kids), but I think there is a mode that let's you see the C code that will be produced. The NCO output mode is very simple because it uses P1 counter hardware, hence the translation should be a breeze. I don't like FlexProp C and I can't get Catalina to work as advertise, so there is no C for me, otherwise I'd prove that this method is easy to convert to a C function.
I'm with you on Blockly, it's nothing for me either, utter frustration.
I was finally able to install Blockly and convert from Blockly to the C-code below. Now, unless I'm misunderstanding something, the code pulses pin 5, while the schematic shows pin 11, typo?
There are too many experts in the forums who post, "You should be able to..." messages and I don't want to be one of those, so I downloaded the latest version of FlexProp, poked around a bit, and proved myself correct: my IR modulation example translates easily to C (FlexC, anyway). I'm going to ask you to trust me this works -- I still have my LA connected for a work project and verified the output.
Thx, of course I trust you!
Needed to just slightly change to get it to compile in SimpleIde, removing _ from 0x8000_0000, setpin (pin, 0) to low (pin), and getpin (pin) to get_state(pin). Will test hardware during the weekend, have several ActivityBoards to use.
The way I'm reading that code the IR output is on P5, and the LED on P26 (built into the PAB) is throbbing. There is a filter circuit on P26 and P27 of the PAB to help analog output. You can see that the DAC module is initialized for P26 and P27, and channel 0 (P26) is getting the sawtooth value from the loop.
Sorry, this may be a totally superfluos comment:
You are using P1 together with compiled C? When I did that some years ago, I constantly run into trouble having not enough program space for my projects. Very frustrating. In my experience then, P1 must be used with a bytecode system like Spin or Tachyon.
Perhaps you can make some estimations about code size rather early in your project.
Yup, this was not clear from the Blockly code, only from the C-code and the PAB datasheet, thx for pointing it out
It happened to me as well when I tried to run a neural network on it, then it was though about available RAM. At least for the first prototype I'm not expecting lack of program space or RAM to be an issue. The P1 will only be involved in navigating the robot back and forth, and probably be communicating through serial to another MCU. I would not mind using Spin, but when testing things out on the Propeller Activity Bot, it's easier for me to use SimpleIde and its C.
I was able to get this IR-beacon working on one PAB, and the IR-receiving part on another. A such it works, max range is however around 2 meters, and that's indoors in a controlled environment. And that was removing the pause(1) in the receiving code. I'm using a 220 Ohm resistor for the IR LED, need to check if I have smaller ones.
@JonnyMac I've not tried with the function you posted yet, but I'll try tomorrow with fresh batteries and brain. Perhaps your function won't help with the range though? I'll also swap out the 220 Ohm resistors on the receiving end to ones with larger values, as I believe this will increase the sensitivity.
Minimum range I'd like to be around 10 meters outdoors, assumption is that it's quite dark outside, at least no sunlight.
It won't improve your range, but it can help you shorten it by going off the center-frequency of the receiver. We use this feature to reduce the power of our laser tag weapons, especially when indoors.
If you're looking for long distance, you need to push more current through the IR LED -- far more than you can get right out of the pin. Here's a simplified version of what I use in laser tag:
Considerations:
Be careful: if the control output is left on -- that is, not modulated -- you could have damage to the LED or the resistor. This is up to you in code.
Consider adding a simple lens to focus the beam. In our laser tag products we have seen distances of 150 meters at night. Now... these are not the conditions we play in, but we had the opportunity to test on a moonless night and, to be honest, were surprise ourselves.
This might be helpful:
Great, thx!
I've ordered components needed for the circuit you posted (lots of spares in case I let the magic smoke out) and will test once I get them after a few days.
Have learned a lot already!
Ok, received the components, and by mistake I ordered SI2306 SMD instead of through-hole ones, would probably need to check both my eyes and my brain... I don't think any tiny SMD-component will survive my soldering skills, also the temperature on my three soldering irons can't be controlled, so I might easily melt the component.
@JonnyMac Sorry to bother you again, but could e.g. this one work instead: N-CHN FET 55V 47A 110W 22mohm TO220 LogicLevel Reference: IRLZ44N ?
FYI: While Mouser/Digikey and similar large distributors typically have most components I've needed in stock, I avoid them for purchases below 70 € as they ship from abroad and have shipping costs starting from 20€ unless you spend 50€+taxes.
I think it will be fine. If I'm wrong, I'm sure someone will correct me.
I happened to find this video by a popular YouTuber -- and he uses the MOSFET you have
One of my favorite parts is the TC4427 -- and it comes in a DIP package
I think it was Phil Pilgrim (may he rest in peace) who told me about this. It's a gate driver -- and I did use it in that mode for a DMX lighting controller to drive the gate of a large MOSFET that was doing PWM for a 100W LED array.
More often than not I use it as a dual MOSFET package. I has two channels capable of 1.5A, and most of the time I use it to boost 3.3V to 5V with a stiff output. This works well for driving signals through long cables. I frequently use it in servo drivers and in pixel drivers. I suggest you get a couple with your next Digikey order. It also comes in a version with inverted outputs (high in, low out) and even a version with one of each. I am currently using that version in a new product for laser tag.
Thx, appreciated! The video was indeed educational.
I've now ordered a few IRLZ44N, and while they did not have the TC4427, they have TC4424 which offers a higher current rating, so ordered a few of them as well. I'll start working on the other things related to this robot while waiting for the new components to arrive. In case I for whatever reason won't get the IR-beacon navigation to work well enough, I have a plan B using a Lidar Lite-3 range finder. That is electronically much easier, but programmatically more demanding, especially in an outdoors environment.