Module 6
General Instructions to write the Algorithms/Flowcharts/Pseudo code for any given task to
be performed by the manipulator.
➢ Students should utilize their knowledge learnt from Module 1 to Module 5
➢ Students can write their own algorithms/Flowcharts/Pseudo code, however it must
contain technical information. It should be logically correct and practically realizable.
➢ The answer must contain key concepts such as Robot Kinematics, Image processing,
Feature extraction, image segmentation, object recognition, trajectory planning etc.
Q.1. On a conveyer belt, some green, yellow, and black colour cold drink canes are running. A
manipulator is programmed to detect to count each of them and then fill a box (of capacity 30
canes) with 9 yellow canes, 10 green canes, and 11 black canes. Write an Algorithm/Flowchart
for the manipulator.
Q.2. A box contains 20 black and 13 Yellow balls. A manipulator is programmed to pick 2
balls at a time. The conditions for the manipulator are as follows:
➢ If the manipulator picks two balls of the same colour, it has to pick one more black ball from
the box.
➢ If the manipulator picks two balls of the different colour, it has to pick one moreyellow
ball from the box.
The process continues till the last ball left in the box. What will be the colour of the lastball left in the
bag? Draw a Flow chart/Algorithm for the manipulator.
Q.3. Write an algorithm to program a robot to pick up a part from point A and move it to point B,
followed by a move to a neutral position. Points A and B are to be defined by the programmer within
the robot’s work volume. Then the robot should pick up the part at point B and move it back to point
A, followed by a move to the previous neutral position. The robot can be operated continually in the
“run” mode to repeat the motion pattern over and over.
Q.4. Write an algorithm to program a robot to pick up two blocks (the blocks are of different sizes)
from fixed positions on either side of a center position and to stack the blocks in the center position.
The larger block will always be on the other side of the center position. The smaller block is to be placed
on top of the larger block.
Q.5.
Q.1. On a conveyer belt, some green, yellow, and black colour cold drink canes are running. A
manipulator is programmed to detect to count each of them and then fill a box (of capacity 30
canes) with 9 yellow canes, 10 green canes, and 11 black canes. Write an Algorithm/Flowchart
for the manipulator.
Algorithm for the Manipulator
Input: Continuous stream of cans on a conveyor belt in different colors (green, yellow,
black).
Output: Boxes filled with exactly 30 cans in the specific ratio of colors (9 yellow, 10 green,
11 black).
Step 1: Initialize Variables
1. Define color counters: yellow_count = 0, green_count = 0, black_count = 0.
2. Set the target quantities: target_yellow = 9, target_green = 10, target_black
= 11.
3. Initialize an empty list box_contents = [] for storing can information in each box.
4. Set box capacity box_capacity = 30.
Step 2: Configure the Manipulator’s Kinematic Parameters
1. Define the kinematic parameters to control the robot's arm and gripper to move along
the X, Y, and Z axes to:
o Detect cans on the conveyor.
o Pick and place cans into boxes.
2. Set the manipulator’s motion range, angles, and link lengths based on the conveyor
and box position.
Step 3: Image Detection & Feature Extraction
1. Attach a camera or sensor to detect cans as they pass by.
2. Process each image frame with the following steps:
o Image Segmentation: Separate the cans from the background using color
segmentation.
o Color Detection: Identify the color of each can (green, yellow, or black) by
RGB or HSV color values.
o Feature Extraction: Extract can features (color and position) for object
recognition and tracking.
Step 4: Object Counting & Storage Decision
1. For each detected can:
o Increment the respective color counter based on the detected color.
o Add the can information (e.g., color and position) to box_contents.
2. Check if the box contains the required number of each color:
o If yellow_count == target_yellow, green_count == target_green, and
black_count == target_black:
▪ Move to Box Completion.
o Else, continue detecting and sorting cans.
Step 5: Trajectory Planning for Picking & Placing
1. Trajectory Calculation: Plan the trajectory for picking the detected can from the
conveyor and placing it in the box.
2. Use Inverse Kinematics to calculate joint angles for each move.
3. Implement the trajectory, ensuring the manipulator arm smoothly moves between the
pick position (on the conveyor) and place position (in the box).
Step 6: Box Completion
1. When the box contains 30 cans in the specified ratio:
o Signal the manipulator to close the box and move it to the packing area.
o Reset yellow_count, green_count, black_count, and box_contents for the
next box.
2. Repeat Steps 3 to 6 until all cans are packed.