By 3DoT David team:
Omar Mouline (Project Manager)
Christopher Hirunthanakorn (Missions, Systems and Test Engineer)
Kent Hayes (Electronics and Control Engineer)
Andrew Saprid (Manufacturing and Design Engineer)
One of the 3Dot David project objectives was to build a small-sized spider bot that can walk using two motors. When the project was assigned to us, we did research on different movement mechanisms in order to choose the one that best suits our requirements. The research results can be found on this blog post: Spider Bot Different Mechanism Research
The objective of 3DOT David Spider is to use scaled model of the Hexbug prototype to produce a cool project for the DIY community. The preferred method of control is to use Bluetooth communication between the remote-control (Iphone or Android) and the microcontroller on board of the spider The finished product must meet the following Program and Project Requirements:
- System processing using a microcontroller (either the 3DoT Board or Sparcs Macro.)
- Total production cost must not exceed $80.00.
- Short 3D Printing ( Not exceeding 6 hours and less than 2 hours for each single print)
- Control The Spider Bot from Arxterra app ( Android or Iphone) using bluetooth
- 3Dot david must be able to perform a safe interactive game with other projects in a specific field and date as Defined in mission profile
The Mission Profile for the 3DoT projects is to perform robotic combat. With regards to the College of Engineering Health & Safety Policy, the projects must meet the following Requirements:
- The game will take place in ECS 315 in a 6 x 6 ft. area on the linoleum floor.
- Go head to head with other robots in an indoor game of IR tag
- The emitter must hit the detector in a straight line from a maximum distance of 5 ft.
- Every time a player is “tagged” by the IR tagging system, a sound will go off
- Delay time after each tag shall be 5 seconds
- When either robot has been “tagged” 3 times, the bot will shut down, indicating the game is over.
- The entire game will last from 10-15 mins
- As a senior design project for Spring 2016, the project shall be completed by May 13th, 2016 Monday, May 9, 2016 2:45PM – 4:45PM (Final day) on the linoleum floor of ECS315 at CSULB.http://web.csulb.edu/depts/enrollment/registration/final_exam/spring_chart.html
- As a senior design project for Spring 2016, Documentation of the 3Dot Spider-bot shall be completed by the 25th of April http://web.csulb.edu/~hill/ee400d/Syllabus.pdf
- The 3DoT David shall be a robot that demonstrates the capability of the new 3DoT micro-controller for DIY hobbyists.
- The 3DoT David shall be a low cost project with a total cost that does not exceed $79.95, which includes the cost for 3D printing, PCB, battery, and other components.
- To document the difference between development cost and final product cost, the 3DoT spider project must create a Project Budget and a Product Budget.
- The 3DoT David shall be controlled by the Arxterra App used on a smartphone.
- The 3DoT David shall incorporate 3D printed parts to demonstrate the feasibility of the 3DoT board for 3D printed robots.
- The 3DoT David shall have a maximum 3D printing time of six hours for production of parts to ensure the quick production of the robot. Any single print cannot exceed 2 hours.
- The 3DoT David shall compete with other robots in a game of tag to demonstrate the functionality of the robot. The basic rules of the game are using an IR emitter to tag the opposing robot, must compete in a 6×6 ft area, have a delay period of 5 seconds after each tag, and be disabled for 10 seconds after three tags.
- The 3DoT David shall utilize the HC-06 Bluetooth module on the 3DoT board in order to receive commands from the Arxterra App using a smartphone.
- The 3DoT David shall use a single 3.7V Lithium-ion battery or a 3.7V Lithium-ion Polymer (LIPO) battery to provide power for the robot. The 3DoT board will be providing power to all of the peripherals and uses a 3.7 Lithium-ion battery as its power source.
- The 3DoT David shall use two micro motors for the movement system of the robot.
- The 3DoT David shall use an infrared LED emitter and infrared detector for the tagging system in the game of tag.
- The 3DoT David shall be disabled for 10 seconds after being tagged three times to signify the end of a round in the game of tag. This means the robot does not respond to any commands for 10 seconds.
- The 3DoT David shall operate for 10 to 15 minutes, which should be equivalent to three rounds of the game of tag.
- The 3DoT David shall use a small speaker to produce the buzzing sounds to indicate the end of a round in the game of tag.
- The 3DoT David shall use a 3D printed chassis and legs. This follows from the project level requirement about using 3D printed parts.
- The 3DoT David shall include a PCB that uses a Schmitt Trigger circuit to convert the analog output from the IR detector into a digital output to be handled by the 3DoT board. It will also have a voltage follower and anti-aliasing filter for the synchronization of the two motors. This PCB shall also provide the connections from the 3DoT board to the peripherals such as the IR emitter, IR detector, and micro motors.
- The micro motors shall operate in between the supply voltage of 3.7V-5.0V, be able to rotate 360 degrees continuously, have a stall current of no more than 250 mA, and cost no more than $10 each in order to stay within our budget.
- The 3DoT David shall be made from PLA or ABS filament in order to minimize the mass of the robot and be strong enough to hold its weight.
- The IR emitter and IR detector shall be positioned at least 3 inches from the bottom of the 3DoT David.
- The maximum distance for the IR detector to detect a direct hit shall be 5 ft. This threshold is for when the IR emitter of the other robot is directly aligned with the IR detector, not when it is at an angle.
- The spider-bot shall have six legs to operate its course to battle robots.
Project key features
We have been working nine weeks to design the the Hex bug in Solid Work, in week 9 our team with the agreement of the customer decided to Change the design for these reasons:
The hex bug design:
- Had a lot of small parts that needed to be printed with precision
- It was very complex for a beginner in solid work to design without a professional formation and the right help.
- 3D print resource provided couldn’t print our small parts with the precision we needed.
- All the part for the design needed to be 3D printed which will be impossible to accomplish with the time restriction given by the costumer.
- We couldn’t use any option other than 3D printing to fit our budget.
The geared design:
- We were able to be creative and adjust the design to our needs.
- The gear movement need some adjustment since the prototype walked only straight. we added a motor to control each side of legs.
- By adding the motor we were able to compile the moment of the spider. When we turn off the right motor the spider turn right and vice versa.
- Less part to print and they all were able to print with precision
- We could of used different method like laser cutting to get some parts but the 3D printing time was enough for our requirements.
- The Solid work design level of complexity was little bit higher than the formation and help provided by the division for the manufacturing engineer but not as high as the level of complexity of the Hex bug design.
Tagging System (interactive game)
For the interactive game we had 3 options : Laser tag, IR tag, and Ultrasonic. After doing research on each option, we settled with IR tagging system for its safety. In the pictures below, some arguments about why we choose the IR are shown:
After assembling the 3DoT David, we found that the motor synchronization is optional. The leg position helped the robot to move forward even if the motors are not in sync. Before that, we looked at different possibilities on how to synchronize the two motors and it is shown on the table below:
We ended up choosing the Flex resistor. After implementing it to our robot we found that there is a slight improvement when the spider movement was more in sync. However, we decide to remove the flex resistor with the agreement of the customer because of the limited improvement and the limited number of pins available on the 3DoT board.
Innovative Design Solutions
In every step of assembling the 3Dot David, the team discovered issues. By brainstorming ideas, solutions are found and implemented into the design.
With the solutions found, legs, bottom plate, and top plate are adjusted in Solidworks. By adjusting the parts, the 3Dot David will be able to move freely as it accomplishes its mission.
Three tests were made in order to obtain stability for the gears moving the legs as it rotates. The first test was putting screws inside the center hole of the gears, but the screws were heavy affecting the motion of the gear. The second test was implementing white gears into the rapid prototype made of wood. The motors worked perfectly with these gears. However, the gears were too light, which causes concern when inserting the leg on the gear. The issue was solved by implementing extrusions on the testing board in the third test.
In order for the leg to rotate freely, the joint must be lightweight plastic material. The joint was made in solidworks. The concern about it is that making a connection to secure the joint to the gear. A second solution was made by inserting a tube as a joint. However, there is much labor in sanding the tubes. A joint solution is found by using one of the parts in the white gear bag for the legs to rotate freely.
The system design for the 3DoT David is explained in detail in the following blog post. The system block diagram, interface definitions, and system resource reports are all presented there.
If you want to be directed to a specific topic in the system design blog post use the links below:
- 1 System Block Diagram
- 2 Interface Definitions:
- 3 System Resource Reports:
IR Trade-off Study
This study shows off the emitters and detectors relevant to our project according to specifications made by the electronics and control engineer. There is a table with the specs of emitters and a table with specs of detectors.
Servos and motors trade-off study
This trade off study was conducted in order to determine the best way to control our spider’s walking movements. There are brief descriptions of what motors and servos are, and how one may work better than the other for our project.
Leg Movement Angle Study
Calculations are done to find the distance of the final lift of the leg attached to the gear from the surface by using trigonometric equations. The leg must be lifted in order the spider to walk. If the leg is not able to lift, the spider is not going to walk. Thus, a blocker is created to make the leg lift as the gear rotates 360 degrees.
The gear train is an important mechanism for the 3Dot David that keeps it moving from place to place. Calculations are done to get the reasonable rotational speed of the gear by finding the gear ratio and using the given rpm of the motor at 120 rpm, or 2 cycles per second with the large gear.
The first prototype is made with a Cam Simulation simulated in Solidworks. Further details to every part are explained in the CAM movement system. However, the design proved to be complex, and it could exceed the 6 hour limit printing time. The CAM simulation had many mates and crashed because of it.
IR Lens Study
This study was conducted to determine a lens for increasing the range of the infrared emitter to meet the game requirement of 5ft. We will see the various types of lenses as well as calculations for the physics of light through lenses. The conclusion shows what
Motor Driver Control
This blog post explains how we controlled the motors from the sparkfun Pro Micro using the sparkfun TB6612FNG motor driver. It includes screenshots of the code being used with the sparkfun Pro Micro board to drive PWM signals for how fast the motors should rotate, as well as test functions for turning left, right, and reversing.
IR emitter/detector testing
These are the test results of the IR tagging system done by connecting the schmitt trigger, BJT, emitter, and detector circuits. We show how the range is affected as we increase certain resistor values as well as the voltages being read from the output of the schmitt trigger and IR detector.
3DoT Board motor Current Safety Test
Since there was a change with the mechanical design of our spider, there was the issue of the old motors not being able to rotate the new gears. Therefore we needed to search for motors that were strong enough to turn the gears. The solution to the problem was to use geared motors, which are motors with a gear train that reduces their speed while increasing the torque. However, with this increase in torque, there is also an increase in how much current the motors would demand. We conducted a comprehensive test to show that the current would not exceed 450mA, where the results are stored inside of tables.
This matrix describes how each subsystem will be connected to the main controller (Atmega 32u4) and what those pins are referred to on each respective system. This is covered in more detail in the system design blog post.
Custom PCB Design
The PCB design includes a signal processing circuit, a BJT to drive current to our IR emitter, a speaker, and voltage buffers. Each circuit is thoroughly explained in the PCB design blog post
The Solidworks simulation folder has all the parts to simulate the 3Dot David. The adjusted parts for the Final David are the parts adjusted to solve issues as the team assembled it during the process.The mechanical design is explained in the link below:
The STL files are to be physically printed from Solid Work. The link below contains the zipped STL files:
The software design for the 3DoT David is explained in detail in this blog post. It goes into depth about the individual modules and what the software has to do.
Additionally, the specific changes to the Arxterra firmware as the project progressed are covered in the following blog post. It provides information on the addition and removal of code to accomplish the tasks laid out in the software design blog post.
Verification and Validation Documents
In order to prove that the desired product was built properly and achieves its purpose, verification and validation must be done. The verification and validation matrices lists the requirements related to the tests that must be performed and their results. Those documents can be found here.
The verification and validation test plans provide all of the instructions for the tests to be performed and can be found here.
Project final status
The picture below shows The table of task and status of completion. The important tasks were taken from the project schedule presented already on the CDR and PDR, Those tasks were used to build the the project percentage completion graph and burn down graph.
The graph below show the average Vs. the actual completion percentage by week during the 16 weeks of the semester.
Final burn down
The graph below show the average Vs. the actual task completion graph by week during the 16 weeks of the semester. As asked, when the teem start a task we mark it as 50% completed and when the task is completed we add another 50%.
From the burn down graph we can see that from week 6 to 8 our project was delayed because of issues of the old design. After week 8, we began working on the new design and we are able to recover the lost time.
Previous Project Blog Posts:
The following Table of Contents blog post was created to organize all of the blog posts for our project and make it easier for future students to access resources related to their role.
I found that the project manager position is the most stressful position in the 400D class since our grade is relies on the outcome of the project. But through this post. There were a lot of things that I had to learn on my own and I would have appreciated it if there was some kind of training plan for project managers. Additionally, I would have liked to be able to sit in on the training sessions for the other divisions, so that I could have a better understanding of what they were working on.
Issues encountered :
- I would advise to choose the right design from the beginning of the semester: our project start was very stressful during the first 8 weeks and that was due to the design that was assigned to us. The mechanism and the shape design was complex for a beginner in solid works specially if they could not get any useful information, which i think it was the division manager part.
- Improve IR range: It took both teams time to decide what type of tagging system to use between Laser, IR, LED and other than that the we couldn’t find a fast shipping for the lenses which delayed us more. We would have liked more time to test the IR tagging system before the due date
- Size of the Spider: After searching different kind of gear, we decided to use gears that will give us durability and stability unfortunately they were a little big. If we were able to find smaller gears we would of reduced the size of the spider
If we went back in time, other than applying for a division manager position, i would have chosen to implement the Jerry Mantzel mechanism instead of the Hex Bug mechanism that was provided.
By: Ayman Aljohani ( Project Manager)
Ayman Aljohani (Project Manager)
Tae Lee ( Mission and Systems Engineer)
Kevin Moran (Electronics and control Engineer)
Jerry Lui (Manufacturing Engineer)
The objective of the 3DOT Goliath is to design a small-scaled version of the Goliath Tank, as a toy, that meets the following
requirements: Safe: uses IR transmitter and receiver. Less than 6 hours printing time. Piloted via live cam on an Android phone. Low cost: should not exceed $80 total. Controlled by 3DOT board. Looks cool and inspired by the Goliath Tank. Periscope must be attached to an Android phone laying horizontally zero degree with the x-axis.
The mission profile of this project is to play a “laser-tag” battle with the 3DOT Spider. Every hit will require a 5 second delay in between to avoid multiple tags. With each hit the buzzer will make a sound to indicate that it got hit. After receiving the third hit the robot will be disabled and play a short song afterwards. The game will take place in a 6 ft. x 6ft area on the linoleum floor. The maximum distance for detection from the detector will be 5 ft.
Level 1 Requirements
- Laser tag game must be safe for children
- Uses IR transmitter and receiver to stimulate a game of tag
- Less than 6 hours printing time
- Piloted via live cam on an Android phone
- Low cost: should not exceed $80 total
- Controlled by 3DOT board
- Looks cool and inspired by the Goliath Tank
- Periscope on an Android phone degree with the x-axis
Level 2 Requirements
- The rover will be controlled by two individual DC motors (3-5V)
- Battery duration should last to the whole period of the battle 15 min
- Controlled via Bluetooth using an Android Device
- Print parts of rover individually
- LED will be used for a game of laser tag
- Laser sensors (on PCB) must be 3 inches
Preliminary Project Design Documentation found here
System Block Diagram
The figure below will show how each components on the Goliath will be connected and how they will interact with each other.
Uploading the Firmware onto the 3Dot Board
After assembling the 3Dot Board we need to program the ATMEL 32U4 chip by uploading a firmware. Without the firmware we will not be able to upload any programs onto the ATMEL 32U4. A detailed explanation will be provided by the following link: Upload Firmware
Troubleshooting the 3DoT Board
After assembling the 3Dot board I had to make sure that each component was soldered correctly. In addition, testing the motor driver by uploading a program using the Arduino IDE onto the 3Dot Board. To know more about the test procedure, check out the following link: 3Dot Board Troubleshooting
Arxterra Control Panel Test
To be able to use the Arxterra Control Panel from the website we had to perform a couple of tests. The test is to make sure that the communication between the android Arxterra application communicates with the Arxterra control panel (1) on the computer. To know how the test was implemented check the link: Arxterra Control Panel Test
Bluetooth Module Test
Before we implement the Bluetooth module onto the Arxterra Firmware we had to perform a simple test to see how the Bluetooth module functions. The test will allow us to see the information we send from the android device using the BlueStick Control, which will than be displayed on the Arduino serial port. The link will provide a detailed explanation of the test performed: Bluetooth Module Test
3DoT Goliath DC motor trade-off study
In this post, it was my job to narrow down from a few DC motors to just two and do a trade-off study in order to figure out which one would work best. The motors were compared in regards to customer requirements. The motor chosen had to fit all customer requirements, including some requirements needed in order to make the project successful.
Laser vs IR LED trade-off study
In the beginning of the semester, we began comparing two different method for meeting the project requirement of having a laser tag game. We tested both a laser and IR led with their respective receivers. The benefits of the laser were the range and low power consumption; the problem was the safety with using lasers. The IR LED was very safety to use, unfortunately the range was very low, as the light diffused. At this point we believed the laser would make the perfect candidate for the game.
Progression of laser tag components
In this post I explain my reasoning in the progression of the different technologies we wanted to use to make the laser tag possible. The laser and IR emitter were giving me trouble in order to design the game. Another idea was to use a visible LED and turn that into brighter light using the same idea of a flashlight. Testing proved successful as I was able to increase the range, and maintain the safety. As it would turn out, the LED light would not a viable option either, yes be ready to have your ideas rejected often, that is life.
Making laser tag possible: The Schmitt trigger
In this post I discuss why a Schmitt trigger is needed in order to make the laser tag game successful. Since I will be using an IR emitter/receiver, the signal output is analog which is very hard to control. By using the Schmitt trigger I am able to invert this signal and convert it to a single bit digital signal output, which we are able to monitor better.
Making laser tag possible: The receiver
By recommendation of my division manager, for the receiver we used an infrared transistor SPH 310 (Opto-semiconductor). In the post I include the analog voltages outputs using both Arduino plotter and monitor. You will find basic code to test the analog voltages as well as my EAGLE CAD drawing.
Making laser tag possible: The emitter
In this post I discuss the IR emitter, which is built by using a few resistors, an IR LED, and a 2n2222 NPN transistor. The calculation for the resistor that I have selected are provided. This emitter will be able to be controlled on/off by controlling the voltage that is sent to the base of the transistor. The EAGLE CAD schematic is also included.
The following table will provide the pins for the Atmega32u4 Microcontroller 3Dot Board:
Now we will narrow down the number of pins we will be using on the Atmega32u4 Microcontroller:
CUSTOM PCB DESIGN
3DoT Goliath PCB Testing
Once the PCB was assembled by manufacturing engineer, it was my job to ensure it would work. With the help of the division manager, and systems engineer we were able to determine the problem. The blog post goes through our mistake and how we solved the problem, as well as a recommendation for when you have to design your PCB.
Making Laser Tag Possible: Extending the IR Range
With the PCB working correctly, I realized that the range was around 6-8 inches. That range needed to increase in order to make a more entertaining laser tag game. With the help of a lens and an online formula I tried to concentrate the IR LED in order to increase the range. Here you will find a very helpful formula that will help you with this problem.
The PCB Layout
In this blog post you will find the process I had to go through in order to finalize the final PCB layout. From the design on Fritzing, to testing the circuit, and finally designing it on Eagle CAD. All files have been provided by Eagle CAD. Pay attention to the Phoenix 254 connectors, as well as grounding everything to ensure your circuit works.
PCB physical layout
For the PCB layout blog post I go detail on the methods and a few tips and tricks regarding the layout of the board and the usage of EagleCAD. The main thing to remember is the trace width guide. For boards that aren’t powering much (simple light show, 1 or 2 small motors) the trace width can be fairly thing but for anything that requires more power (over 500mA) one should consult the guide to properly determine the width otherwise it won’t be able to supply enough power.
Remember to manually layout your traces! The auto route is terrible.
The SMD soldering blog is just quick tutorial on how to solder small IC’s and surface mount components. I’ve included a very good video on how to SMD solder using a hot air gun and soldering iron for the larger SMD components (0805 resistors, etc.)
Note: Due to an issue with embedding the video won’t play properly. Open it in another tab and you’ll be able to view it.
3DoT Board Fabrication:
The 3DoT Board was soldered by project manager and tested by System Engineer.
Goliath Body dimensions
This blog was created to give a quick overview of our preliminary design and various features within Solidworks (filter types). Although this design was created before one of our manufacturing engineers had to drop the general dimensions remained the same. The body is still designed to house all of the components (3dot board or Arduino nano, battery box, motor cage, phone, etc.).
The filet options are mainly for aesthetic purposes. Instead of rounding off the corners of cutouts a conic rho profile can be used which generates a pointed, yet rounded, corner.
Final body redesign
Since the manufacturing engineer that was originally tasked to create the body had to drop the course, I had to redesign the body to meet the requirements set out from the beginning of the course.
This blog just briefly goes over what to be done and what compromises were made to meet the majority of the requirements (only one requirement was not fully met at 50% -> exact replica of Goliath tank).
Updated Laser Tag Communication System
The new modified flow chart (shown below) will incorporate the new laser communication system. New features will include an automatic turn after receiving a single hit to avoid multiple hits in less than a second. In addition, to disabling the Goliath and playing a short song after the third hit.
The finalized flowchart for the laser communication system for the Goliath is shown below:
The arduino C++ code that will be implemented in reference to the flowchart on the Goliath will be available by following the link: Goliath-Arxterra Firmware
Making laser tag possible: Putting it all together
The final blog post in the sequence of making laser tag possible. Here you will find the final product of the emitter/ receiver combo. I have also included a flowchart showing exactly how our circuit will work. The circuit is to detect three different hits by an IR LED. After each hit a piezo buzzer will make a tone sound, after the third hit we play a melody and the rover is deactivated. The final code and output results are included.
Arxterra Firmware Motor Control Modification Test
The 3Dot Board was not given at the time, so we had to use the Arduino Uno and the Arduino Motor Shield. The Arxterra Firmware that was given to use had the motor controls for the Sparkfun Pro Micro with the Dual Motor Driver. Hence, we had to make modifications to the firmware to work with the Arduino Uno and the Arduino Motor Shield.
3DoT Goliath IR Emitter/Receiver Code Test
The early stages of development of the laser tag system required research and testing. To see how IR worked we performed a basic test using IR Mid-Range Proximity Sensor (TSSP4P38) and a remote control (IR Emitter). Follow the link to see a detailed explanation of the testing procedure for the circuit setup and the code used to test the sensor.
Verification and Validation Test Plans
We will perform a verification on the requirements that was discussed by the customer. Each subsystem engineer will perform a verification test to verify that it meets level 1 and level 2 requirements. A verification document/verification matrix are given in order to verify each requirements.
In addition, a validation will be required to test the mission profile (rules of the game) by following a similar test plans as the verification. For validation we will validate the test plans using a validation document on how to perform the test and validation matrix to check off the validated requirement.
The WBS has been updated after resources allocations, one of the manufacturing engineer was assigned to work on PCB layout, and the other one was responsible for chassis design. A link to the WBS is here
This is our final Burndown chart
Here is a link to the Burndown chart
The project schedule is divided into two levels, high level requirement under “planning phase”, and level 2 requirements which is broken down to tasks. Project Schedule
Here is a screenshot of the updated project schedule. The project percent completion is 100% .
The project schedule was created on a very useful tool, Smartsheet. Here is a link to full details blog post. Smartsheet .
One of level 1 requirements is budget. It is the project manager’s responsibility to keep track of budget, one way to do that is to have a parts request form. Any team member should fill out the request, print it out, sign it , and get the PM approval before proceeding with any purchase. Our actual project budget is $85
Here is a link to Parts Request Form.
Here is a link to Project Budget.
As a project manager, I had to work closely with each division engineer, especially Systems Engineer. I learned a lot through this experience. In the beginning of the semester, we had to sit with customer, president, and student assistant to define level 1 requirement of the project. That process, iteration, is a continuous process in which a project manager verifies the customer’s requirements and provides options. The Goliath mission was to battle 3DoT Spider, thus it is important that both team work closely to define game rules and communications means between two robots. Also, another important thing is beam-width of IR, in our project we used IR, should be the same for a laser-tag game to be fun. The customer requirements will be very simple in terms of wording, but project manager and team should critically think of being creative thinking out of the box.
For a project to be completed in a timely manner, the team has to meet at least twice a week, one during regular class time, and another during the week. We had to meet three times a week to complete our project, twice on campus and once online. Communication between team member is highly important, so from the first meeting we decided to use Google Hangout app to communicate with each other.
Preliminary Design Review, and Critical Design Review should have detailed information about the project. Project Manager should start preparing for CDR and PDR two weeks before the deadline.
Project video is a useful tool to promote the project, thus it is advised that Project Manager plan the video from the beginning of the semester by recording clips of the engineering method followed toward the final product.
Smartsheet was a powerful project management tool that helped me easily managed my team. At the same time, it is good platform for communication between team members to have discussions about certain task assignment or requirement clarification. I strongly encourage project managers to use it, here is some information about it.
Blog post is a good way to pass the knowledge to successors, therefore I encourage all team members to post on Arxterra regularly.
After all, this was a challenging experience that expanded my understanding of real world engineering problems.
- Project Video
- CDR Presentation for Goliath (Prezi)
- PDR Presentation for Goliath
- Project Schedule on Smartsheet
- Verification and Validation documents
- Solidworks Chassis File for Goliath
- Fritzing Files for Goliath
- EagleCAD Custom PCB Files for Goliath
- Burndown Excel File
- Arduino and/or C++ Code
- Other Files (Parts Purchase Request) , Team Members Evaluation Rubric
BY: Christopher Hirunthanakorn (Missions, Systems and Test Engineer)
The purpose of this blog post is to summarize all of the work that has been done for the software design of the 3DoT David and inform the reader of the final state of the software. It will cover the software flow chart to introduce the tasks the software has to accomplish and then explain the different modules in the software block diagram. Finally, a brief overview of how each module works in the final version of the code will be provided.
Related Level 2 Requirement:
- The 3DoT David shall be controlled by the Arxterra App used on a smartphone.
Software Flow Chart
The software flow chart shown here shows what the modified Arxterra firmware that will be programmed to the 3DoT board will do. The program will start by initializing all pins and variables used such as the pins for the Sparkfun Dual Motor Driver TB6612FNG, the IR emitter, IR detector, and speaker. Next, it will check to see if a command is sent via bluetooth from the ArxRobot App. If a command was sent, the commandDecoder and commandHandler functions will be executed and the action related to the command sent will be done. When no command is detected, the program will check if the IR detector has registered a tag from an opposing robot. If it is tagged, a sound will be made and the tag counter will be incremented. When the tag counter reaches three, a song will play, the robot will be disabled for 10 seconds, and the tag counter will reset before the loop continues. If there was no tag detected, the program will send any telemetry data that is required. Currently, there was no requirement for the 3DoT David to send any telemetry back to the ArxRobot App.
Software Block Diagram
The software block diagram shown here explains what the different modules do and the types of inputs/outputs of each module. The modules are the commandDecoder, commandHandler, Move Robot, Motor Phase Control, IR Emitter On, Tag Tracker, Robot Disabled, and Telemetry.
For the commandDecoder module, the input is the command data that comes from the ArxRobot App through bluetooth. This data is sent one byte at a time and the commandDecoder module saves this data into an array. Once the entire array is received, this module verifies that all of the data was sent correctly using a state machine and that the command ID matches one of the defined commands. It outputs this array for other modules to use.
For the commandHandler module, the input is the data array containing the command information sent from the ArxRobot App. This module will check the command ID from the array and then execute the corresponding functions for that command. Those functions must be defined individually. If there are any custom commands that need to be added, a corresponding if statement is required to modify the commandHandler module to handle that command ID. There are no outputs from this module.
Move Robot Module
For the Move Robot Module, the input is the command data that comes from the ArxRobot App through bluetooth. This module includes all of the functions required to move the 3DoT David and is only executed when the move command is sent from the app. It uses the functions defined in the sparkfun_TB6612FNG.ino file and a custom function that operates the motors based on the direction of the move command that was sent. The outputs of this module are the control signals for the Sparkfun dual motor driver and the PWM values for the motor speed, which are designated as digital pins PB5, PB6, PC6, PD7, PF5, PF6, and PF7.
Motor Phase Control Module
For the Motor Phase Control module, the inputs are the current outputs from the flexible resistor sensors. This module processes those inputs using the code that was provided by the Electronics & Control Division Manager Jeffery Cool. It will compare the two inputs and determine if one of the motors is moving faster than the other. This works because the two inputs will be equal if the motors are in phase. The module will make the two motors in phase by changing the speed of the motors. The output of this module are the PWM values for the motors.
This module was tested and had a slight improvement to the movement of the 3DoT David but it was determined that it was not necessary. It is not implemented in the final version of the firmware because of the limited number of pins that are readily available on the 3DoT Board.
IR Emitter On Module
For the IR Emitter On module, there are no inputs. It will only be called by the commandHandler module when the correct command is received. The purpose of this module is to send the command signal to turn on the IR emitter and attempt to tag the opposing robot. It is not always on and will only be turned on when the correct command is received. The module outputs the control signal to the digital pin PD1.
Tag Tracker Module
For the Tag Tracker module, the input is the current output from the IR detector. If the signal that is being detected at the digital pin PD0 is low, that means a tag has not been detected. When the signal is high, this module will increment the tag counter which starts at zero. After the tag counter reaches three, this module will call the Robot Disabled module and then reset the tag counter to zero. This module will also create a 5 second delay before it checks the output from the IR detector to prevent consecutive tags. There are no outputs from this module.
Robot Disabled Module
For the Robot Disabled module, there are no inputs. When it is called by the tag tracker module, this module will prevent the robot from responding to any commands for 10 seconds and play a short song to indicate that the 3DoT David is disabled. There are no outputs from this module.
For the Telemetry module, the inputs will vary depending on what type of telemetry needs to be sent back to the ArxRobot App. This module will collect the current values from the sensors on the robot and send that information back to the app. It should be called at a maximum frequency of 1 Hz in order to prevent data overload. The output of this module will be a data array that is sent via bluetooth. For the 3DoT David, there was no telemetry that was required.
Implementation of modules
For the Move Robot module, the existing code was designed for operating a rover and needed to be modified to fit our robot’s movement system. With the new movement system design, both motors will need to be controlled at the same time in order to move because each motor is driving one set of three legs. Additionally, the smoothest movement of the legs required the PWM value to be set to the maximum of 255. If it was any less, the motion of the 3DoT David would look very slow and feel weird. Because of the way the ArxRobot App is set up, the user has to press and hold the direction button to increase the speed of the motors to move in that direction. The code was changed so that the PWM value would be a constant 255 and that the leg movements would be fluid.
For the IR Emitter On module, it was decided that the IR emitter will be turned on whenever the 3DoT David is moving and is off the rest of the time. This is because the ArxRobot App can only send one command at a time and the alternative method of controlling the IR emitter would be using a slider on the app to turn it on or off. Implementing this in the code was easily done by incorporating the command into section of the commandHandler function that executed the move commands.
For the Tag Tracker and Robot Disabled modules, code was added to the main loop to check the output of the IR detector and if the 3DoT David should be disabled. The code is executed after the commandHandler function is called and checks if the robot has been tagged. If so, a counter would be incremented and if that counter reaches three, the robot will be disabled. When hit, the speaker will make a sound and the robot will not check for tags for 5 seconds. When the robot is disabled, it will not respond to any commands for 10 seconds and play a short song to indicate this change. All of this is done by using a flag variable to keep track of whether or not a tag has occurred. The flag will be cleared after 5 seconds have passed. When this has happened three times, the code will enter a loop that keeps it from responding to commands for 10 seconds.
Additionally, all of the extraneous code that was a part of the latest version of the arxterra firmware was removed. This includes all of the telemetry and sensor definitions that were left over from older projects that are not being used for the 3DoT David. All of the code used for debugging and testing were also removed or commented out to make sure additional processing time was not being used up. Comments were also added to help future students understand how the code functions.