1. Homepage
  2. Programming
  3. 4CCE1PHC Physical Computing - Assignment: Building a Robot Arm

4CCE1PHC Physical Computing - Assignment: Building a Robot Arm

Engage in a Conversation
UKKing’s College London4CCE1PHCPhysical ComputingBuilding a Robot ArmC

1 Introduction CourseNana.COM

Assignment: Building a Robot Arm CourseNana.COM

In this coursework, you will build a simple robot arm and control interface capable of basic pick and place tasks. The arm should use three servomotors for actuation, two for moving the arm itself, and one for moving its gripper. It is also designed to be controllable through a simple control interface, consisting of two knobs for adjusting the arm position, and a button to open and close the gripper. CourseNana.COM

2 Background Materials CourseNana.COM

Make sure you have everything you need to complete this assignment. CourseNana.COM

The hardware items should be included in your lab kit. CourseNana.COM

The following software should be installed on your computer: (i) a terminal program (e.g., xterm or similar on Linux/Mac OS, cygwin on Windows), (ii) a text editor (e.g., gedit or similar on Linux/- Mac OS, notepad++ on Windows), (iii) avr-libc (including avr-gcc, avr-objcopy and avrdude) and (iv) scopy. CourseNana.COM

Preparation CourseNana.COM

Item Qty CourseNana.COM

Orangepip Kona328 Development Board 1 USBTypeA-Bcable 1 Breadboard 1 TowerPro SG90 Micro Servo 3 Rotary Potentiometers 2 Push Button Switch 1 Lollipop Sticks 10 Double sided tape 1 Cotton Reels 3 Jumper wires 20 CourseNana.COM

Use the items in your lab kit to build the robot arm and its control panel. An instructional video on how to build the arm is provided on KEATS. You are permitted to make minor alterations to the mechanical design provided your robot follows the same basic layout of two rotary joints and one gripper. Use the diagram in Fig. 1 to build the circuit connecting the arm to the development board. To aid debugging, you may choose to do this in stages as you work through the tasks in §3 instead of completing the entire build in one sitting. CourseNana.COM

To complete the assignment, you will need the following files: CourseNana.COM

robot.c
librobot.h librobot.c k0000000.c CourseNana.COM


CourseNana.COM

Figure 1: Circuit. CourseNana.COM

Use the following commands to compile the program and download it to your development board: CourseNana.COM

1 $ avr-gcc -g -Os -mmcu=atmega328p librobot.c k0000000.c robot.c -o robot.elf
2 $ avr-objcopy -O ihex robot.elf robot.hex
3 $ avrdude -p atmega328p -c arduino -P COM8 -b 115200 -D -U flash:w:robot.hex:i CourseNana.COM

You should find that it compiles without errors. Adjust the port settings in the avrdude command if necessary to enable the program to be downloaded to the development board 1 CourseNana.COM

3 Tasks CourseNana.COM

Complete the following tasks.
1. The first task is to set up the push button to control the action of the gripper motor.
CourseNana.COM

To complete this part of the assignment, find and modify the following lines in the template file: CourseNana.COM

1 /* --------------- Begin Answer to Task 1a Here ------------ */ 2
3
/* --------------- End Answer to Task 1a Here -------------- */ CourseNana.COM

and CourseNana.COM

1 /* --------------- Begin Answer to Task 1b Here ------------ */ 2
3
/* --------------- End Answer to Task 1b Here -------------- */ CourseNana.COM

Implement code in the function init_button_sensor() to configure the appropriate digital pin of the development board as an input, so that it can detect when the push button is pressed. The function should make appropriate use the Atmega328P’s internal pull-up resistors to ensure that the state of the pin is well-determined at all times. CourseNana.COM

Implement code in the function read_button_sensor() to read the state of the appropriate digital pin of the development board. The function should return 0 if the button is pressed, and 1 CourseNana.COM

2. The second task is to set up the rotary potentiometers as control knobs to set the desired position of the arm’s main motors. CourseNana.COM

To complete this part of the assignment, find and modify the following lines in the template file: CourseNana.COM

1 /* --------------- Begin Answer to Task 2 Here ------------ */ 2
3
/* --------------- End Answer to Task 2 Here -------------- */ CourseNana.COM

Implement the function read_knob_sensor() to read the position of the rotary potentiometer us- ing the appropriate ADCs of the development board. The function should take an integer value knob as an input, where knob can take the value 0 if a reading from knob0 is required, and 1 if a reading from knob1 is required. It should return a floating point value corresponding to the position of the knob between zero (i.e., knob at minimum position) and one (i.e., knob at maximum position). CourseNana.COM

[8 marks] CourseNana.COM

3. The final task is to write code to configure the control of the main arm motors through pulse-width modulation. CourseNana.COM

To complete this part of the assignment, find and modify the following lines in the template file: CourseNana.COM

1 /* --------------- Begin Answer to Task 3 Here ------------ */ 2
3
/* --------------- End Answer to Task 3 Here -------------- */ CourseNana.COM

Implement the function init_arm_motors() to configure Timer1 of the Atmega328P to enable pulse-width modulation with the following characteristics: (i) it should enable the generation of two PWM waves from the same timer in Fast PWM mode, (ii) the PWM waves should have a period of 20 ms, (iii) it should be possible to adjust the duty cycle to implement pulses between 1 ms and 2 ms at a resolution of 0.5 μs. CourseNana.COM

Ensure that the final version of your code compiles and runs without errors or warnings. CourseNana.COM

[16 marks] CourseNana.COM

4. Optional task. Produce a video demonstrating you controlling your robot arm to stack the cotton reels supplied in your lab kit. The task should start with the cotton reels placed side-by-side on a flat surface, and end with the reels placed one on top of another, with green at the bottom, yellow in the middle and red at the top. CourseNana.COM

Up to 6 bonus marks are available for this task at the discretion of the marking team. Marks will only be awarded for videos that clearly show that (i) it is you operating the robot, (ii) the hardware has been built by you, (iii) the software running on the robot is the same as that submitted for Tasks 1-3 above. Videos submitted for this task must be in MP4 format (see submission instructions below). CourseNana.COM

Note that, total marks for the assignment are capped at a maximum of 30 marks, so bonus marks will not be awarded for this task to those who score full marks on all other tasks in the assignment. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
UK代写,King’s College London代写,4CCE1PHC代写,Physical Computing代写,Building a Robot Arm代写,C代写,UK代编,King’s College London代编,4CCE1PHC代编,Physical Computing代编,Building a Robot Arm代编,C代编,UK代考,King’s College London代考,4CCE1PHC代考,Physical Computing代考,Building a Robot Arm代考,C代考,UKhelp,King’s College Londonhelp,4CCE1PHChelp,Physical Computinghelp,Building a Robot Armhelp,Chelp,UK作业代写,King’s College London作业代写,4CCE1PHC作业代写,Physical Computing作业代写,Building a Robot Arm作业代写,C作业代写,UK编程代写,King’s College London编程代写,4CCE1PHC编程代写,Physical Computing编程代写,Building a Robot Arm编程代写,C编程代写,UKprogramming help,King’s College Londonprogramming help,4CCE1PHCprogramming help,Physical Computingprogramming help,Building a Robot Armprogramming help,Cprogramming help,UKassignment help,King’s College Londonassignment help,4CCE1PHCassignment help,Physical Computingassignment help,Building a Robot Armassignment help,Cassignment help,UKsolution,King’s College Londonsolution,4CCE1PHCsolution,Physical Computingsolution,Building a Robot Armsolution,Csolution,