Starting from:
$30

$24

Lab 3: Inverse Kinematics Solution




The goals of this lab are to







Understand how to calculate the wheel speed given a desired velocity



Experience basic feedback control



See the need for higher-level reasoning / path-planning



You need:




A functional Sparkiduino development environment



A Sparki robot



A working implementation of the Odometry Lab code



The ArcBotics line following poster






Overview




A robot’s forward kinematics allow you to compute the final position of a robot given individual joint positions. If we wanted to be able to perform the opposite process – figuring out the joint positions required to move a robot to a desired position/configuration, we will need to utilize inverse kinematics. A robot’s inverse kinematics provide a joint configuration that will achieve a desired pose (in Sparki’s case: x, y, ). In this lab you will implement a feedback controller that navigates the robot from its current position to a provided goal position.




Instructions




Each group must develop their own software implementation and turn in individual lab reports. You are encouraged to engage with your lab partners for collaborative problem-solving, but are expected to turn in your own write-ups. If your group does not finish the implementation by the end of the class, you may continue this lab on your own time as a complete group.




Submit your code (.ino file) and a PDF write-up answering each question (please put the number of each question next to your answers, rather than turning in your answers as an essay).










Part 1: Compute the Inverse Kinematics of Sparki




Use the forward kinematic relationship for a differential wheel platform from the book
( ′ and ′ as a function of left and right wheel angle change) to calculate its inverse, that is left and right wheel angle change given ′ and ′ .
Part 2: Position Controller







(Position Error) Calculate the Euclidian distance between your current location and the goal position.



(Bearing Error) Calculate the angle between the orientation of the robot and the direction of the goal position.



For example, if the line between the robot’s position and the goal position is oriented 90 degrees to the left of the robot, is 90 degrees. If the goal is directly in front of the robot, is 0 degrees (and so on). You should use the function atan2() for doing this.




(Heading Error) Calculate the angle between the orientation of the robot and the goal orientation.



Using sparki.moveLeft, sparki.moveRight, and sparki.moveForward, create a controller that orients the robot toward the goal position (reduce bearing error to zero), drives to the goal position (reduce position error to zero), then orients to the proper heading (reduce heading error to zero). The robot’s odometry can be updated all at once after these three actions are taken.



Verify that your controller works by driving to known locations around the map!



Part 3: Feedback Controller




This portion of the lab is more challenging than previous labs. Be sure to e-mail Brad with questions as they come up so you have plenty of time to solve the challenges you encounter!

Calculate a change in position ′ that is proportional to , e.g. ′ = 0.1 ∗



What happens if you don’t set/enforce a maximum value that ′ can take in your IK code? Will your robot ever be able to rotate if ′ ≫ ′?




Calculate a change in rotation ′ that is proportional to and , e.g. ′ = 0.1 ∗ + 0.01 ∗ (make sure the direction of is consistent with your coordinate system)



What should you do to as the robot reduces its position error near to 0? Should you weight it more heavily if is large?




Create a proportional feedback controller that uses this signal to drive to a given goal. There are many valid ways to solve this problem. Describe your solution in your report.



You will likely have to update your odometry code to accommodate this new method of moving the robot! The function sparki.motorRotate(MOTOR, DIRECTION, SPEED) will be useful for this (http://arcbotics.com/lessons/moving-the-robot-home-lesson/).




Keep in mind that the robot can only rotate its wheel a small amount during the 100ms loop delay, which is usually going to be less than ′ and ′ . You may wish to scale the SPEED arguments for each motor’s motorRotate function call such that they are proportional to the ratio between ′ and ′ . (e.g.,: If ′ = 1.0 and ′ = 2.0, Right motor should run at 100% and left motor should run at 50%).




Verify that your controller works by driving to known locations around the map!
Part 4: Lab Report




Create a report that answers each of these questions:




Describe one condition where your controller from Part 2 might fail.



What is the role of the position error?



What is the role of the heading error?



Why include bearing error?



Describe how you implemented your feedback controller in Part 3.



Does your implementation for part 3 work? If not, describe the problems it has.



What are the equations for the final controller from your implementation? What are your equations for ′ ′ in your feedback controller?



What happens if you alter your gain constants (the 0.1 and 0.01 values in Part 3.1, 3.2)?



What happens if you increase these gain constants? What if they become too large?



What would happen if an obstacle was between the robot and its goal?



(Briefly) How would you implement simple obstacle avoidance using the ultrasonic sensor?



Describe what would happen if the obstacle-avoiding robot encountered a U-shaped object like this:















Robot Goal







What are the names of everyone in your lab group?



Roughly how much time did you spend programming this lab?



(Optional, confidential, not for credit) A brief description of any problems (either technical or collaborative) encountered while performing this lab (e.g., issues with the clarity of instructions, clarity of documentation, lab colleague’s behavior, etc.)

More products