Autonomous Rover Part 5: Using the ArduPilot Mega(APM) and GPS



     I have finally received the ArduPilot Mega 2.6(APM) and GPS from 3DRobotics. It took them a pretty long time to ship out to me. I originally had also ordered sonar sensors to place on the rover to avoid obstacles but they are out of stock and I think they have been discontinued from 3DR. I guess the main reason why the APM took so long for it to come was because of the backordered sonar sensors. I just canceled the ordering of the sonar sensors and then the APM and GPS was finally shipped.




     Below is a close up of the AMP 2.6 and of the 3DR uBlox GPS.



     Both the APM and the GPS have a front side that is depicted by an arrow with either the words FORWARD or FRONT. So when it was time to place them on the MINDS-i robot I had to keep in mind of their orientations. 

     So the first thing I did was follow directions on http://rover.ardupilot.com/ on how to set up the rover. One of the first steps was to connect the APM to the rover's receiver as shown below.


     On the website, there was a table that shows which channel of the receiver should connect to which input on the APM. Channel 1 on the receiver would be the throttle of the rover and channel 2 would be the steering. Once that was done, I needed to place the APM somewhere on the rover. I needed some sort of platform to place it on. There really wasn't any flat surfaces except for the small area on top of the motor of the rover. But I was already using that spot for the battery of the FPV camera and maybe it wouldn't be a good idea since it could cause interference to the GPS which also incorporates the compass.

     So I looked around the workshop area to find some sort of flat surfaced piece and I came across our box of failed prints. In there I found a large white flat piece. From it, I used a dremel to cut out a square piece to place on the rover. I also filed the edges to make the edges a little less sharp.




     I used some duct tape to tape down the square piece onto the rover. In the future, I'm doing to design a better platform and 3D print it. For now I'm just going to use this piece for testing purposes. Once I had it taped down, I used some velcro with sticky backs to keep the APM on the platform as shown below.



     The wires I had were just barely long enough to have the APM in the proper orientation. It is recommended to keep the APM as centered as possible on the rover but the position I had it in was not so far off. Next I placed the GPS right next to the APM using the velcro as well.


     With the velcro I could just easily take off the APM or GPS for whenever needed. From here I had to calibrate the transmitter through Mission Planner. I also had to calibrate the compass. To do that I just took the GPS off from the rover and rotated 360 degrees on every axis.


     Once all that was done I headed outside to try to do a little test run. At the moment I don't have the APM power module to power the APM from the rover's battery. So the only way I could power the APM was through the USB cord. So I had to always keep the APM connected to my laptop at all times.


Here is a screenshot of the first successful test run in Mission Planner.


This was outside the Boca Bearing Building. So I decided to do a short ride around the building. My first actual run wasn't a success at all. I accidentally chose a waypoint(WP) that was way far and out. Also, at that current set up for the rover in Mission Planner, the rover was driving backwards instead of forwards. So that caused some problems with the steering and the orientation of what was considered the front on the rover. It was a quick fix in the setup by just reversing the direction of the throttle. I also noticed that the rover was kind of moving to fast for me to keep up with it with my laptop and the transmitter in my hands.

     So I just reduced the percentage of the throttle in the setup in Mission Planner from 50% to 30%. At this percentage it was much easier to keep up with the rover. The rover enters autonomous mode with a flip of a switch on the transmitter to switch modes. The two modes I have are just "manual" and "autonomous" mode. Due to my 6 channel transmitter, I'm currently limited to just having two modes at the moment. There is also a "learning" mode.

     I then choose those 3 waypoints, saved it, and then read it. From there, the waypoints were loaded onto the APM. Then I entered autonomous mode. I was really blown away by seeing the rover just driving itself to the waypoints! It was amazing to me, I couldn't really believe it. I guess it's different when you're seeing it in person for the first time. It was cool to me just watching it go. There were some cars parked in the parking lot and I forgot to account for that. So there were times where the rover would want to go right into a car so I had to quickly switch the mode on the transmitter to "manual" to drive it safely away from the car. Once I have steered cleared of the parked cars, I would just flip the the switch and the rover would resume it's autonomous journey.

     When it finally reached the final third waypoint of its journey, it just simply stopped. From there I took over and drove it back to the workshop. I have currently already ordered the APM power module so I don't have to keep up with it connected to my laptop. It should be coming in probably later this week. Next time I will plan a larger plan for the rover to follow in Mission Planner and I'll also use the FatShark googles as well to see through the FPV camera on the rover. I will also try to do a short video of the rover driving autonomously. 

Gerardo Ramos
September 21, 2015

1 comment:

  1. hi sir myself waleed ahmed plz give me a schematic diagram of your project here is my email address waleedahmed737@gmail.com
    thanks

    ReplyDelete