• No results found

5.5.1 Overview of software used for control of the tractor

Figure 5.7 shows which software is used to control the tractor. The external TruckLab PC has Linux Ubuntu as operating system. On this PC, Robot Operating System, MATLAB/Simulink and Arduino IDE are installed. Arduino IDE is an integrated development environment where the firmware of Turtlebot3 can be modified, new firmware can be developed and where firmware can be uploaded to the tractor via USB. ROS consists of software packages to control ROS based robots such as Turtlebot3, which forms the basis for the tractor. The robot can be directly controlled by sending ROS messages from the terminal on the external PC to the Raspberry Pi 3. The Secure Shell (SSH) protocol is used to login to the Raspberry Pi 3 from the terminal on the external PC. Thereafter the ROS messages can be send. The ROS wireless network is shared between the external PC and the robot. For more complex control MATLAB/Simulink control systems are used instead of using the terminal directly. The MATLAB script as shown in Appendix E gives the ability for manual operation of the tractor using the Logitech gaming steering wheel and pedals available in TruckLab. To be able to control the robot from within MATLAB/Simulink, ROS needs to be interfaced with MATLAB/Simulink. This interface is provided by the ’Robotics System Toolbox’ and the ’ROS toolbox’ for MATLAB/Simulink downloadable from [27]. These toolboxes enable sending and receiving ROS messages within MATLAB/Simulink. These messages are transmitted via Wi-Fi to the Raspberry Pi 3 within the tractor. The Raspberry Pi 3 has Linux Raspbian as operating system with ROS packages installed. The Raspberry Pi 3 is connected to the OpenCR 1.0 embedded control board via USB.

Figure 5.7: software used for control of the tractor

CHAPTER 5. OPEN LOOP CONTROL OF THE TRACTOR

The OpenCR contains an adapted version of the OpenCR firmware for Turtlebot3. This firmware is written in C++. The firmware contains functions from the ’Dynamixel SDK’. This is a software development kit which provides Dynamixel control functions. These functions are required to control the three Dynamixel XM430-W210-T, that are used in the steering system and the propulsion system. The memory inside these Dynamixels contains a control table, which is a software structure to which the control values are written and read from. As the configuration of the tractor is different from the original configuration of Turtlebot3 the OpenCR firmware has been adapted. The necessary adaptations needed to control the steering system and the propulsion system of the tractor are discussed in the next section.

5.5.2 Adaptations made to the OpenCR firmware to control the tractor

The changes which have been made to the OpenCR firmware are required due to the addition of an extra Dynamixel for actuating the steering system. Further some vehicle parameters need to be adapted. These parameters are the wheel radius, track width and turning radius. The ID and center position of the Dynamixel for steering and the wheelbase parameter L have been added. A function of the Dynamixel SDK has been added called ’GroupBulkWrite’. This function enables to control the steering system and the propulsion system simultaneously. An extra torque set function has been added for the extra Dynamixel. This function enables the torque of the Dynamixel. The

’Turtlebot3MotorDriver function’ has been adapted. The additions to this function include the calculation of δ based on ωz, vxand the wheelbase L as derived from (5.10) and the implementation of the polynomial steermodel as given by (5.7). As the original propulsion system of Turtlebot3 is controlled exactly similar to that of the tractor by using (5.13) and (5.14), no additional changes where needed to the firmware to control the propulsion system of the tractor. Adaptation of the track width, wheelbase and wheel radius has been sufficient. To manage the changes made to the firmware software versioning system GIT has been setup. The adaptations made, allow the testing of the steering system and the propulsion system of the tractor and control of the tractor in general. A complete overview of all the changes and additions to the firmware is given in Appendix C.

5.6 Summary

In this chapter the open loop control of the tractor has been discussed. To realize open loop control, the steering motor and the propulsion motors are actuated. The Dynamixel which actuates the steering system is position controlled. The two Dynamixels, which each actuate a rear wheel of the tractor, are velocity controlled. ωz and vx are dependent on each other for the configuration of the tractor having wheelbase L. The tractor cannot have an angular velocity if vx is equal to zero under the assumption that the wheels do not slip. This is different for the original unicycle configuration of Turtlebot3 where ωz and vxare independent. The Ackermann steering geometry lets each wheel roll without the tyres having a side slip angle. A two track vehicle with 100%

Ackermann geometry will steer in the same direction as the bicycle model for a given δ. This has been the motivation to calibrate the steering system of the tractor so that it’s geometry is as close as possible to the Ackermann geometry. It can be concluded that the steering system is close to having Ackermann geometry after the calibration procedure. A polynomial is used to transform the desired steer angle δ into a steering motor joint angle request. The observed δ resulting from a steering motor front joint value request, corresponds to the δ expected for Ackermann steering geometry with an RMSE of 0.6649. This error is the summation of the error in positioning the servo which results in an approximate RMSE in positioning δ of 0.19and the error caused by free play in the steering system. The linear velocities vx,l and vx,r of the left and right rear wheel have been determined. To be able to control the robot from within MATLAB/Simulink, ROS needs to be interfaced with MATLAB/Simulink. This interface is provided by the ’Robotics System Toolbox’ and the ’ROS toolbox’ for MATLAB/Simulink. As the configuration of the tractor is different from the original configuration of Turtlebot3 the OpenCR firmware has been adapted.

Chapter 6

Experiments

6.1 Introduction

The new version of the tractor is tested by doing several experiments. The battery has been tested. The limits of the propulsion system and the steering system have been determined. The new tractor is compared to a kinematic model. The consistency of a driven path while using the same inputs has been tested in open loop.