05/20/2015 TI Innovation Challenge Title: Electric Trike Submitted by: Abel Velazquez
Table of Contents Abstract.3 Introduction. 3 Technical Achievements Electronics and PCB Design 4 Mechanical Fabrication and Mounts 5 Calculations.5 Parts and Technical description Pedals Electronics..6 Main Battery Electronics..7 LCD with Touchscreen.8 Motor.9 Hardware and Software diagram...11 Bill of Materials...13 Division of Labor and Gantt Chart.14 Appendix A HUB Code..15 Appendix B Motor controller Code 54 2
Abstract In today s world, the continuously fluctuating gas prices and the lack of physical exercise reported by the average person, force a considerable number of people to rethink and reinvent their transportation options. As a result, many choose to bike to work or school, as a way to mitigate these problems. What if, however, you had a disability or a serious health condition that would prevent you from riding a bicycle? Or what if you simply don t want to be limited to just a plain bike? Life is complicated; some days you ll be in a hurry, and in those situations, practicality trumps healthy choices. But what if you could have it all? A vehicle that anyone can ride like a bicycle but that will assist you or even completely replace your pedaling if need be. That is what we proposed, tested, and built. An electric tricycle equipped with a motor that propels it, an LCD that displays relevant information, and a few sensors that will gather data corresponding to your caloric expenditure. I. Introduction Our design consists of an electric tricycle equipped with a brushless DC motor. The choice of a tricycle was not random. Since the seating position is different and it has three wheels, it s more comfortable and stable. As a result, it can be ridden by a wider number people. The DC motor can be driven using a throttle installed at one of the handle bars, a cruise control system, or both at the same time. Additionally, the three-wheeled vehicle has a number of sensors on board to provide the user with helpful information as well as control of the trike. Some of these sensors are used to calculate technical parameters, such as current drawn by the motor, and battery charge level. Others are be used for estimation of the effort made by the cyclist. All pertinent information is displayed on a touchscreen LCD. 3
Our project is targeting a wide market. It would be very useful for someone wanting to commute to school, work, grocery store, etc. In this sense, our electric trike can be used just like a regular bicycle, with the added bonuses of having to pedal less and being able to recline. From another perspective, however, the e-trike can be used as an exercise machine for people with limited mobility or other health conditions or disabilities, such as extreme obesity, missing limbs, etc. These are individuals who need exercise but require assistance from the machine. Pedaling is a low impact form of physical activity that engages the cardiovascular system, which makes it an excellent fitness option. Our e-trike gives you all the health benefits of a traditional bicycle without the limitations. II. Technical achievements Electronics and PCB Design - We designed, prototyped, and implemented our own motor controller board. The design reads the data coming from three Hall Effect sensors placed inside the motor, one for each phase. It then uses this information to determine the position of the rotor with respect to the stator and energize the corresponding phase using Pulse width Modulation (PWM). The system has two additional inputs: the Throttle and the Cruise Control. The generated PWM is a combination of these two parameters. The system also has an overcurrent protection feature that will turn all phases off if the current surpasses a certain level as well as a kill switch for emergency breaking. - We designed, prototyped, and implemented what we call the HUB, which is a central unit that controls the touchscreen LCD and the communication with the pedals. It also monitors the battery voltage level and the current in the motor at all times. It is here were we 4
implemented the cruise control. It reads the speed at which the bike is going and tries to match it the speed that the user sets at the LCD by either increasing or decreasing the PWM. - We designed, prototyped, and implemented a separate pedal board (one for each pedal) that reads the output of four pressure sensors as well as an accelerometer. These values are then sent to the HUB via an NRF24L01+ transceiver to provide the user with the angle of the pedals and the force applied on them. Additionally, each pedal board is equipped with a battery charging circuit that is hooked up to a solar panel, to recharge the 3.7V battery that powers this circuit. Mechanical fabrication and mounts - We made 3D printed models for our LCD mount, HUB mount, and pedal mounts. All models were designed in Solid Works and are currently mounted on the trike. - We laser cut a piece of transparent acrylic material to serve as the cover top for the HUB. It is designed to protect the central board from water, dirt, etc., as well as to protect the user from accidentally touching the 36V or 12V lines. We made the top transparent so that all debugging and status LED s we included can be seen at all times. - We mounted the DC motor on the trike, attaching a metal rod to the frame to prevent the motor from kicking when accelerating from a full stop. - We replaced the original pedals by the 3D models we made with all of our pedal circuitry. Calculations - We are calculating torque applied to the pedals, to then find out the power generated by the rider in Watts. This in turn is converted to calories, to be displayed in the main screen in the LCD. The original 5
III. idea was to use the angle of the pedal to figure out the tangential force being applied. This however couldn t be fully implemented due to time constrictions. This implies that our calorie calculation is not 100% accurate, but it provides for a decent estimate. In addition, we were planning to incorporate the weight of the person into the calculation to make it more precise, but unfortunately this wasn t finished on time either. - We are calculating the speed in miles per hour (mph) and in revolutions per minute (rpm), as well as trip distance in miles. To achieve this, we placed four equidistant magnets on the back wheel, and attached a Hall Effect sensor to the frame of the trike. We wrote our software such that we can measure the time it takes between each quarter of a revolution. We also know the circumference of our wheel, which can easily be obtained by 2*π*r. That gives us all the information we need to calculate mph, rpm, and total distance travelled. - Parts and Technical description. TI Parts MSP430F5510, MSP430F2274, LP2992, TPS79133, LM1117, LM2940,CSD19506 Pedals Electronics Power The system uses use a battery and a small solar panel, combined with a battery charging/power-path circuit designed by us. Battery [LIPO, 3.7V 1000mA] Solar Panel [ 5.5V 120mA 0.66W] Charger and regulators [MCP73831][ LP2992IM5][ TPS79133] Measuring the Angle 6
As mentioned above, our design has digital accelerometers on each pedal to obtain the readings. The data is fed to the microcontroller via I2C. The accelerometer provides x, y, z coordinates. We are using those values with a lookup table to find out the corresponding angle. We are only using the upper 12 bits. MMA8451 [±2g to ±8g, 14 bit ADC, I2C] Measuring the Force We used 4 resistive sensors on each pedal, taking an average of their readings at the pedal microcontroller. We are using 10 bit resolution in our ADC reading. Up to 400 N of force on each pedal Microcontroller As mentioned above, the purpose of this microcontroller is to collect, process, and transmit data to the HUB. There is one on each pedal. MSP430F2274 Parameters relevant to our application o Clock Speed: 16MHz o Program Memory: 32KB o SRAM: 4KB + 2KB o 4 16-Bit Timers with Capture/Compare Registers o Low Supply-Voltage Range: 3.6 V Down to 1.8 V o 2 10-Bit Analog-to-Digital Converters (ADC) channels With Window Comparator o 2 Universal Serial Communication Interfaces (USCIs) Data Transmission 7
To send the information collected we used a Nordic chip due to their low power qualities and long distance range. Interfacing with the microcontroller is done through SPI. Wireless Transceiver [NRF24L01+, 2.4GHz] Main Battery Electronics Battery ratings LiFePO4 Battery Pack Voltage [36V] Capacity [15Ah] Weight [12 lbs] Battery meter For the voltage sensing we have a voltage divider that brings it down from 40V (fully charged) to 3.3V. This is the input of one of the ADC s. Then as the voltage in the battery drops, so will the reading the ADC. Power Shunt resistor Voltage regulators Our original intent was to use an adjustable Switching voltage regulator [42V 2A] to use only one battery to power all. However, after unsuccessfully testing a variety of chips that were rated for and supposed to handle the amount of power that our system requires, we decided to a use a smaller 12V battery to power the 12V line in the H- bridge, with linear regulators to convert it down to 5V and 3.3V for the LCD and electronics, respectively. LCD with Touchscreen. Communication Protocol 8
We are using SPI to control and communicate with the LCD due to the fewer number of wires that need to be carried from the HUB. SPI (5 pins) 8bit mode (12 pins) Size, Resolution, and Features 3.5in (diagonal) 480x320 pixels with individual RGB pixel control 6 white-led backlight Input Touchscreen [Resistive] 4-wire interface. Works independently of the LCD. We are using two of the microcontroller s ADC channels to sample the x and y coordinates and detect when we have had a touch. Power Ratings Voltage [3.3V] or Voltage [5V] since the LCD circuitry includes a buck converter. Current [200mA]. Brain Microcontroller (HUB) MSP430F5510 Parameters relevant to our application o Clock Speed: 16MHz o Program Memory: 32KB o SRAM: 4KB + 2KB o 4 16-Bit Timers with Capture/Compare Registers o Low Supply-Voltage Range: 3.6 V Down to 1.8 V 9
o 2 10-Bit Analog-to-Digital Converters (ADC) channels With Window Comparator o 2 Universal Serial Communication Interfaces (USCIs) Motor Motor control circuit The trike only accelerates by using the handlebar Throttle [0-3.3V], as any typical motorcycle, or when the cruise control is activated. We are using 6 high power N-MOSFETs [200V 60A] Motor controller PCB (designed by us) Type Brushless [3-phase DC] Ratings Voltage [36V] Current [2A no load, 10A max] Power [350W] Current sensing We measured the voltage across a power shunt resistor with the ADC in the microcontroller. Once you know voltage and resistance, you can calculate the current in the motor. Power shunt resistor[0.5ω, 50W] Velocity Hall Effect sensor [US5881] Magnets[Neodymium 1/2 x 1/8 inch Disc N48] 10
IV. Hardware and Software diagrams. Figure 1. Hardware diagram Figure 2. General mounting layout. 11
Figure3. HUB and Motor controller software diagram. 12
V. Bill of Materials. Device Quantity Unit Price TOTAL MSP430 4 $ 2.55 $ 10.20 NRF24L+ 3 $ 1.23 $ 3.69 LDO 3 $ 0.87 $ 2.61 MOSFET 6 $ 5.04 $ 30.24 LED 15 $ 0.20 $ 3.00 NPN transistor 15 $ 0.31 $ 4.65 PNP tansistor 6 $ 0.31 $ 1.86 Diode 6 $ 0.84 $ 5.04 AD8304 5 $ 2.09 $ 10.45 2mm Connectors 11 $ 0.58 $ 6.38 Power Connectors 5 $ 0.50 $ 2.50 LCD 1 $ 39.99 $ 39.99 Load Cell 8 $ 9.99 $ 79.92 Solar Panel 2 $ 3.02 $ 6.04 Screw/pkg 5 $ 1.59 $ 7.95 Poly Capacitors 12 $ 1.15 $ 13.80 SMD Capacitors 30 $ 0.41 $ 12.30 SMD Resistors 35 $ 0.28 $ 9.80 PCB's 1 $ 83.01 $ 83.01 Accelerometer 2 $ 2.05 $ 4.10 LIPO Battery 2 $ 8.99 $ 17.98 36V Battery 1 $ 318.00 $ 318.00 Hall Effect 1 $ 2.03 $ 2.03 Magnets 8 $ 5.80 $ 46.40 Motor 1 $ 199.99 $ 199.99 Trike 1 $ 1,200.00 $ 1,200.00 Throttle 1 $ 10.99 $ 10.99 3D mounts 4 $ 5.00 $ 20.00 $ 2,152.92 Table 1. Bill of Materials 13
VI. Division of labor and Gantt Chart. Task Name Duration Completed Due by Dow n time Done by Week # Introduction (team) 0 0.5 0 0 0.5 Research/project proposal (team) 0.5 2 0 0 4 Reasearch parts (Team) 1 4 0 0 5 Order parts (Team) 1.5 3.5 0 0 5 Make Breakout boards /######/ &&&&&&& (Alejandro) /######/ /######/ / 2 1 0 0 3 Prototyping pedal sensors (Abel) 2.7 6.5 0 0 9.2 Testing motor /######/ &&&&&&& (Alejandro) 3.5 8.2 0 0 11.7 Prototyping Battery charging (Abel) 4 3 0 0 7 Prototyping LCD (team) 2.9 2.9 0 0 5.8 Prototyping motor controller (Abel) 5 4 0 0 12 Prototyping RF transceiver (team) 6 2.9 0 0 12 Make motor PCB (Alejandro) &&&&&&& /######/ /######/ /######/ 7.5 2.5 0 0 12 Make pedal PCB (Abel) 8.5 4 0 0 12 PCB assembly (team) 10 1 0 0 12 Debug PCB's (team) 11 1 0 0 12 Make enclosures and mounts (Abel) 12 2 0 0 12 Mount modules on the trike &&&&&&& (Alejandro) /######/ /######/ /######/ 13 1 0 0 12 Test trike (team) 14 1 0 0 12 Demo (team) 15 1 0 0 12 /######/ Figure 4. Task Chart. Figure 4 shows the division of labor and the tasks to be completed. The intention is to try to collaborate as much as possible to improve productivity. Figure 5 plots this data over the course of the semester. 14