Mini automated robot with mapping and localization

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there, I hope i have posted in the correct area.

I am currently looking to create a robot with a Zumo chassis (as of now) as it's base while using an ultrasonic sensor for obstacle detection and a reflectance sensor beneath to follow a line.

All these is good but I wanted to add a mapping and positioning ability to the robot.
Have been looking around for 2weeks and have changed a few component that I potentially need due to me reading around.

 

localization: Now I have decided to use Bluetooth beacon for positioning using triangulation instead of IR beacon but have not much progress and thus have no idea how to do it.
Mapping: How do I do a simple mapping and what potential component do I need? How do I integrate the map and positioning mentioned above?
MCU: I currently plan on using ATmega328p as I am not allowed to use Arduino or Raspberry Pi due to the availability of free library online (a rule given by my course).

 

I hope that by using a a BLE beacon, wheel slippage will not be an issue.
Any pointers or suggestion is appreciated. Or even pointing me to look for a specific keyword for research.

 

Do let me know if the information provided above is enough for a clear understanding

Thank you very much.
 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

C33PSB wrote:
Mapping: How do I do a simple mapping and what potential component do I need? How do I integrate the map and positioning mentioned above?

What research have you done so far into these questions? What have you found? Where are you stuck in applying this to your project?

 

I am not allowed to use Arduino or Raspberry Pi due to the availability of free library online (a rule given by my course)

There's nothing to stop you studying how those free libraries work, and then applying those techniques to your project ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for reply.
I have been research for about 3 weeks and have since gotten new findings while also scrapping some. Thought that it would be overwhelming to post it all in my first post.

 

For mapping, I have found a few examples of  that utilizes a couple of ultrasonic sensors for the task. Also seen some example of LiDar sensor. This then lead me to ponder about how should the robot carry out the mapping work, how can I make sure the robot successfully map out a room. I thought about how I could get the robot to keep left and hug the perimeter of the room and finally return to the original point using x and y coordinate though I will be frank about it, I have got no idea how to pull this off.

-

Plus the fact that even if the robot returned to the original coordinate, there will be slight error due to slippage. Also that the robot will be off track if it were to run a few more time. I found that odometer can be used and also a magnetometer for direction.
But both requires alot of calculation and might not error free after numerous running of the robot.

-

I then went on to read about positioning or localization of robot which leads to IR and BLE beacon.
As I thought that a map is useless when the location of the robot cannot be tracked or accurately.

-

Regarding your second point on using the existing library, that is exactly what i plan on doing. To understand and then apply it to me project respectively however, I have yet to find one that give me a clear picture. I don't need it to be compiled as to the extend of having a read up on mapping and localization together. Having a different site individually showing mapping and then localization is what I have been trying to find but to no avail (I might be searching wrongly, possibly).

This may seem like the 3 weeks spent on researching is not at all fruitful but it was because I confirmed that Arduino or Raspberry Pi could not be used last week. My supervisor's project stated to use Arduino and I confirmed with him. This then change last week when I was told by the course coordinator.

-
Also my project is split into 2 term with the first fully on research. By the end of the 1st term (end of December), we then submit our component list that we need for the project for the 2nd term. Therefore I do not have any component to try out as of now (replying to your question as to where am I stuck applying it to my project).

-

Parts that I can try salvaging in lab :

-SR04 ultrasonic sensor (can be used to do mapping but short of ATmega328p)

-PIC18F4550 MCU which I might be able to use to replace ATmega328p

 

Once again, thank you for replying.
 

Last Edited: Thu. Oct 7, 2021 - 03:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:

Plus the fact that even if the robot returned to the original coordinate, there will be slight error due to slippage. Also that the robot will be off track if it were to run a few more time. I found that odometer can be used and also a magnetometer for direction.
But both requires alot of calculation and might not error free after numerous running of the robot.

 

Is the robot allowed to physically mark its start location before setting off? Then you can guarantee that it will return to the exact location.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are no set rule and am free to play.
By physically mark, do you mean by place an object or sort like a beacon to allow the robot to return to?

 

Last Edited: Thu. Oct 7, 2021 - 04:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure that Bluetooth beacons are going to give the kind of resolution you'd need?

 

They're generally only useful for a coarse "near" or "far" indication.

 

Perhaps try googling "Real-Time Location System" or "RTLS" ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bluetooth BLE localization resolution are pretty neat. 5-10cm error from what I have read due to triangulation.
I just did a quick search on RTLS (found localino)and it seems plausible as well. I will look it up when I wake up tomorrow (GMT8+).

 

Anyway, this project only have a budget of 220USD.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Two things right off:  one,  there are going to be many more people here who know how the AVR [especially the mega328] works as opposed to the PIC 18F4550.   More people to answer any questions if you get into an area of problems.  

 

Two, in embedded systems design, never underestimate how difficult it is going to be to do things that, in the initial paper design, would seem to be relatively simple.  In other words, determine the absolute easiest way to meet the absolute minimum design requirements of your client's project (here, your course instructor).  If, having met those requirements, if the client wants more, then determine with the client how much more they are going to pay for these adjusted requirements.  For example, you should get at least a half letter grade point (say, going from a C+ to a B- ) just for having the best hardware abstraction layer (the Arduino format for AVR) denied your usage after two weeks of research into the project. 

 

  If the requirements don't specify using positioning or localization of the robot with IR and BLE beacons, then don't spend a lot of time at the project beginning researching them for the project.  Reading about an available technology is one thing: getting it to actually work reliably in your application is something else.  Bluetooth and BLE can be very time consuming because it is such a complex issue, and its usage may prove to be only peripheral to meeting the project's documented requirements.   Accelerators and magnetometer produce tons of data that can be very difficult to make useful if you don't have a lot of experience working with them.

 

The simplest way to return a robot to its initial position is to keep track of every movement and to repeat those movements in reverse.  If your drive wheels are controlled by stepper motors, then count the pulses sent to each drive wheel, then go through the same pulse pattern with the motor direction reversed in order to return to the initial position.  For armature:stator motors, keep track of the number of time units (say 0.1 seconds per unit) that each motor is operating.  Allow for maybe one time unit at the first movement from a resting position for inertia and acceleration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

C33PSB wrote:
Bluetooth BLE localization resolution are pretty neat. 5-10cm

For that, I think you'll need the recent BLE 5.1 DF features:

https://medium.com/supplyframe-h...

 

But I think AoA and AoD require some pretty clever antenna arrays - which don't come cheap?

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Oct 7, 2021 - 04:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:

There are no set rule and am free to play. By physically mark, do you mean by place an object or sort like a beacon to allow the robot to return to?

 

Any of those. You could place (drop) something the size of a coaster/beer mat marked with a cross, and detect the centre of that. If the arms of the cross were a different width you could then determine orientation. Or place something with a couple of magnets on it. A couple of linear hall effect sensors and, again, you can find the centre and orientation.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:
Anyway, this project only have a budget of 220USD.
An iRobot Create® 2 is twice the price of a Zumo chassis.

Create® 2 Programmable Robot | iRobot

[mid-page]

  • Robot returns to Home Base to dock and recharge. Rechargeable battery charges in three hours.

 

P.S.

10 year old (approximately) iRobot batteries are by NiMH cells.

 


Pololu - Zumo Robot for Arduino

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmm That is something i did not read into yet regarding AoA and AoD. Thanks I'll see what I can do and update here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:

Two things right off:  one,  there are going to be many more people here who know how the AVR [especially the mega328] works as opposed to the PIC 18F4550.   More people to answer any questions if you get into an area of problems.  

I hope highly prefer AVR as of now as oppose to PIC. It's nice knowing that support here is friendly for starter.

 

Simonetta wrote:

Two, in embedded systems design, never underestimate how difficult it is going to be to do things that, in the initial paper design, would seem to be relatively simple.  In other words, determine the absolute easiest way to meet the absolute minimum design requirements of your client's project (here, your course instructor).  If, having met those requirements, if the client wants more, then determine with the client how much more they are going to pay for these adjusted requirements.  For example, you should get at least a half letter grade point (say, going from a C+ to a B- ) just for having the best hardware abstraction layer (the Arduino format for AVR) denied your usage after two weeks of research into the project. 

 

  If the requirements don't specify using positioning or localization of the robot with IR and BLE beacons, then don't spend a lot of time at the project beginning researching them for the project.  Reading about an available technology is one thing: getting it to actually work reliably in your application is something else.  Bluetooth and BLE can be very time consuming because it is such a complex issue, and its usage may prove to be only peripheral to meeting the project's documented requirements.   Accelerators and magnetometer produce tons of data that can be very difficult to make useful if you don't have a lot of experience working with them.

 

The simplest way to return a robot to its initial position is to keep track of every movement and to repeat those movements in reverse.  If your drive wheels are controlled by stepper motors, then count the pulses sent to each drive wheel, then go through the same pulse pattern with the motor direction reversed in order to return to the initial position.  For armature:stator motors, keep track of the number of time units (say 0.1 seconds per unit) that each motor is operating.  Allow for maybe one time unit at the first movement from a resting position for inertia and acceleration.

 

I went through that thought process of mapping in my mind using x and y coordinate and it seems easy and extremely logical. But then I was stuck and I am not even starting on it yet. I realized that mapping and and localization is hard at least for my ability. Bu t to be honest, I do not know how difficult it is for experience personnel.
-

things to note that this project is extremely basic and I already have a rough idea on how to accomplish it since the description of the robot is just"build a car robot with an ultrasonic sensor to detect/avoid obstacle. A Bluetooth module to be utilize and connect to PC for remote controlling with a GPS module to know its location".

-
However, this is just the basic and I am supposed to expand on the project and improve the robot. Things cannot be too simple and need a certain level of complexity with major contribution from myself (which is why Arduino is not allowed).
I did mentioned that there are two terms in my project and there are no grading for the first. Only pass or fail. Failing it will render me unable to move on to the next term and have to pick another project when this module is available again.

 

Therefore adding mapping and positioning is not set in stone but is chosen to be research because I know that it is at least not a simple expansion. Is there any idea that can be done to replace those two without being simple and I can have major contribution?

Thank you very much.

 

Last Edited: Fri. Oct 8, 2021 - 11:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

C33PSB wrote:

There are no set rule and am free to play. By physically mark, do you mean by place an object or sort like a beacon to allow the robot to return to?

 

Any of those. You could place (drop) something the size of a coaster/beer mat marked with a cross, and detect the centre of that. If the arms of the cross were a different width you could then determine orientation. Or place something with a couple of magnets on it. A couple of linear hall effect sensors and, again, you can find the centre and orientation.

 

I will take note and look into what is mentioned above. Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

gchapman wrote:

C33PSB wrote:
Anyway, this project only have a budget of 220USD.
An iRobot Create® 2 is twice the price of a Zumo chassis.

Create® 2 Programmable Robot | iRobot

[mid-page]

  • Robot returns to Home Base to dock and recharge. Rechargeable battery charges in three hours.

 

P.S.

10 year old (approximately) iRobot batteries are by NiMH cells.

 


Pololu - Zumo Robot for Arduino

 

 

Wow I have never seen this when researching. I suppose I wont be buying though. But is the resource like the python program useful as a reference to learn and apply in c++?
Thanks alot.

Last Edited: Fri. Oct 8, 2021 - 11:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I wanted to add a mapping and positioning ability

I think you need to define that better.

 

Are you working indoors?

 

Are you positioning with a 6 x 6 meter box with side walls?

 

Are you positioning within a classroom, and if so, are there lots of "obstacles", (tables, desks, chairs, etc)?

 

Putting 4 small ultrasonic modules on your Bot would make it relatively easy, (but still not "easy" or trivial)!

 

Putting one ultrasonic module on a little rotating platform (like a tank's turret!), would be another option.

This assumes you have walls for the ultrasound to bounce off of.

 

The ultrasound can also detect obstacles in the room.

 

You might create a large X x Y matrix (array) in memory that represents the room.

You then start mapping walls and obstacles within the room.

 

The little ultrasound modules are cheap, accurate to 1 - 2 cm, and easy to interface to a small micro.

 

If you have bi-directional comm's with the Bot and a PC then that is a real game-changer!

The bot then just needs to be able to follow commands from the PC and feed back data.

You have essentially infinite memory and speed for mapping out the room, and a good display to show the data as it is obtained.

 

Your goal should be to keep it simple, as noted above.

You will encounter plenty of challenges even with a "simple" project.

 

JC 

Last Edited: Fri. Oct 8, 2021 - 11:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

 I wanted to add a mapping and positioning ability

I think you need to define that better.

 

Are you working indoors?

 

Are you positioning with a 6 x 6 meter box with side walls?

 

Are you positioning within a classroom, and if so, are there lots of "obstacles", (tables, desks, chairs, etc)?

As I am not experienced, I have made my robot an indoor operated one. This will render the mentioned GPS module useless due to it being indoor but as the project can tweaked, this is a non-issue.

 

DocJC wrote:

Putting 4 small ultrasonic modules on your Bot would make it relatively easy, (but still not "easy" or trivial)!

 

Putting one ultrasonic module on a little rotating platform (like a tank's turret!), would be another option.

This assumes you have walls for the ultrasound to bounce off of.

 

The ultrasound can also detect obstacles in the room.

Yes, I did jot down possible way of mapping with help of more ultrasonic sensor and also a rotating one with help of a stepper servo.

The classroom can be chosen and I plan on choosing a smaller one.

DocJC wrote:

You might create a large X x Y matrix (array) in memory that represents the room.

You then start mapping walls and obstacles within the room.

Ohh I understand what you mean. So that is a way to create an empty space for the map to be saved and written. I'll have to look into this.

 

DocJC wrote:

The little ultrasound modules are cheap, accurate to 1 - 2 cm, and easy to interface to a small micro.

 

If you have bi-directional comm's with the Bot and a PC then that is a real game-changer!

The bot then just needs to be able to follow commands from the PC and feed back data.

You have essentially infinite memory and speed for mapping out the room, and a good display to show the data as it is obtained.

 

Your goal should be to keep it simple, as noted above.

You will encounter plenty of challenges even with a "simple" project.

 

JC 

As of now the Bluetooth module that is chosen is a slave only module since that it will only serve as a gateway to receive command from a PC. Do I have to go with a different one?
That is true that I will encounter challenge even if it's a "simple" project but it is subjective as to what simple or difficult is to my examiner who is not my supervisor.
Last trimester only 4 passed out of 14 student for FYP. We all received that the school is experiencing financial issue not long after LOL. Hope that its not related.
Thank you very much for your input btw.

Last Edited: Fri. Oct 8, 2021 - 12:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:
But is the resource like the python program useful as a reference to learn and apply in c++?
Don't know (am unaware)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:
This will render the mentioned GPS module useless due to it being indoor ...
There are GNSS repeaters.

If can operate outdoors then GNSS RTK is available though at a significant price for your project.

OpenRTK Developer Manual — Aceinna OpenRTK Developer Manual documentation

Product Showcase: SparkFun RTK Surveyor - YouTube (8m20s)

https://www.avrfreaks.net/search/site/RTK?solrsort=ds_created%20desc&filter_by=9631

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for replying. though I am rethinking my project scope. Will take note of what you mentioned.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, can I confirm that ATmega328p is the technically the same as 556-ATMEGA328P-XMINI?

Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


C33PSB wrote:
can I confirm that ATmega328p is the technically the same as 556-ATMEGA328P-XMINI?

No.

 

ATmega328p is the part number[1] of the chip itself

 

556-ATMEGA328P-XMINI seems to be Mouser's stock number for the ATMEGA328P-Xplained-MINI development board:

 

 

[1] actually, not the complete part number - further suffixes indicate package variants, etc:

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C33PSB wrote:
Also, can I confirm that ATmega328p is the technically the same as 556-ATMEGA328P-XMINI?
Yes

 

EDIT: OK seems my post overlapped with Andy. I guess we interpreted your question in different ways. I thought you were asking "is the chip at the centre of that Xmini board just a totally bog-standard 328P. It is.

Last Edited: Thu. Oct 14, 2021 - 09:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I guess we interpreted your question in different ways.

indeed.

 

I thought you were asking "is the chip at the centre of that Xmini board just a totally bog-standard 328P?".

It is.

agreed on that.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...