71
Balancing Omni-directional, Multi Surface Skateboard (BOMSS) Final Design Report March 2, 2010

design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

  • Upload
    lyxuyen

  • View
    224

  • Download
    9

Embed Size (px)

Citation preview

Page 1: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

Balancing Omni-directional, Multi Surface Skateboard

(BOMSS)

Final Design Report

March 2, 2010

Casey Christensen

Harrison Cobb

Misael Marriaga

Page 2: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

2

Table of Contents

Requirements Specification ……………………………………………………………………………………….……………….. 3

Implementation Considerations …………………………………………………………………………………….….…… 6

Progress Breakdown Report ………………………………………………………………………………………………………... 7

Project Overview and Status …….………….…………………………………………………………………..……….……….… 8

Updated Project Test Procedures ............................................................................................. 10

System Progress and Accomplishments ……………..………………………………………………………….…… 11

Frame Design and SolidWorks Analysis ……………………………………………………………......…………… 12

Construction of the Metal Frame ………………….……....……………………………………………………………… 13

Fixation of Sprocket-to-Wheel Assembly ..……………………………………………………………...………….... 22

Lathed Axles ..……………………………………………………………………………………………………………………………… 24

Chain Alignment and Tensioning ………….………………………………………………………………………………. 26

Controls System and Simulation ………………………………………………………………………………………….. 28

Voltage Indicator Circuit …….……………………………………………………………………………………………..…. 43

Power Supply Circuit ….……………………………………………………………………………………………………………….. 44

Motors and Motor Driver ………….…………………………………………………………………………………………… 46

Microprocessor ………………………………………………………………………………………………………….……….. 48

Power Requirements .………………………………………………………………………………………………………………….. 49

Project Management Details ….…………………………………………………………………………………….…………….. 50

Budget Analysis ……………….……………………………………………………………………………………………..…… 51

Spring 2010 Schedule and Analysis …………………………………………………………………………………………… 53

Appendices ………………………………………………………………………………………………………………….……………. 55

Page 3: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

3

Requirements Specification

Balancing Omni-directional, Multi Surface Skateboard (BOMSS)Harrison Cobb, Misael Marriaga, Casey Christensen

OverviewRiding a skateboard can be difficult and discouraging to learn. We will create a device

that will allow beginners to quickly enjoy being able to ride a skateboard. It will also have a compact design that allows it to be easily maneuvered in an urban environment. The BOMSS will be a skateboard-style, self-balancing vehicle. Basic design consists of a platform for the rider to stand on, with two independently operated wheels fastened centrally to the underside. The BOMSS will be an enjoyable recreation vehicle for users of nearly any age that are looking for a unique and inventive new way to spend their time. Its maneuverability and ability to operate efficiently in many different environments will make it stand apart from other similar recreational and transportation vehicles.

Operational DescriptionThe design is a two wheeled, self balancing vehicle that provides a dynamic turning

radius, meaning that the turning radius is proportional to the velocity of the vehicle, with a near zero turning radius at no forward motion. If the vehicle, for example, is traveling at a rate of 4 m/s, the turning radius will be much greater and therefore more stable than if the vehicle were traveling at a rate of 0.5 m/s, where the radius would be significantly decreased. This will make the vehicle useful and easy to maneuver in an urban environment. The Balancing, Omni-directional, Multi Surface Skateboard (BOMSS) will utilize accelerometers and gyroscopes to sense the angular position of the skateboard with respect to the horizontal plane. This information will then be used as an input in its controls algorithm. The vehicle will be maneuverable in the forward and aft direction, as well as steering left and right.

Safety features will include a minimum rider weight and an anti-theft key. Before power is delivered to the system, the rider must insert a removable anti-theft key and then fully depress a mechanical weight sensor. Power is provided by a rechargeable, on-board battery.

Page 4: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

4

Technical Requirements:

1. The BOMSS will achieve a maximum speed of no less than 4 m/s (13 ft/s) and no more than 10 m/s (33 ft/s) for safety concerns.

2. The BOMSS will be powered for a runtime of no less than 60 minutes at an average of 30% maximum speed.

3. A turning radius of no greater than 1 m x 1 m (3 ft x 3 ft) at zero forward motion.4. The BOMSS will have a low battery indicator light (cutoff voltage to be determined).5. The BOMSS will be capable of carrying a 91 kg (200 lbs) adult over dense materials

such as pavement and concrete, on both a flat and inclined plane.6. The BOMSS will weigh no more than 23 kg (51 lbs).

Deliverables:

1. User’s manual2. Self balancing skateboard with anti-theft key3. CAD drawings, electronic schematics, 3D views and analyses4. Code and flowcharts5. Report of testing6. Final report

Testing Plan:

To ensure proper operation, the following tests will be conducted:

Run Time Test:To test run time, the BOMSS will be required to maintain operation for a total

time of approximately sixty (60) minutes. The rider will weigh between 91 and 100 kg (200-220lbs) and will be required to maneuver a predetermined course (refer to Figure 1) around the Harding University campus containing level planes, inclines, and declines over a multitude of surfaces. Riding times can be discontinuous, but a total time of sixty (60) minutes must be summed at an average of 30% of the maximum speed before the battery is recharged.

Page 5: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

5

Figure 1: The course the BOMSS will be required to navigate during the test period is indicated in red. The starting and ending place is the Pryor-England Science Center

highlighted in yellow. The BOMSS will complete the course at least once to demonstrate its ability to operate on varying surfaces. Care was taken in determining the course as to not encounter any dangerous traffic or intersections that would place

the tester in harm’s way.

Maximum Speed Test:To test the maximum speed, the BOMSS will be mounted and proven to travel a

measured distance in a given amount of time. A stopwatch will provide an adequate amount of accuracy. The distance will be forty (40) meters on a flat, asphalt or concrete surface. Time to travel this distance must be between four (4) and ten (10) seconds.

Turning Radius Test:To test turning radius, only a minimum turning radius will be required. The

skateboard will be placed inside a taped-off square of one (1) meter by one (1) meter, and then mounted. A satisfactory test will be if the skateboard can be maneuvered a full 360° without leaving the taped square.

Page 6: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

6

Implementation Consideration

The operational components will be contained in water and vibration resistant compartments where they will be protected from collisions with foreign objects. These compartments and the components they contain will be easily accessible to the user, while remaining “hidden” within the structure as to not interfere with the user’s ability to effectively operate the vehicle.

Page 7: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

7

Progress Breakdown Report

Page 8: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

8

Project Overview and Status

The goal of the Balancing Omni-directional Multi-Surface Skateboard (BOMSS) is to design a two wheeled, self balancing vehicle that provides a dynamic turning radius. A dynamic turning radius is such that the turning radius is proportional to the velocity of the vehicle, with a near zero turning radius at no forward motion. If this vehicle, for example, is traveling at a rate of 4 m/s, the turning radius will be much greater and therefore more stable than if the vehicle were traveling at a rate of 0.5 m/s, where the radius would be significantly decreased. This will make the vehicle useful and easy to maneuver in an urban environment. The Balancing, Omni-directional, Multi Surface Skateboard will utilize accelerometers and gyroscopes to sense the angular position of the skateboard with respect to the horizontal plane. This information will then be used as an input in its controls algorithm. The vehicle will be maneuverable in the forward and aft direction in this manner. Turning radius will be calculated by measuring a variable voltage through force sensors located underneath one of the foot pads.

We are currently on schedule in all areas, with the exception of programming the microprocessor. In the past six months we have overcome many unexpected roadblocks. The first major roadblock was concerning the issue of the actual weight of the skateboard. The initial construction was redesigned to minimize the amount and size of steel supports used. In doing this, frame weight was reduced approximately 3.7 kg (8 lbs) while rigidity and strength were maintained. The second roadblock was in mathematically deriving the equations of motion; the fall semester was spent working in conjunction with professors to optimize a robust mathematical model of the system. In constructing the voltage display circuit, multiple unexpected issues arose that eventually forced the simplification of the circuit to a single low battery indicator LED. In terms of programming the microprocessor, the provided support software and information are extremely vague, leading to intense research into its use in converting assembly into hex coding language.

At present, the milestones we have reached this semester are the construction of the metal frame, fixation of sprocket-to-wheel assembly, chain alignment and tensioning, lathing of the axles to appropriate diameter, completion of derivation of equations of motion and controls algorithm for the skateboard, construction of a virtual controls algorithm simulation, individual testing of the motors, successful microprocessor-to-computer linking with test code, power supply and voltage indicator circuitry bread boarding and debugging, assembly code familiarization, and motor controller testing.

Although the project is progressing smoothly, we do expect a minimal number of obstacles to arise. Implementation of the drive train will require excellent precision to ensure that binding and undue stress do not occur on the system. Because the skateboard will be

Page 9: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

9

exposed to multiple environments, all components must be compartmentalized and shielded while maintaining adequate airflow; this could become a challenge due to budget and space restrictions. Finally, there are still uncertainties in the implementation of the controls algorithm to software. All of these uncertainties will take time to address and resolve, but the forethought and research into them will reduce time lost in solving the problems that do arise. With this thought and time put into the project, these small uncertainties will not become roadblocks later. Each issue has a solution that can be easily implemented.

The completion of the BOMSS project will require simultaneous and seamless integration of all major components into the constructed frame, a robust controls algorithm properly manifested in software, ordering of professional circuitry, and integration of all circuitry components into the system. Prior to this final assembly, each piece will be tested independently of others to ensure smooth operation and minimized damage in the event of a single component’s failure.

Though we have reached many of our goals on schedule, we are approximately one week behind schedule. We do, however, believe that we will complete the BOMSS project on schedule and under budget.

Page 10: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

10

Updated Project Test Procedures

Initially, a single test was designed to demonstrate workability of multiple components of the system. This method was determined to have a high risk factor for failure based upon the large number of dependent pieces; therefore, we are proposing testing that comprises a greater breakdown of each individual component being tested. The original tests are not being eliminated, but will be run after each subsequent test is completed. We propose the following testing procedures:

Runtime Test

The BOMSS will operate at 30% of full motor capacity for a total duration of no less than sixty (60) minutes. This test will be conducted on a treadmill with no rider.

Maximum Speed Test

The BOMSS will operate at a maximum speed of no less than 4 m/s and a maximum speed of no greater than 10 m/s. This test will be conducted on a treadmill capable of said speeds with no rider.

Turning Radius Test

The BOMSS will complete a full 360° turn while remaining in a radius of no greater than 0.5m. This test will be conducted with a rider.

Incline Test

The BOMSS will operate both uphill and downhill at an incline of angle 3°, while safely controlled by a rider weighing approximately 80 kg (176 lbs). The incline will be provided by a treadmill operating at 30% maximum speed.

Multi-variable Test

The BOMSS will be required to maintain operation for a total time of no less than sixty (60) minutes. The rider will weigh between 91 and 100 kg (200-220 lbs) and will be required to maneuver a predetermined course (refer to Figure 1) around the Harding University campus containing level planes, inclines, and declines over a multitude of surfaces. Riding times can be discontinuous, but a total time of sixty (60) minutes must be summed at an average of 30% of the maximum speed before the battery is recharged.

Page 11: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

11

System Progress and Accomplishments

Page 12: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

12

Frame Design and SolidWorks Analysis

Before construction could begin, an accurate representation of the structure’s resilience was important. Without knowing if the frame would support typical operational conditions, the project required a detailed and complete analysis to ensure proper function. Therefore, an accurate model of the frame was constructed in SolidWorks and simulations were run to determine failure points, deflection amounts, and stress concentrations.

After completing the testing, it was determined that there was a point in the frame system that contained a greater stress level than any other areas: the axle. After further consideration and research it was determined that, although the axle carries the highest stress, it can withstand an excess of the loads that will be applied to it. Research was done on the AISI 1566 steel shaft we will use for the axles and the value for the yield strength was found to be 190-210 GPa. With this value known, it can be proven that the shafts are strong enough to support the weight we will impose on them. The axle will support approximately 2000 times more stress than expected load, making it sufficiently strong to withstand the maximum weight specification of 91 kg (200 lbs). This information proved the stability of the frame and allowed the project to proceed as planned. Figure 2 shows the results from the virtual testing of the frame/axle assembly.

Figure 2: The figure shows a perspective of the frame and shaft assembly after stress analysis using SolidWorks. A load was applied to both foot platforms to simulate a rider.

Page 13: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

13

Construction of the Metal Frame

As described in the SolidWorks Testing and Frame Justification section, the frame was found to be a suitable design and the construction could begin immediately. The frame was designed to allow ease of portability when not in operation and to require few storage requirements, so weight and overall size were heavily considered when designing the frame. The final frame dimensions can be seen below in Figure 3.

Figure 3: Completed dimensions of metal frame.

Page 14: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

14

Figure 4: Side, top, and bottom of metal frame. Black lines depict 1” square tubing while red lines depict 0.75” square tubing.

The frame was designed for structural integrity while remaining within the stipulated weight restriction. The smaller tubing, 0.75” square, is used in areas where bracing is needed and the 1” square tubing was unnecessary. The strength of both tubing sizes is virtually the same, so in these areas, using the smaller size does not weaken the frame structure, it only lightens the overall mass. The sides of the frame and the standing platforms are designed with 1” square tubing for superior strength and rigidity. All cross members and bracing were incorporated into the frame to help distribute the weight of the rider to the entire frame structure, not only the area where the weight is applied. This can specifically be seen in the side view. The four 0.75” tubing sections, denoted in red, to the far right and far left of the frame were placed there to take the weight of the rider and allow that weight to be applied to the entire frame. If these members were not included, the top of the frame and standing platforms would take the entire mass of the rider and the stresses would be too great, causing immediate failure of the structure. The weight can now “flow” through the smaller cross members and

Page 15: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

15

bracing so the entire structure can remain structurally sound. This is visually demonstrated in figures 5 and 6 below.

Figure 5: If there are no bracing elements incorporated into the frame side, the frame would deflect as shown. When the rider stands on the foot platforms, all of their weight is located at

two points, causing significant stress concentration and deflection. This analysis demonstrates the results of a weight in excess of 100 times greater than the 91 kg weight

limit for visual representation.

Figure 6: With bracing in the frame design, the weight is distributed to the entire frame structure. The overall shape of the frame is maintained with only slight deformation. This analysis demonstrates the results of a weight in excess of 100 times greater than the 91 kg

weight limit for visual representation.

Page 16: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

16

Figures 7 – 15 below show the progress of the build as well as the final product, seen in Figure 16.

Figure 7: Left side of the frame laid out ready to be welded.

Page 17: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

17

Figure 8: Initial assembly of the left side of the frame.

Figure 9: Completed left side of the frame.

Page 18: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

18

Figure 10: Initial assembly of the right side of the frame.

Figure 11: Completed right side of the frame.

Page 19: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

19

Figure 12: Both completed sides of the frame with the main drive wheels lying on the frame in position. The wheels are not attached and are only in place to show size and placement.

Figure 13: Assembly of right and left sides of the frame.

Page 20: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

20

Figure 14: Assembly of right and left sides of the frame.

Figure 15: Fully welded frame

Figure 16

Page 21: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

21

Figure 16: Frame in its completed form. Painting and finishing will be done after each individual component is fit to frame. The wheels are only attached to the frame for visual

representation. A temporary axle was used.

The completion of the frame will allow for the individual placement and alignment of each individual piece into the frame. The frame was designed so that each component can be moved a small amount about its mount to allow for exact alignment. Without proper positioning of each component, the devices, as a whole, will not operate smoothly and may experience unexpected failure or fatigue due to binding or misalignment. Completing this small task will ensure proper operation and a successful project. Also, there will be room provided to work on individual components that are incorporated into the frame. If an item needs to be removed for any reason, even when the frame is in its completed form, access to that component will not be hindered in any way by the frame design and structure.

Page 22: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

22

Fixation of Sprocket-to-Wheel Assembly

To ensure proper alignment of the wheel sprocket, there will be collars placed over the bolt threads so that any length necessary to allow exact placement can be made. If further adjustments need to be made to the sprocket-to-wheel assembly for any reason, it will simply require the loosening of the necessary bolt, shortening or adding spacers to the spacer, and re-tightening. By using this method, minute differences can be remedied with simple alterations and minimal effort. If the assembly was to be welded to the wheel, alterations could not be made in any way, making the welding and alignment job difficult to be made extremely precise. This process has not been completed, but is forthcoming. Figures 17 and 18 are a visual representation of the above description.

Page 23: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

23

Figure 17: Front view of wheel and sprocket assembled.

Page 24: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

24

Figure 18: Top view of wheel and sprocket assembly. Wheel (dark grey) has four bolts (two shown in red) passing through the gaps in the wheel design. There is a collar (blue) around

each bolt to aid in alignment and straightening the sprocket. The four bolts will butt up against a metal plate (blue) and the sprocket, holding the collar tightly against the two plates

creating a rigid affixation.

Lathed Axles

The axles were ordered larger than needed for both the main drive wheels and the safety wheels. The needed sizing for the main drive wheels is a diameter of 0.435” (1.105 cm), while the safety wheels are a diameter of 0.313” (0.795 cm). Axles were ordered at a diameter of 0.5” (1.27 cm) and were lathed down to the desired diameters. This was done because, to order the exact sizing needed, the cost would have more than quadrupled. Having access to a lathe in the engineering labs allowed for expediency and precision in the lathing process. Figures 19, 20, 21 below show the pictures of the axles before and after the lathing process, and how they fit onto the wheel bearings.

Page 25: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

25

Figure 19: Axle before lathing process. Diameter is 0.5” (1.27 cm)

Figure 20: Axles being lathed

Page 26: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

26

Figure 21: Lathed axles. Both shafts will be cut into two pieces each

Page 27: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

27

Chain Alignment and Tensioning

In order to efficiently transfer power from the motors to the wheels, all of the drive train components must be aligned with each other. If there is even a slight misalignment between any two sprockets, binding and undue stress will be placed upon the system, possibly causing a premature failure of one or more components. To properly align the motor and sprocket on the wheels, the axles will be lathed down to the appropriate size for the sprocket to snugly fit, and the wheels need to be mounted in the exact center.

First, the sprocket and wheel need to be assembled together in a fashion that will not allow any movement or flexing. The sprocket and wheel will be bolted together to ensure there is no movement. For more detail on the wheel and sprocket assembly, refer to the Fixation of Sprocket-to-Wheel Assembly section of this report.

Secondly, the motor must be mounted in a fashion that will also allow slight changes to be made with ease. The motor has a four-bolt plate affixed to the bottom side allowing a sturdy platform for mounting. Four holes can be drilled into the mounting platform of the frame, but if the holes are slightly off from the mounting hole on the motor plate, the alignment will be off. Therefore, a method was developed that will allow the motors to have the ability to be adjusted while attached to the motor mounts. Each motor has the ability to rotate approximately 20° in either direction, ensuring exact alignment of the chain, drive sprocket, and the motor sprocket. Figure 22 depicts the mounting method that will be employed for this device.

Page 28: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

28

Figure 22: The motor and mounting holes on the motor plate (red dashed) shown with the mounting plate (blue dashed). Adjusting slats will be cut into the frame mounting plate (black lines) so the motor can be adjusted by a small amount, as indicated by the arrows, to ensure proper alignment. When the precise position is found, the motor will be bolted down using

thread locking fluid.

Mounting plate affixed to motor

(Blue)

Motor (Red)

Holes/slats cut into frame

mounting plate

Page 29: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

29

Controls System and Simulation

The controls algorithm is based on solving a classical inverted pendulum problem. Proportional-integral (PI), proportional-derivative (PD), and proportional-integral- derivative (PID) controllers are widely used in controlling the behavior of such unstable systems. In BOMSS, a PI controller is used because the derivative terms (D) amplify noise and can cause the system to become even more unstable.

The controls system is designed to drive the difference between the rider’s commands and the actual states of the skateboard to zero. The main physical parameters, or states, that are desired to be controlled are the body angle of the skateboard with respect to the ground and the angular velocity of the wheels. The PI controller will take into account the commands from the rider to move forward, backwards, and turn, the inertia of the rider and skateboard frame, drive train, and electrical characteristics of the motors before running these parameters through a system of proportional and integral gains. The result is the necessary voltage to apply to each motor in order to drive the difference between the desired and actual states to zero. To verify the validity of the controls algorithm, the dynamics of the skateboard compensated with the controller were simulated in Simulink and Matlab. This allowed us to visualize the response of the skateboard to different disturbances.

The components of this simulation are related as follows. First, the role of Matlab is to load the physical parameters and controller gains into the simulation. Second, the block diagrams in Simulink are organized into the environment and rider’s commands, the controller, the skateboard’s physical model, and the virtual viewer. Third, the environment and reference generators consist of external conditions and commands, such as the gyro offset inherent in the angular rate sensor and battery voltage. Fourth, the controller acquires information from the sensors and calculates the pulse-width modulated signal that should be applied to the motors in order to drive the actual states of the skateboard to the desired reference. Fifth, the states modeled in the plant are then transformed into sensor readings that will be fed back to the controller. Finally, the virtual viewer is used to visualize the response of the skateboard.

The controls system of BOMSS was fully designed using Matlab and Simulink. Matlab was used to introduce simulation, plant, and controller parameters into the Simulink environment, which consisted of block diagrams modeling the dynamics of the skateboard and the rider. The microprocessor in BOMSS will contain the software that will perform the task of the PI controller. Another component used to model the skateboard was the Lego Toolbox for Robotics. Encoders, angular rate sensors, among other blocks in this toolbox, can be found throughout the simulation environment. This was a convenient way to get data sensor into the model.

The role of Matlab was to assign user-defined numerical values to the variables, such as physical parameters and controller gains, found in the Simulink model. Simulink was set up to execute a Matlab file, “param_BOMSS.m,” containing three lines of code before running the entire simulation. The commands in the M-file (a Matlab file with code) can be seen in Figure 23.

Page 30: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

30

Figure 23: “param_BOMSS.m.” Matlab file that is executed before running the simulation.

The code executed in this M-file opens three other M-files which load numerical values for plant, controller, and simulation parameters.

The first M-file executed by the code in Fig. 23 is “param_plant.m.“ The code can be found in Appendix A. The second M-file executed by the code in Fig. 23 is “param_controller.m.” The code can be found in Appendix A. The first section of the code calculates the gains of the PI controller using optimal control techniques. No details about optimal control theory are presented here. Finally, the virtual reality simulation parameters are loaded using the M-file “param_sim.m”. The code can be found in Appendix A.

The virtual reality simulation was programmed in Simulink using a combination of the blocks found in the Simulink Library and an imported library from Lego’s robotics toolbox. The general organization of the different block diagrams, referred here as subsystems, is shown in Fig. 24.

Page 31: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

31

Figure 24: General organization of simulation subsystems in Simulink. The subsystems are divided into the environment, the reference generator, the controller, the physical model of the skateboard,

and the simulation viewer.

The environment subsystem and reference generator are located at the left of the block diagram. The signal is sent to the subsystem modeling the dynamics of the skateboard. The physical response of BOMSS is then fed back to the controller since a classic feedback controls theory is used in this model. In the actual skateboard, the response is captured by the sensors, which send feedback information to the microprocessor in order to calculate the necessary voltage that should be applied to the motors. The last block to the right contains the subsystem responsible for the virtual reality simulation of the skateboard.

The environment block contains, perhaps, the simplest subsystem, shown in Fig. 25.

Figure 25: Environment subsystem in the Simulink simulation.

This subsystem contains two blocks representing the signal offset inherent in angular rate sensor used in BOMSS, and the battery voltage. We realize that the battery voltage is not constant, as it is represented here, but for simulation purposes, it is kept constant because the simulation time is short.

The reference generator block contains the subsystem modeling the rider’s behavior and commands. Figure 26 shows the reference generator subsystem. This subsystem is intended to simulate the desired linear velocity and desired turning rate of the skateboard.

Page 32: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

32

Figure 26: Reference generator in the Simulink simulation.

A signal builder provides the command for forward and backward motion, and turning of the skateboard in the simulation. The signal builder is shown in Figure 27.

(a) (b)

(c)

Page 33: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

33

Figure 27: Signal builder in the reference generator. Three different sets of signals are constructed to model three scenarios of rider behavior: (a) turning while moving forward, (b) forward and backward

motion, and (c) standing while turning.

The controller block is responsible for the drive and balance control of the skateboard. The inside of the controller block can be seen in Fig. 28.

Figure 28: Controller block in the Simulink simulation.

The Lego blocks are mainly used in this block. At the left of Fig. 28, the encoders, gyro, and battery receive signals from the block containing the physical model of the skateboard. The actual sensors will be used in the same manner in BOMSS; sensing the actual state of the skateboard and sending their signals to the microprocessor. The block with the Bluetooth symbol receives the signal from the reference generator. There is no actual Bluetooth device in the skateboard, but here this block is used to receive input from the rider. At the right of Fig. 28, the motor interfaces output of the pulse-width modulated signal for each motor. In BOMSS, the microprocessor will be used to calculate the pulse width modulated signals. The block called BOMSS_app contains the balance and driving algorithm and the gyro calibration task.

The gyro calibration task is a significantly simpler subsystem than the balance and driving algorithm, as it will shortly become evident. The gyro calibration subsystem is shown in Fig. 29.

Page 34: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

34

Figure 29: Gyro sensor calibration subsystem.

This subsystem represents a low pass filter that will be used in BOMSS to narrow the gyro signal to an average, which is later subtracted from the gyro signal to calibrate the gyro. See Fig. 30 for clarity.

(a)

(b)

Gyro

Rea

ding

(Deg

ress

)Gy

ro R

eadi

ng (D

egre

ss)

Time (s)

Time (s)

Page 35: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

35

Figure 30: Calculation of the gyro offset. (a) Signal of the gyro sensor before the low pass filter. (b) Signal of the gyro sensor after the low pass filter (gyro offset).

The inputs and outputs of the balance and driving algorithm subsystem are shown in Fig. 31.

Figure 31: Inputs and outputs of the balance and driving algorithm subsystem.

This subsystem shows that the signals from the sensors are sent to the PI controller. The controller contains a subsystem that calculates the pulse-width modulated signal for each motor. As mentioned before, the microprocessor is responsible of calculating the modulated signals.

The feedback PI controller is contained inside the controller block shown in Fig. 31. The subsystem is shown in Fig. 32.

Page 36: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

36

Figure 32: PI controller subsystem.

The difference between the reference and actual state variables are passed through the PI controller; this difference is integrated before passing through the integral gain. The signal from the controller is then sent to a subsystem that calculates the pulse-width modulated signal for each motor. This algorithm will be translated to software code and programmed into the microprocessor. The integral and feedback gains will be embedded in the code in order to properly amplify each state error and then used to determine the modulated signals.

Figure 33 to Fig. 36 show mathematical operations outlined in block diagram form. These operations will be programmed into the microprocessor in order to compute the reference and actual states of the skateboard, subtract the gyro offset from the angular rate sensor signal, and generate the pulse-width modulated signals. Note that Fig. 35 shows the angular rate sensor signal after the gyro offset has been subtracted.

Page 37: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

37

Figure 33: Cal Reference subsystem. It calculates the reference state variables.

Figure 34: Calculation of state of the skateboard.

Page 38: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

38

(a)

(b)

Figure 35: (a) Gyro sensor signal with offset. (b) Gyro sensor signal without offset.

Figure 36: Cal PWM block. It calculates the PMW required for each motor.

Time (s)

Time (s)

Gyro

Rea

ding

(Deg

rees

)Gy

ro R

eadi

ng (D

egre

es)

Page 39: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

39

The physical model of the skateboard is contained in the BOMSS block (see Fig. 24). The architecture of this subsystem is shown in Fig. 37.

Figure 37: Subsystem containing the physical model of the skateboard.

The plant subsystem is bracketed by two subsystems that contain mathematical operations in block diagram form. The actuator subsystem calculates the voltages applied to each motor, and the sensor subsystem translates the state variables from the plant subsystem into quantities used in the virtual reality simulation and the controller subsystem. The actuator and sensor subsystems are shown in Fig. 38 and Fig. 39, respectively.

Page 40: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

40

Figure 38: Actuator subsystem.

The magnitude of the pulse-width modulated signal for each motor is used to calculate the percentage of the maximum battery voltage that each motor should use. The dead zone of each motor is modeled with a built-in block from Simulink’s library.

Figure 39: Sensor subsystem.

The sensor subsystem, shown in Fig. 39, calculates quantities used by the virtual reality simulator and the controller subsystem (see Fig. 24). The inputs for this subsystem are the state variables from the plant subsystem. It is important to note here since this is probably the heaviest subsystem, mathematically speaking, that no derivations for the mathematical operations are presented here.

The viewer subsystem shown in Fig. 24 contains two scopes and a virtual reality visualization subsystem, as seen in Fig. 40.

Page 41: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

41

Figure 40: Simulation viewer subsystem.

The two most important viewers are the scope connected to the body angle, psi (ψ), and the virtual reality viewer. The scope shows how well the body angle is being controlled. The main purpose of the controls system described here is to maintain the skateboard horizontal, i.e., drive psi (ψ) (refer to Fig. 40) to be zero degrees. Figure 41 shows the body angle of the skateboard plotted in the scope during a simulation.

Page 42: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

42

Figure 41: Body angle response plotted in the scope during a simulation. The body angle is driven to zero to keep the skateboard horizontal.

The virtual reality simulation of the skateboard can be visualized using the built-in virtual reality block in Simulink. The virtual reality viewer subsystem is shown in Fig. 42.

Figure 42: Virtual reality viewer subsystem.

Time (s)

Body

Ang

le (

Degr

ees)

Page 43: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

43

Finally, the virtual skateboard is shown in Fig. 43.

Figure 43: Virtual skateboard.

The skateboard shown in Fig. 43 is a rough representation of the actual device. This virtual skateboard behaves based on the response simulated in Simulink. The virtual skateboard is seen to behave according to what one would intuitively expect the actual skateboard to do. Furthermore, it remains horizontal, verifying that the controller works properly.

Page 44: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

44

Voltage Indicator Circuit

It was decided that it is necessary to provide an indicator of the supply battery’s voltage, be it a digital display, LED display, or low battery indicator light. After attempting to design a three LED indicator, several unsuccessful attempts led to a simplified circuit utilizing a transistor to control the brightness of an LED. A circuit was designed to fully illuminate an LED at 24V and be “off” at 21V. The lower voltage was selected after studying the battery’s drain characteristics to prevent the battery from being damaged by excessive low voltage. A potentiometer is built into the circuit to provide “tuning” of the voltage cutoff. The PCB Artist diagram, as well as the etched materialization of this circuit is shown below in Figure 44.

(a) (b)

(c)

Figure 44: Multisim schematic (a), PCB Artist Diagram (b) and Construction (c) of Low Battery Voltage Indicator Circuit

Page 45: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

45

Power Supply Circuit

A necessary element of the project is circuitry to supply power to the microprocessor, gyroscope, accelerometer, rotary encoders and force sensors; to do this, a power supply circuit was designed to provide 12.8V, 5V, or 3V according to the appropriate sensor requirement.

The 12.8V is provided via a Powerstream model MW292 DC-DC converter, which minimizes power loss while also smoothing supply voltage peaks from the battery. The 5V and 3V requirements are reduced by voltage regulators. Even though voltage regulators cause greater power loss than some alternatives, the amount in this instance is minimal. The Multisim schematic and PCB diagram for the power circuit are shown in Figure 45 below.

(a) (b)

Figure 45: Multisim schematic (a) and PCB Artist Diagram (b) of Power Supply Circuit

The circuit has been breadboarded and proven to provide expected voltages, though the sensors are all simulated with resistors because of the lack of having them in a prototyped state. The group is trying to obtain pre-boarded sensors to eliminate the task of soldering the flat sensor chips onto an etched board. The breadboarded power circuit is shown in Figure 46 below.

Page 46: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

46

Figure 46: Breadboarded Power Supply Circuit

Page 47: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

47

Motors and Motor Driver

Using calculations made in the design phase, we determined that a motor power of 300W/motor would be adequate to maintain nearly 3m/s up a 10° incline. After searching online we purchased two 300W motors from Unite Motors through the website electricscooterparts.com. Model MY1016 motor’s rated voltage is 24V DC, rated current is 16.4A and rated speed is 2750 RPM. We decided to use a 24 volt power supply because it requires lower current flow, which will prevent the ‘burning out’ of sensitive components. The drawbacks to these motors are the weight (5.6lbs) and dimensions (4”x4”x5 3/8”), but the project will still remain within predetermined weight and size limits. The motor is pictured below in Figure 47.

Figure 47: Unite Motor Co. 24V DC, 300W Model MY1016 Motors

The original intent was to purchase 350W motors; however, after relentless searching, we were unable to obtain any motors of this power rating for a reasonable price. The decision to use 300W motors was made after it was determined that the supplied power would be adequate for meeting our requirements specifications. Also, the lower current draw would provide a longer runtime for the battery, which will increase our possibility of satisfying the determined minimum runtime of sixty (60) minutes.

Page 48: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

48

The hardware required to control this device was more difficult to obtain. Originally, we thought we would be forced to design a motor driver that would sustain current flow of 7.25A continuously. We eventually found a motor driver from Dimension Engineering that meets our requirements, the Sabertooth 2X10 pictured in Figure 48 below.

Figure 48: Sabertooth 2X10 (Dual 10A) Motor Driver

The Sabertooth 2X10 is configurable for individually and simultaneously controlling two wheels at a sustained 10A each, with bursts to 15A. This motor driver will be controlled by a signal from the microprocessor ranging from 0 to 5V, with 0V being full reverse, 2.5V being full stop, and 5V being full forward. The motor driver has been tested and is shown to be fully capable of controlling two 12V motors. Unfortunately, during the latest test to control the 24V applied to the skateboard motors, the motor driver burned out. We are currently seeking a replacement motor driver.

Page 49: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

49

Microprocessor

The main component of this project is Futurlec’s development board with a Microchip brand PIC18F458 PID microprocessor. With 32kb onboard flash memory, 10MHz crystal, 1 PWM output, 8 A/D converters and 34 I/O bits this microprocessor is capable of meeting our demands. The development board purchased is shown in Figure 49 below.

Figure 49: Futurlec’s PIC18F458 Development Board

To compile code, MPLAB IDE and MPLAB C18 software from Microchip were downloaded and installed so that C code could be written and compiled into hex code. Test code has been written and successfully loaded onto the microprocessor. Most recently, the Pulse Width Modulator (PWM) and Analog-to-Digital (A/D) converter pins have been implemented through written code. Also, the controls algorithm has been studied and derived, which will assist in programming the microprocessor. Input capture/Output compare (I/O) is being researched for use as a second PWM signal.

Page 50: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

50

Power Requirements

Due to the addition of force sensors after December, the power budget has been updated and can be found in Figure 50 below.

Figure 50: Updated Power Requirements

Page 51: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

51

Project Management Details

Budget Analysis

When the original budget was made, several aspects of the build process were not included as the team did not realize everything that would be involved. The rotary encoders for

Page 52: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

52

the motors were ordered as samples but never arrived and may need to be purchased in the near future. The expected cost of these items is yet to be determined. Similarly, the design now incorporates force sensors used for both the turning and weight sensing operations. These sensors were originally priced at $60.00 total, but have been found elsewhere for approximately $45.00. Several other items on the final budget were more expensive than estimated, but many items were able to be purchased at a lower rate than previously budgeted. The savings of $259.64 outweigh the $178.70 extra costs involved, so the budget now has more contingency and miscellaneous funds. The finalized budget breakdown can be seen in Table 1 on the following page.

Items Costing More Than Anticipated:

Lead acid battery (+ $13.00)

Gyro (+$11.49)

Attachment Hardware (+$10.00)

Motor Controller (+$82.49)

Wheels (+$16.72)

Force sensors (+ $45.00)

Rotary encoders (+ unknown at this time)

Total cost of underbudgeted items: $178.70

Page 53: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

53

Items Costing Less Than Anticipated:

Motors (-$35.88)

Accelerometers (-$4.00)

Lexan (-$22.36)

Metal (-$111.52)

Modular Encoders (-$20.00)

Microprocessor (-$56.10)

DC-DC Converter (-$5.26)

65 Tooth Sprockets (-$4.12)

Total saved from overbudgeted items: $259.24

Table 1

Item Cost Vendor Date Updated Ordered300W Motor (2) $37.06 each monsterscooterparts.com 11/4/2009 YLead Acid Battery $112.90 advancedbattery.com 11/4/2009 YAccelerometers (2) Free Samples Ordered freescale.com 10/1/2009 YDual Axis Gyro $11.49 digikey.com 11/4/2009 YLexan Sheeting $62.72 estreetplastics.com 10/9/2009 YMetal for Frame Construction Free Donations HU Metal Shop 10/13/2009 YModular Encoders To be determined honestsensor.com 11/1/2009 YForce Sensors $41.52 trossenrobotics.com 2/14/2010 YAttachment Hardware $20.44 fastener-express.com 10/28/2009 YWheel Shafts $19.05 mcmastercar.com 11/4/2009 YMicroprocessor $43.90 futurlec.com 11/14/2009 YMotor Controller $82.49 dimensionengineering.com 11/14/2009 YDC-DC Converter $26.45 powerstream.com 11/14/2009 Y#25 Chain with Master Link $11.86 each (2) monsterscooterparts.com 11/4/2009 Y65 Tooth Sprocket For #25 Chain $16.06 each (2) monsterscooterparts.com 11/4/2009 YDrive Wheels , Front Wheels $36.72 Bike City, Searcy AR 10/3/2009 YPro-Etched Circuit Board ~ $60.00 piclist.com 10/4/2009 NContingencies & Misc. ~ $202.36

Total Cost $850.00 Table 1: Updated Budget as of March 2, 2010.

Page 54: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

54

Spring 2010 Schedule and Analysis

Page 55: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

55

The spring semester’s schedule has undergone several changes since its estimation last semester. Most notably, the frame construction and the circuitry took longer to complete than proposed. These delays created delays because almost everything is dependent on the completion of the involved components. Because of the thoroughness of the controls algorithm, it is very likely that the programming will require less time than originally allocated. However, due to the slow start of the programming, we should complete the project right on schedule.

The next major milestone in this semester’s schedule is the preparation of the oral report on March 4, 2010. Immediately following this presentation, Harding University begins its week long spring break. After the break, any components that have not yet been completed must be finished shortly thereafter. Assuming no issues arise, the project should be completed on schedule.

Page 56: design... · Web viewThe design is a two wheeled, self balancing vehicle that provides a dynamic turning radius, meaning that the turning radius is proportional to the velocity of

56

Appendices

Technical drawings ……………………...…………………………………………………………………………….. Appendix A

MatLab Code …………………………………................................................................................. Appendix B

MPLAB C18 Code ………………………………………………………………………………………………………Appendix C

Shaft Data Sheets ……………………………………………………………………………………………..……… Appendix D

Battery Data Sheet ....………………………………………………..……..……………………………………….. Appendix E

DC-DC Converter Data Sheet …………….……………………………………………………………………...…… Appendix F

Motor Controller Data Sheet ………………………………………………………………………………………… Appendix G

Development Board Data Sheet …………………………………………………………………….……… Appendix H

Angular Rate Sensor Data Sheet ……………………………………………………………….…………… Appendix I

Accelerometer Data Sheet ……………………………………………………………...…………………….…… Appendix J

Modular Encoder Data Sheet …………………………………………………………………………………….…… Appendix K

Resistive Force Sensor Data Sheet ………………….…………………………………………………………. Appendix L