ME 446 Laboratory # Inverse Dynamics Joint Control Reort is due at the beginning of your lab time the week of Aril 9 th. One reort er grou. Lab sessions will be held the weeks of March th, March 6 th, and the week of Aril nd. Objectives Add Friction Comensation for all three joints and investigate how well it works to cancel friction effects in the arm. Design and imlement an inverse dynamics control algorithm and comare its erformance to the PD lus feedforward control designed in lab. Investigate how well the arameters of the CRS robot have been identified and see if better values for the arameters of the system can be found. Part : Imlement Friction Comensation.. Identified Friction Curves. Below are exerimental friction lots that were identified on one CRS robot arm. Constant velocity and control effort (roortional to torque) was recorded and these lots show the best fit lines that were fit to the collected data. Use these straight line equations to imlement friction comensation for each joint of your robot arm. Make sure to not hard code the friction coefficients because these values will need to be tuned for your robot arm. Once you have friction comensation imlemented, adjust each joint s friction coefficients until you feel you have the correct coefficients for your robot arm. Pseudocode: if (joint_velocity > minimum_velocity) { u_fric = Viscous_ositive*joint_velocity + Coulomb_ositive ; } else if (joint_velocity < -minimum_velocity) { u_fric = Viscous_negative*joint_velocity + Coulomb_negative; } else { u_fric = sloe_between_minimums*joint_velocity; } Then after full control effort has been calculated, add u_fric to your calculated control effort. When testing only friction comensation simly set control effort only to u_fric.
Joint,+Viscous=.5,+Coulomb=.67,-Viscous=.477,-Coulomb=-.948 u Control Effort roortional to Torque - - u =.477w -.948 u =.5w +.67 sloe =.6 from v = -. to. - - -8-6 -4-4 6 8 ThetaDot (rad/s) Joint,+Viscous=.5,+Coulomb=.4759,-Viscous=.87,-Coulomb=-.5 u Control Effort roortional to Torque - - - u =.87w -.5 u =.5w +.4759 sloe =.6 from v -.5 to.5-4 - -8-6 -4-4 6 8 ThetaDot (rad/s)
Joint,+Viscous=.9,+Coulomb=.59,-Viscous=.,-Coulomb=-.59 u Control Effort roortional to Torque - - u =.w -.59 u =.9w +.59 sloe =.6 from v -.5 to.5 - - -8-6 -4-4 6 8 ThetaDot (rad/s) Part : Imlement the Inverse Dynamics Control Law on Joints Two and Three.. Inverse Dynamics This document does not go into detail on Inverse Dynamics control. Please see Section 8. of Robot Modeling and Control or section. of Robot Dynamics and Control second edition. Modify your feed forward control (but make sure to kee a backu) from lab to imlement Inverse Dynamics control for joint and joint. Start out by using the given arameters from lab, = [..8.76.75.98]. Recall from lab that is equal to: 4 5 c c l c c c + m l + I + m l For joint one kee the same feed forward control from lab tracking the cubic olynomial. + I So for joints two and three imlement the inverse dynamics control ττ = DD(θθ)aa θθ + CC(θθ, θθ )θθ + gg(θθ)
to track the cubic olynomial reference trajectory from art 4 of lab. This control equation is called the inner loo because it cancels the nonlinearities leaving the equation aa θθ = θθ. (This of course assumes we know the systems erfectly). Then an outer loo control is needed to control this linear set of equations. For the outer loo control use PD lus feed forward control and the same cubic trajectory from lab aa θθ = θθ dd + KK PP θθ dd θθ + KK DD θθ dd θθ aa θθ = θθ dd + KK PP θθ dd θθ + KK DD (θθ dd θθ ). Note that your K and Kd gains will be different from the PD lus feed forward values from lab. So given these equations, the flow of your code each samle eriod should be: ) Calculate the desired trajectory ) Given measured thetas, calculate actual states, error, error_dot, theta_dot. ) Calculate the outer loo control to come u values for aa θθ and aa θθ. 4) Calculate the inner loo control to find control effort to aly to joint and. 5) Calculate Lab feed forward control for joint to find control effort to aly. 6) Calculate friction comensation control effort given the velocities of joint, and. 7) Add the friction comensation to the control efforts calculated in and 4 above. 8) Write control efforts to PWM oututs to drive each joint. NOTE: When erforming the inner loo calculations there are a number of sin() and cos() calls. Try to minimize the number of calls to sin() and cos() by creating a float variable say float sintheta. Then each time into your lab() function set sintheta = sin(theta). Then use this variable every lace in your calculations where sin(theta) is needed. This way the sin(theta) is only calculated once er samle eriod. Tune your K and Kd gains to minimize error as the joints following the trajectory. After you have tuned your K and Kd gains for the two second trajectory you designed in Lab, create a faster moving trajectory to allow you to better tune your K and Kd gains and also to see the advantages of the Inverse Dynamics control law. Have the trajectory start, t=., at.5 radians. Have it follow a cubic ath for. seconds to.75 radians. Then have the joints stay at.75 radians until 4 seconds have elased. From 4 seconds to 4. seconds follow a cubic trajectory back to.5. Have time reeat every 8 seconds so that there is a ause between each cubic ath to the new joint angle. In addition to the cubic trajectory, your instructor will lecture on another way to roduce a trajectory. It uses a discrete aroximation of a transfer function to filter a ste inut to roduce a smooth command similar to the cubic trajectory. The M-file to roduce this C code is found here, htt://coecsl.ece.illinois.edu/me446/filterstetoc.m, and it should also be in your reository s Matlab folder. With this faster trajectory (which ever one you choose) tune your K and Kd gains to minimize error. Produce trajectory resonse lots along with error lots for your reort.
Part : Comare Inverse Dynamics Controller to PD controller. Part. Comare PD lus feedforward to Inverse Dynamics Below you will run a few comarisons between your PD control from Lab and the inverse dynamics control you just designed. Hoefully these comarisons will demonstrate that the inverse dynamics control does a slightly better job controlling the linkage. Each ste is listed.. Imlement your PD control from lab, but make sure to add the friction comensation you imlemented with your inverse dynamics controller. For this comarison remove the integral control. Have the PD control follow them same quicker trajectory you just designed. With the PD imlemented, tune its K and Kd gains to achieve similar error resonses as your inverse dynamics control.. Now that you have both your inverse dynamics controller with friction comensation and the PD controller with friction comensation working quite similar, we are going to add a known mass at the end effector of the robot. Then to comare, you will leave your PD controller gains unchanged and check the error resonses with this mass added. For the inverse dynamics control, you will modify the arameters of the system that take into account this extra mass. With the new arameters alied, run your inverse dynamics controller and see if there is a noticeable imrovement over the PD controller. Comare both the error eaks and the steady state error. The new arameters of the system with mass added can be found in the M-file htt://coecsl.ece.illinois.edu/me446/id_crs_withdisk.m. Notice how the arallel access theorem is used to add in the additional mass.. By comaring these two controllers can you say anything about the arameters we are using? Does Inverse Dynamics erform better? For examle has gravity effects been imroved? If not can any of the arameters be adjusted to imrove the Inverse Dynamics control. I do not want you sending a huge amount of time on this but enough time so that you can give some observations in your reort. Reort: (Minimal Requirements). Include the final version of your C code.. Include any Matlab M-files you created (if any). In your own words, exlain the inverse dynamics control algorithm. 4. Answer the questions found in the lab. 5. Trajectory resonse lots and error lots. 6. You observations about the arameters used.