top of page
mc.JPG

Machine Control Project

The Machine Control Project required me to use my knowledge of programming and functions to assemble a robot to complete several challenges.  I developed programs using RobotC , ran tests, made adjustments to the program, and added components to assist the robot.  Components such as line followers, encoders, limit switches, and servo’s were used to help the robot time it’s movements. ​

Challenges:

1. Use time only to control the robot to complete the course.

2. Use encoders only to control the robot to complete the course.

Bonus: Use line followers only to control the robot to complete the course.

Criteria and Constraints:

Must use the timer on the robot only to make the robot turn.

Use the encoder only to track rotations to make the robot turn.

Must use the line follower to follow the line to complete the course.

Robot must start at the starting line.

Robot must not veer off course.

Entire robot must be inside the finishing box.

Robot  must complete course.

mc1.JPG

Machine Control Activities

  • For my test bot I used the following devices to help the robot keep track of it’s movements.

    • Bump switch-When touched a part of the robot moves

    • Limit Switched-When touched a certain amount of times the movement changes direction.

    • Line Tracker-Senses dark and light colors on the ground.

    • Potentiometer-Measures rotation of a shaft.

    • Encoder-Counts how many times the wheels complete a rotation.

    • Ultrasonic Range Finder-Uses sound waves to find distance from an object.

    • Light Sensor-Senses the lighting in the room.​


  • ​I used code to link these devices together to control the movements of the robot. The following code below tells the robot to turn it’s LED on when the bump switch is touched:

mc2.JPG

Programming

  • Code 1 Activity 1

    • Ports one and two are the motors to the wheels.

    • “startMotor” tells the robot to go forward.

    • The “(port#, 95)” tells the port how fast the motor should go. In this case the value is 95

    • The “wait” command tells the robot to execute the command for how many seconds in the “( )”

    • “stopMotor” stops all motors

    •  By having a -95 in the “(port1, -95)” and a positive 95 in the other “( )” one motor will spin forwards while the other spins backwards, this causes the robot to turn.

    • After repeating these commands multiple times it manages the robot to stay on the line and finish in the finish box.

mc3.JPG

Programming Continued

  • Code 2 Activity 2

    • This program uses the encoder to count the number of degrees as the robot moves forward.

    • When the robot hits a certain amount of degrees it will turn.

    • On the vertical lines of the course the robot will move till it hits the value of 360 which is about 6 feet

    • On the horizontal lines of the course the robot will move till it hits the value of 120 which is roughly 2 feet.

    • The turn value is 100(90 degrees), on the turns the robot will keep turning till it hits that value.

Testing and Reflection

  • The robot traveled very well. It stayed on the line and made perfect 90 degree turns on all angles. The robot made it inside the box completely.

  • Issues I encountered were loose parts, coding errors, switched variables, misplaced wires, robot falling slightly off course, and not making precise turns.

  • Next time I would try to code something more specific so the revolutions and timing would be more accurate so there would be less errors in the testing phase. This would decrease the time for testing and the system would be less buggy and more efficient. I would also try to see if I can find a way to do all of these processes using less energy so the battery can last longer without using more power.

bottom of page