Syzygy Tech

November 15, 2008

Infrared Robot Detection with Obstacle Avoidance

Filed under: projects — Tags: , , , , , , , , — syzygy @ 9:52 pm

As part of a Robotics class I took as a professional elective, I designed and built two robots with the intent of having them interact with each other. My original idea was to have them play a hide and seek type game, where one robot would chase the other, while both of them would avoid hitting objects in the room. This idea was overly ambitious considering the amount of time I had to complete the project, so during the construction, I modified the design goals of the robots. In the end, I built two robots named Oedipus and Tiresias both based on a small 4 wheel drive platform used in one of the basic labs done in class. I fitted both robots with 2 proximity sensors to allow them to wander the room without bumping into objects. Tiresias, in addition to the proximity sensors, was fitted with 4 IR LEDs. These LEDs would be a beacon for Oedipus to see with a detection circuit, and thus take action. Oedipus was programmed to turn away from the direction that Tiresias was detected. If the other robot is not detected, Oedipus will wander the room in the same manner that Tiresias does.

The core of the robots is a OOPic controller, the OOPic-R board with the B.2.2+ controller worked well for this project. Its certainly not the fastest or most powerful board or processor, but provided the basic functionality I needed. This board has 4 ADC ports and 16 digital I/O ports and provides a regulated 5V supply to sensors or any other peripherals. The compiler for the chip uses its own custom syntax for many things, but also allows BASIC and C syntax for the code. The custom commands make setting up some sensors quite easy. On these robots, each wheel has its own servo, and the servo commands that are part of this compiler made it relatively easy to control them.

The obstacle avoidance used in each robot is a quite simple. Each robot has two Sharp GP2D12 infrared rangefinders mounted on the lower platform on the front of each robot. They are angled out from the center of the robot by about 30 degrees so that an object that would clip the side of the robot will be detected. When an object is detected within the range specified by the code (in this case, about 40cm) the robot will turn away from the object until there is no longer an obstruction. The proximity sensors themselves are analog and will output a voltage that is very nearly linear to the real distance of the object detected. The sensors are connected to the first two ADC ports on the OOPic board. In the code, the voltage read by the ADC is compared to a predetermined value that I found through testing the sensors. These sensors were very easy to use and seemed to be quite reliable in the testing that I did on my robots. They did not fail to detect an object even under bright fluorescent lighting, but I’m sure one could find a situation where they may not be ideal. The only time I could cause the sensors to fail was to put something about 5cm in front of the sensor in which case they would fail to see it, but due to the rather slow movement of the robot, it is very unlikely that something could get that close before the robot could react.

Perhaps the most important part of the robot was the infrared detection of the other robot. The circuit to do so is rather simple and consists of just a comparator connected to the photo transistor, a voltage divider, and an output LED to provide visual confirmation that it is working.

Infrared Detector Schematic

Infrared Detector Schematic

The IR LED is shown on the schematic for reference. To demonstrate the capabilities of the robots, I took two short videos of them in the lab. The LM339 comparator chip used is a quad package. I used three of the comparators to allow Oedipus to sense from the left, right, and behind. I could not get the fourth to work and I was not able to determine why. Tiresias had 4 of the IR LEDs in it with the 470 ohm current limiting resistors on each LED. I could have run all four of the LEDs in series and used a single resistor, but I did not think of that until after I started building the board.

The only issues I had in getting the robots to work properly, besides my own inability to build a perfboard right the first time, is that the phototransistors could detect the IR LEDs from behind and on the side as well as in front of them where I wanted. This meant that when the IR LED was susposed to trigger the right detector, the left would also trigger due to IR light going into the bottom of the left phototransistor. To solve this, I put a small piece of electrical tape to cover the side and bottom of the phototransistors which solved the issue. The robots work to my expectations, but there is certainly more that could be done with them. First of all, only one robot is able to detect the other. One robot wanders around the room without any knowledge that there is another robot involved. I would like to put detectors on both robots, and have one actively chase the other. In its current state, on robot runs away from the other, but no attempt is made to make chase. Since this project has already been completed for a grade, I doubt I will continue working on it. Below is a zip file with the code used for the OOPic controller and an EAGLE schematic of the controller board.

robotics_project.zip These files are released under GPL version 3 as specified in the COPYING file contained within.

Here are some images of the robots.

Robot




Tiresias with 4 IR LEDs


Oedipus with Infrared Detectors

Oedipus with Infrared Detectors


Oedipus Rear View

Oedipus Front View


Oedipus Rear View

Oedipus Rear View

August 18, 2008

Airplane WiFi

Filed under: uncategorized — syzygy @ 2:15 pm

There have been several recent announcements about airlines starting to offer wireless internet on their flights.  I find it interesting that they are trumpeting this as something new and exciting, when, in my mind, they should have offered internet access on planes years ago, when wifi first started to take off.  There was one quote from a Washington Post article that I find particularly interesting:

“If they charge for it, they are going to make millions and millions of dollars,” said Mike Boyd, an aviation consultant. “Most of us cannot be away from the Internet or our laptops for very long. We get separation anxiety when we are not on the Internet for a few hours.”

I do not know how they plan to make millions of dollars when the cost for service on Delta flights will be $9.95 on flights of 3 hours or less.  Sure, some people will use it, but I have a feeling the majority of travelers will simply wait the few hours until they are on the ground when they can use any number of free wireless access points.  If the airlines are planning on using this as a way to offset their other rising costs, I think that they will be greatly disappointed.  Either the cost of the internet access has to be very cheap, or it must be free if there will be any kind of significant utilization.  If the wifi was free, then the airline could use that as something to attract additional passangers.  Even if the ticket prices were slightly, say a few dollars more, I think people would be more willing to travel on that airline, because the cost of the service is hidden in the cost of the plane ticket and removes the pay barrier that would instantly turn off some people.  I can see myself paying $5 more for a ticket on an airline that had free wifi, but I doubt I would pay $5 to get internet access once I was on the airplane.  I would think that the airline would at least offer it free to first-class passangers and those that are members of the airlines club.

April 21, 2008

Project Idea

Filed under: motorcycles — syzygy @ 2:48 pm

Now that the weather is nice and the motorcycle is out, I’ve been noticing a few things that I would like on my bike.  For starters, I want a clock, but upon looking ofr a small LED clock to mount, I was not able to find anything that suited my needs.  This got me thinking that I should build a clock, as it would be a nice project now that I’ve been using PIC microcontrollers at work all the time.  Extending this, I could create a multifunction device to incorporate many more features than just a clock, which would make little use of the microcontroller.    So I’m debating about making a device with a clock, a tachometer (my motorcycle does not have one), a digital compass, and a thermometer.  I have a few ideas on how to implement the tach, but I will need to take a look at the wiring on the bike before I start any design of that part of the circuit.  Some research is in order.

January 21, 2008

Expand JFS Filesystem

Filed under: computers, felix, gentoo, linux — syzygy @ 11:56 pm

I recently bought 2 new 500GB hard drives and am in the process of migrating the array to double its size to 2TB. The current 1TB over 3 drives was 100% full, so it was something that had to be done. The expansion took about 26 hours on my 3ware 9650SE-8LPML controller, which is quite good from what I see of other peoples experiences. Of course, all important data was backed up before the RAID expansion.

The primary issue I had after the expansion was the proper partitioning of the free space. When the RAID expansion was complete, I now had 1TB of used space using a JFS that was the original partition, and 1TB of unused, unpartitioned free space. Attempts to use Gparted to expand the partition failed due to a known bug that prevents partitions over 1TB. I tried to use Parted, the CLT tool that Gparted is based on, to expand the filesystem but was unable to do so. This seemingly left me with two options, either use multiple smaller partitions, or to reformat and restore the data from the backups. I decided that smaller partitions would be a lot of extra work in terms of keeping tabs on the free space on each partition (and may require more frequent partition modifications) which is something that should not be necessary. Restoring from backups was not welcome due to the time involved. Deciding that those options were not acceptable, I was determined to find the solution I wanted, having a 2TB partition without going through a backup restore process. If anything, it would be worth doing simply on the principle of the matter: that having large partitions on a modern filesystem that supports volumes up to 32000TB should not be a problem. Several Google marathons and man page studies allowed me to successfully perform the operation that I wanted.

My main problem was a lack of understanding of the way that fdisk actually works. With fdisk, you can delete and recreate a partition without actually destroying the filesystem that lives on the partition. I am not sure exactly what the limitations are, but it seems that as long as you do not change the starting point of the partition, the filesystem will remain there. In my case, the drive in question (/dev/sda) had a 1TB partition starting at the beginning of the disk (/dev/sda1) with 1TB of unpartitioned free space residing after the JFS partition (created by the RAID expansion). I deleted the JFS partition (/dev/sda1), and recreated the partition, but this time using the full 2TB of space. In the tests that I did, the free space MUST come after the partition. I wrote the partition table, and them mounted the drive. All the data was still there, but the JFS partition was only showing up as 1TB with the command dh -h. This was rather concerning until I realized the state that the drive was in. fdisk only edits the partition table, not the actual filesystem. When it writes out the partition table, it is just redefining where the partition begins and ends and does not touch the filesystem. Thus, although I had expanded the partition, I did not expand the filesystem. Doing some more searching, I found this article that gave me the last piece of information I needed. The command mount -o remount,resize /mount/point tells the JFS filesystem to expand to fill the entire space of the partition. The command is unique to JFS and will not work on other filesystems because the options passed are used by the JFS kernel driver. When you issue the mount command, note that the partition must be mounted.

Perhaps most frustrating is the lack of data on the JFS filesystem. It does not seem to be very popular in the Linux community, most of whom use ext2/ext3. Those that do use an alternative filesystem tend to use ReiserFS with a small number using XFS. In the limited, unscientific testing I have done, JFS performed very well performance wise and used far lower CPU than ext3 or ReiserFS. JFS has worked out well for me so far and, despite my initial difficulty in expanding the filesystem, is the filesystem I will use in the future.

January 19, 2008

MacBook Air: Not Impressive

Filed under: thinkpad — syzygy @ 11:14 am

I’ve noticed that the Apple fans have been raving about the announcement of the MacBook Air, so I started looking for information on it, as even non Apple fans seemed to be impressed. In my opinion, although the Air has some nice features and is a nice looking machine, it just doesn’t cut it in terms of price, performance, and interoperability. To show this point, I would like to compare the Air to the laptop that I have been eying for some time now, the Thinkpad X61 or X61s.

In terms of weight, the MacBook Air is advertised as 1.36kg, a respectable lightweight notebook. The Thinkpad X61 is listed as 1.41kg with the X61s being 1.24kg. These weights are usually the lightest the laptop can be without any additional options. The weights are rather close, so lets see the stock features and compare.

Both the Air and the X61s come standard with a 1.6GHz Intel Core 2 Duo processor and an 80GB hard drive. The Air comes with 2GB 667MHz RAM, Bluetooth, and 802.11 a/b/g/draft n wireless, which are options that must be added to the X61s. The Air has a 13.3 inch screen while the X61s has a 12.1 inch. The thickness of the Air is 19.3mm (0.76″) and the Thinkpad is 20.32mm in the front and 27.94mm in the back. Neither come with an optical drive. Overall, the performance specs of both laptops can be made very close. Configured with identical hardware, the Air costs $1799.00 and the Thinkpad X61s with the options is $1354.00, a significant difference in my mind.

To me, the main differences are in the physical (the Air is thinner with a larger screen) and in the connectors that are available. The conneectors are something that is very important to me and is one of the main reasons that I think i would be unable to use this laptop. The Air has a very limited set of ports, namely 1 USB port, a mini DVI (useless to me) and audio. The X61s has 3 USB ports, VGA, ethernet, 1 PC card slot, and SD slot. There have been countless times where I needed multiple USB ports and in my opinion an ethernet port is not an option.  The expandability of the Air is quite limited and is something that would be very difficult for me to deal with.

What it boils down to is the MacBook Air is Apples entry into the ultralight notebook arena that falls short of the other players already on the field.  I’m sure that there are people who find the Air to be what they want, but it is not exactly a deal when there are more powerful laptops with less weight that cost significantly less.

January 15, 2008

Coming to a Windows Vista Near You

Filed under: security — syzygy @ 8:00 am

Nothing like Microsoft putting new security flaws in Windows while claiming its improving security. I don’t know why Microsoft would use a random number generator with several known and published flaws, not to mention the issue of its poor performance to other generators available. Perhaps its a standards issue, but a bad idea even if is not the default random number generator.

January 10, 2008

Sun Fire V120

Filed under: gentoo, linux, sparc — syzygy @ 10:41 am

Through the gracious efforts of a friend, I have managed to come by a Sun Fire V120 server with a 650MHz UltraSPARC IIi processor.  It is in need of a hard drive, but is otherwise in working order.  I’ll be getting some cheap 80 pin SCSI drives on ebay in a few days, but in the meantime, my issue is the serial (or LOM) connection used to administrate the server.  There is no video card, so serial is the only way to go (there is a PCI slot, but normal video cards will not work due to Sun using an Open Boot PROM rather than a BIOS).  Perhaps more annoying is the RJ-45 connector that is used for the serial port.  Because of this, I am unable to connect to it.  I may be able to make an RJ-45 to DB9 adapter tonight and attempt to connect.  I haven’t come up with a use for this machine yet, but I’m sure that it will be making use of the Gentoo SPARC project.  I’ve never used Sun hardware before, so this should be fun.

December 28, 2007

Internet Bans

Filed under: politics — syzygy @ 11:14 am

I’ve noticed many items in the news recently in regards to restrictions and additional punishments put in place for sex offenders. The more I read about these, the more I think that we are going too far in certain aspects. The latest example that I saw is an article in the NY Times that reports on a law passed by New Jersey which bans some sex offenders from using the internet. Not only this, but monitoring equipment must be installed on their computers and they are required to submit to periodic checks. I agree that sexual crimes should be punished severely, but at what point do we go too far? What other crimes receive this kind of monitoring after incarceration? At what point do these punishments spread to other types of crimes, and when will suspicion be reason enough to start this type of monitoring? Are thieves banned from going to stores where they might be able to steal things? Are bank robbers banned from entering banks? To me, this kind of punishment is excessive, and I do not see exactly what it aims to stop these people from doing. If they really wanted to commit another crime, there are plenty of other ways to do so that do not require finding victims on the internet. In a time when the internet has become a part of everyday life this is a very broad punishment to pass unilaterally. I also wonder exactly what the law defines as part of the internet. Does it ban all computer networks? Are they allowed to use a LAN without external access, or other types of private networks? Theres a lot of gray area there that would be very difficult to properly address.

There seems to be a fascination with sexual crimes and crimes against children in the government recently, and the repercussions of this trend are rather worrisome. As these kinds of severe punishments become more commonplace, they will be used more and more in other, less severe crimes. I see this as a bad sign, as a sign of a government that does not understand technology or the internet, and a sign of a government more obsessed with information on its citizens. Although these laws do not affect me, it is a slippery slope that can soon start impacting citizens who have not committed a crime. There is already a problem with warrantless surveillance, and I fear that these laws are a continuation on a road that I do not think any government should go down.

December 13, 2007

Presidental Canidates

Filed under: politics — syzygy @ 10:14 am

I had some downtime today and took it upon myself to read up on the views of some of the candidates for the 2008 presidential election. In order to get a good feel for the different candidates, and since many of their own webpages lack good information, I read the Wikipedia pages on them. Of course Wikipedia has its issues, but the information on their views is factual in nature and well sourced. After reading the pages on Clinton, Obama, Thompson, Romney, and Paul, I must say that I like Ron Paul the most. His views on almost everything align with my own, such as his views on government spending, foreign policy, abortion, individual liberties, gun control and certain economic policies, just to name a few things. As much as I favor Ron Paul, it seems that he does not have the same support behind him that the other candidates do. I cannot see a Republican winning the presidency in 2008 due to their rampant unpopularity at the moment, so I think that the Republicans need someone who can easily distance himself from the Bush administration, something that Paul can easily do based on his voting record. I’m unsure if Ron Paul can win the Republican nomination, but I think that if he did, he would have the best chance against his Democrat opponent, however I don’t think that mainstream Republicans will go for someone like Paul.  Theres always a chance, however, and i will be voting in the Republican primaries this year, even if New York doesn’t matter since other states have loaded their primaries so early…

November 23, 2007

Flying without ID Round 2

Filed under: darkstar, dvorak, gentoo, linux, thinkpad — syzygy @ 12:18 pm

Yesterday was another opportunity to fly without presenting any ID at the airport. The man at the US Airways counter didn’t give me much trouble beyond the puzzled look and a few questions about how it’s possible to not travel with ID. Going through security was easier this time than last time as they did not frisk me, but they did give me a little bit of trouble while going through my bag.

The first item that got me a few questions was my all metal mechanical pencil (click here for a review). As you can see in the review, the pencil is quite heavy and solid, so I can understand their complaints. In the end, they did not take it away. What was more amusing, was the concern that the two security guys had over my laptop. I currently am missing 1 key off the keyboard from switching the layout to Dvorak (I still have the key, but need to modify it for it to go back on). The guard spent a minute looking at the missing key to see if there were any apparent modifications to the laptop, when he noticed that the keys were not in the right places. He had never heard of the Dvorak layout and, apparently, did not know that layouts other than qwerty existed. I guess my explanations of a more efficient layout were not good enough, and they asked me to turn the laptop on to verify that the “internals have not been modified”. I really wanted to tell them that I have modified the internals, but discretion got the better of me. So I turn the laptop on, and they get to see LILO in all its glory boot Gentoo. Although they were satisfied that the machine was operational, they were not happy that it was using software that they had never heard of. I explained what an operating system was to them and the difference between Windows and Linux, but I don’t think I cleared much in their minds. To see their reaction, I refused to login to the machine when they asked, which prompted them to bring aver their supervisor (an actual TSA agent rather than hired security). I explained the whole Dvorak and Linux thing to the supervisor, who seemed to be a little more understanding. She felt that turning the computer on was enough and let me go.

The trip through security was relatively painless despite the issues that they had with my computer. I think that this shows that there is a fundamental lack of understanding of how computers and electronics in general work. If I had told the security that I was an electrical engineering student, I’m sure that they would have given me more of a problem with the computer. If security really wants to deal with modern electronic threats, they need to start educating their guards in the matter. There are much more dangerous things than Linux that can be brought onto an airplane, not to mention things that are much less conspicuous than a laptop running totally unfamiliar software. Something that comes to mind would be a radio jamming device that could easily be concealed within an operational laptop, calculator, etc. I understand that I am in a much different position than many people who do not use such electronics everyday, but if people are going to spend billions of dollars on security, shouldn’t they actually be familiar with the kinds of threats that can occur? Or, perhaps, it is just the notion of “security” that is the aim. It is clear to me that actual security is trivial, a superficial glaze is all that is necessary to make people feel safe. Personally, I think the fear that people have in regards to air travel security is absurd, so maybe its a good thing that there still is no real security at the airports. Life is hazardous to your health. Deal.

Newer Posts »

Powered by WordPress