solar gators docs documentation

87
Solar Gators Docs Documentation Release 0.1.0 Raymond Bernardo Sep 08, 2021

Upload: others

Post on 28-Oct-2021

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Solar Gators Docs Documentation

Solar Gators Docs DocumentationRelease 0.1.0

Raymond Bernardo

Sep 08, 2021

Page 2: Solar Gators Docs Documentation
Page 3: Solar Gators Docs Documentation

CONTENTS

1 Onboarding Guide 31.1 Join the Slack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Join the SolarGators GitHub organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Electrical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Lectures 52.1 Git and Github guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 BMS 73.1 What is Custom BMS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 Overview of the Orion BMS 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83.3 Startup Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Telemetry 134.1 GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.2 Telemetry Collector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.3 Car Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5 Auxiliary 335.1 Steering Wheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.2 Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

6 Power Board 356.1 Power Board PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.2 Trip State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366.3 Main State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

7 Motor Controller 397.1 Setting a Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397.2 Motor Controls PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

8 MPPT 43

9 Knowledge Retention 459.1 Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

10 Maintaining Website 4710.1 Getting Set Up Locally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4710.2 API Endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4810.3 DNS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

i

Page 4: Solar Gators Docs Documentation

11 Developing 4911.1 Using ClickUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4911.2 SPRINTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.3 Software Development Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.4 Hardware Development Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5311.5 Emulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

12 Code Templates 5712.1 C Header Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5712.2 C Source Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5812.3 C Header Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6012.4 C++ Source Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

13 Battery Box 6513.1 What is it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6513.2 What are the goals? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6513.3 What are the priorities? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6613.4 How does the system interact with other systems? . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

14 Brakes 6714.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

15 Chassis 69

16 Suspension 71

17 Body 7317.1 Knowledge Retention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7317.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7317.3 Manufacturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

18 Solar Array 7518.1 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

19 Composites 7719.1 Manufacturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7919.2 Knowledge Retention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

HTTP Routing Table 83

ii

Page 5: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Welcome to the documentation for Solar Gators at University of Florida. This site can be editted directly from ourdocs repository.

If you are new here please read our Onboarding Guide

CONTENTS 1

Page 6: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

2 CONTENTS

Page 7: Solar Gators Docs Documentation

CHAPTER

ONE

ONBOARDING GUIDE

1.1 Join the Slack

The only requierment for joining our slack is to use your [email protected] email. Our slack is so-largators.slack.com once you say hello! The main slack channels you need to be in are #announcements,#everybody, #integration_elec, and #new_member_elec.

1.2 Join the SolarGators GitHub organization

In order for you to have access to things like PCBs, and software we need you to create a GitHub account and join theSolar-Gators organizaiton. In order to join the organization you need to be invited so once you have an account go toslack and post in the #integration_elec channel for someone to invite you.

1.3 Electrical Systems

The car is made up of a bunch of systems in order to make sure the driver is safe and to allow the car to operate.

1.3.1 Battery Management System

The most important part of the whole car is the battery management system or BMS. We currently use 18650 lithiumion batteries and these are known to be highly volitile is not cared for properly. The BMS allows us to automaticallycare for them. The batteries have to be kept cool, have a maximum discharge, a minimum voltage and a maximumvoltage; the BMS makes sure all of those conditions are met and if they aren’t met it turns off the car and alerts thedriver, and those around that the car is unsafe.

1.3.2 Telemetry

In order for us to know more about the car, telemetry gathers data from the subsystems and relays it back to the pitcrew. This allows us to make strategic decisions, know why something went wrong if it did go wrong, and give usgeneral information about the cars state.

3

Page 8: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

1.3.3 Auxillary Systems

The auxillary systems or Aux team makes sure that all the innate functions of a car happen. Aux is in charge ofeverything from controlling the speed via cruise control, to turn signals, breaklights, headlights, and the horn.

1.3.4 Power Board

Power board is an important system tasked with handling the power calculations and comsumptions on the car. Theywork on creating efficient PCBs for power management.

1.3.5 Motor Controller

Motor controller is the system that interfaces closely with the actual motors on the car. Motor controller will becreating PCBs that help manage the car’s motors such as the cruise control PCB.

1.3.6 Maximum Power Point Trackers

The maximum power point trackers or MPPTs allow us to dynamically adjust the load seen by the solar array so thatwe can get the highest efficency out of them. They allow us to run the car off of the solar array. If the solar array isnot supplying enough power the battery supplies the rest, if the solar array is supplying more power than is requiredthe batteries will charge.

4 Chapter 1. Onboarding Guide

Page 9: Solar Gators Docs Documentation

CHAPTER

TWO

LECTURES

2.1 Git and Github guide

Below is a list of docs for our Electrical subteams.

5

Page 10: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

6 Chapter 2. Lectures

Page 11: Solar Gators Docs Documentation

CHAPTER

THREE

BMS

At any given time, our solar car will either be charging or discharging, and to make sure our batteries remain withinsafe operating conditions, we need to use a Battery Management System (BMS). The BMS takes inputs from eachbattery cell, such as voltage, current, and temperature, and is responsible for determining whether it’s safe to use thebatteries. Battery cells often have limits as to how much current can be drawn from them without significantly reducingthe capacity of the battery, so it’s important to always draw the right current, and recharge it with an appropriateamount. Cells also have a safe operating voltage they need to be within, and they also cannot be too hot. The BMSis responsible for regulating the current and voltage, and also disconnects the battery from the vehicle should thetemperature go outside a safe range, risking a fire. We also need a way to safely start up the car each time we want touse it. This is where the startup board comes in. It’s responsible for checking with the BMS, ensuring that everything’sokay, and then proceeds to start the vehicle safely.

The BMS subteam consists of Custom BMS, Startup, and Orion BMS

3.1 What is Custom BMS?

Currently, our team uses the Orion BMS system, and while it performs its function well, it can be expensive. We’reworking on developing a Custom BMS as a cheaper alternative that meets our needs.

3.1.1 Development Software

When working on developing a PCB which will meet our development needs, we use KiCad, a free and easy to usetool. If you’ve used Altium in the past, you’ll find this software similar. If you haven’t, here’s a helpful youtube series!

3.1.2 Needs and Functionality

As explained in the main BMS page, our custom BMS needs to monitor multiple inputs to determine safe and efficientoperating conditions. As previously mentioned, the goal of our unit is to replicate some of the functionality of theOrion BMS, and introduce some new capabilities not included.

7

Page 12: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

State of Charge Estimation

In addition to what was mentioned on the main page, the BMS is also responsible for state of charge (SOC) estimationand cell balancing. State of Charge can be defined as the ratio between Coulombs available to the maximum capacityspecified by the cell manufacturer. The current Orion BMS uses a method called Coulomb counting. A Coulomb isa measure of charge, and as you may know, current is measured in Amps, or Coulombs/Second. The Orion takes thecurrent going either in and out, and factoring in time, can estimate the amount of Coulombs which have entered thebattery. This allows us to have a live understanding of where the car is in terms of charge, and allows the team to planstrategy for the remainder of the race.

Although this method is great for a rough estimate, there are certain events that may lead to inaccuracies. A faultyHall Effect sensor (the current sensor), incorrect starting charge estimate, or degradation of the battery would all causethe behavior of the battery to change. To minimize these inaccuracies and create a more efficient SOC estimator, ourteam has been looking into the Extended Kalman Filter, which uses machine learning and previous known datapointsto create a model of how the battery will charge and discharge, and therefore a more accurate model for SOC.

Cell Balancing

A battery module includes multiple individual cells, all of which are wired in parallel. This has some advantages,including making it easier to replace if one goes faulty. However, a downside is that each cell will exhibit differentcharge - recharge behaviors. This leads to an unbalanced distribution of charge between cells, and eventually one cellmay recharge before the others. For safety, we can’t continue to charge the entire battery module, and we must stoprecharging. This is a loss of efficiency, as there’s space in the other modules which could’ve been used to power thevehicle. This is why we use cell balancing. If the BMS detects a cell that has a greater amount of charge than the rest,it’s capable of sending excess charge into a shunt resistor.

We’re hoping to implement a form of active cell balancing, in which we can direct excess charge to other cells, therebyincreasing efficiency even more.

3.2 Overview of the Orion BMS 2

The Orion BMS is a pre-manufactured device that can be purchased, which manages the battery pack through theuse of: 1 hall-effect current sensor, 8 temperature sensors in the form of thermistors, individual cell voltage taps, anisolation sensor, and a full pack voltage tap. The voltage sensors need to be precise, which is why one is given to eachcell. On the other, hand, we can use only up to 8 thermistors, just to get an idea of the average temperature within thebattery pack. Isolation is incredibly important in high voltage applications. We want to ensure that the voltage carriedthrough the vehicle’s wires and battery doesn’t come to harm the user. To do so, an isolation sensor is used to measurethe electrical isolation between the chassis (technically the Orion uses ground, but same difference) and the batterypack.

3.2.1 What it Does

In addition to ensuring that the battery pack doesn’t become unsafe (through high temperature, overcharging, highcurrent, and isolation faults), the Orion also provides us with the State of Charge and State of Health of the Batteries.A lithium ion battery has specific chemical characteristics that essentially mean the cell doesn’t charge linearly, interms of charge input and state of charge. Similarly, the relationship between charge input and cell voltage is not lineareither. So we cant just multiply our voltage by some constant to figure out SOC.

Instead, the Orion will use a method known as Coulomb Counting to guesstimate the amount of charge that’s enteredthe pack, and how much has left. Because SOC = Q/Qtotal, this is a reasonably accurate method. Although thismethod sounds almost foolproof, chemistry is really hard to estimate, and it means that you won’t always be able to

8 Chapter 3. BMS

Page 13: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

extract the amount of coulombs you put in. How many coulombs the battery can eke out varies, which is why to get asuper duper estimate, we need more accurate models. That’s why we’re working on a Custom BMS!

Quick Physics Talk

Okay now that we’re this far it’s best we review what a Coulomb even is. So a Coulomb is the SI (InternationalStandard) measure of charge. A single electron has a charge of 1.602*10^-19 Coulombs. I’m sure you’ve heard of theterm amperes, the basic unit of current. But to be a little more specific, 1 Amp is actually 1 Coulomb / Second. So thatmeans current is Charge/time, or dQ/dt, where Q is charge and t is time. When we integrate this, we can obtain Q!.

3.2.2 What it Does (Cont’d)

So how do we know Qtotal? Well, that’s a value the manufacturer provides. Along with State of Charge, the Orion isalso responsible for State of Health calculations. This is because as time goes on, Qtotal will decrease below what itwas originally manufactured for. I’m sure you’ve seen this on your phone or computer.

Documentation

This page will be updated frequently with more detail on the nooks and crannies of the Orion BMS. But as an EE/CEstudent, get in the habit of checking documentation, it’ll be useful for your future classes and career. Below is somedocumentation on how the Orion works.

Operation Manual

Utility Manual (Guide to Programming Orion)

Wiring Manual

3.3 Startup Board

As previously discussed, the BMS, whether the Orion BMS or an eventual custom BMS we may eventually build, isresponsible for taking various inputs from our battery pack, and converting those into signals we can use to determinewhether it’s safe to start the vehicle. The startup board uses the Discharge Enable (DE), Multipurpose Enable (ME),Charge Enable (CE), and Charge Safety Enable (CSE), as well as 12 Main (12M_L, active low signal) and 12 Trip(12T), which don’t come from the BMS. To get a better picture of how the BMS operates, refer to the Orion BMSsection. To gain an understanding of the other signals Startup doesn’t use, refer to the Orion BMS Wiring manualprovided on that page.

3.3.1 The BMS Signals

The four signals provided by the BMS may be self-explanatory, but it’s important to have a solid understanding of whatthey mean. The BMS signals are all open-drain, meaning when true the signal sinks current to ground when false,has high impedance. DE is an open-drain signal that pulls down to ground when the battery is able to be discharged.The ME does the same thing, though the Orion can be programmed to turn this signal on based on other user-definedcriteria. The two charge signals are used to determine whether it’s safe to charge, and the startupt board will connectthe solar array’s MPPT to the battery pack if they’re both true. CE and CSE are again an open drain output, and CE istrue when the batteries are adequately balanced, not full, and not too hot. The CSE signal is a little less useful for ourapplication, though similar to the ME, we use the CSE as a backup signal to stop vehicle charging should conditionsbe inadequate. In many traditional electric vehicle applications, the vehicle can get charge through two sources, eithera wall outlet or regenerative braking. CSE is primarily meant to allow the BMS to shut off wall outlet charging shouldthe analog on/off switch fail.

3.3. Startup Board 9

Page 14: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

3.3.2 The Other Signals

In addition to the 4 BMS sourced signals, there’s also 12 Main and 12 Trip. 12 Trip represents the supplemental powersupplied by a small lead acid battery that allows the vehicle to always be connected to some sort of power. 12 Mainrepresents the main power coming from the battery pack, and this signal is high when the battery is connected to thevehicle.

3.3.3 Startup Circuit

Schematic

Here’s a schematic of the current Startup Circuit:

10 Chapter 3. BMS

Page 15: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Startup Circuit Explained

The startup circuit (sometimes referred to as trip circuit) is meant to use digital logic to convert the signals discussedearlier in the introduction, to two active low signals, Trip and CTrip. Active low means that the signal is true whenthe signal is 0, or low. As discussed in the BMS section, when it is determined that it’s safe to start the vehicle, bothME and DE will be active, and will sink current. At this point, the driver may press a startup button that will connect12M to 12T temporarily, which finally makes all three signals active, and makes Trip active. Trip going active causesthe contactors to close, connecting power to the vehicle, and now 12M is sourced from the main pack. Our Trip signalalso controls a strobe light, because, as the name implies, this signal represents the car having tripped in some way.The way the current startup board is designed, this means that until the start button is pressed, the strobe will appearto indicate that the car is in unsafe conditions and in a trip state, when this may not be the case. However, this designis necessary, as it allows the driver to push a ‘kill-switch’ if they think something is wrong, and prevents the car fromimmediately restarting unless the driver pushes the start button. The CTrip side of things functions similarly, just alittle less complicated as it uses 2 signals instead of 3. When CE and CSE are true, it will send CTrip low, allowing usto close the contactors connecting the MPPT to the battery pack.

3.3. Startup Board 11

Page 16: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

12 Chapter 3. BMS

Page 17: Solar Gators Docs Documentation

CHAPTER

FOUR

TELEMETRY

On the race track we need to be able to see vehicle telemetry in realtime from the pit in order to make accuratedecisions. The telemetry information may consists of voltage, current, state of charge, temperature, GPS data, etc. Weneed a means of usefully displaying the information at the pit using a GUI. We refer to the team who creates the GUIas “Pit GUI”. The team responsible for the hardware & software that collects data and reports it back to the GUI is the“Pit Receiver”. The last, but not least team is the “solar car” telemetry team. They are responsible for collecting allthe telemetry on the car and send it back to the pit receiver.

The block diagram of how the teams interact with eachother below.

Fig. 1: Can be editted on: Google Drawing

The telemetry subteam is made up of the three following sections.

4.1 GUI

The code for this team is located in the pit-gui repository.

13

Page 18: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4.1.1 Getting Started

This is a brief guide that is broken down into steps meant for a variety of operating systems and skill levels. If youever have trouble feel free to reach out to a senior member.

Install NodeJS

First you need to install node v12.

If you’re running windows and want to follow the linux tutorial, my suggestion is to download Windows Subsystemfor Linux (WSL). It allows you to run a linux shell from windows easily.

Linux

Mac OSX

Windows 10

#Get Node sources$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -#Now install node$ sudo apt-get install nodejs

note: You may need to install curl if it’s not already

$ brew install node

note: You will need to install brew for this to work, refer to this article on how to do that.

Alternatively you can download node’s installer from their website, link is here.

14 Chapter 4. Telemetry

Page 19: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

The easiest way to install node on windows is to download the installer from their website. The link to their downloadpage is here.

To verify that Node is installed, run the following command from command line.

$ node -vv12.16.1

As pictured above v12.16.1 should be returned if node is correctly configured. If it does not get returned node maynot be installed correctly or is not you path and therefore not recognized by your shell.

Install MySQL

The next step is to download MySQL for the database. The steps for this will again depend on what OS you arerunning on.

Linux

Mac OSX

Windows 10

$ sudo apt install mysql-server# Start mysql server$ sudo /etc/init.d/mysql start

reference: How To Install MySQL on Ubuntu 18.04

$ brew install mysql

note: You will need to install brew for this to work, refer to this article on how to do that.

Alternatively you can download mysql’s installer from their website, link is here.

The easiest way to install mysql on windows is to download the installer from their website. The link to their downloadpage is here.

In order for our server to connect to mysql, we must create a user for it to login as. The server is configured to connectto mysql as solargators with no password. To create a MySQL user run a query. You can run queries in a varietyof ways depending on what platform you are on. If you are on Linux/Mac then you can simply run mysql fromthe command line and run the queries. However if you’re on windows then you will need to use a mysql client likeMySQL work bench.

To create a user run the following query.

CREATE USER 'solargators'@'localhost' IDENTIFIED BY '';

Now we need to give our user some permissions to access the database. Run the following query to do so.

GRANT ALL PRIVILEGES ON *.* TO 'solargators'@'localhost';

4.1. GUI 15

Page 20: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Install NPM Dependencies & Start

Now you need to install the dependencies, to do so run the following command from the root of the repository.

$ npm run install-all

Now we need to create the database. To do some run the following commands.

$ cd backend# Create the database$ npm run create-db# Migrate the database$ npm run migrate

To start the website in dev mode

$ npm start

The website will popup a new browser window at localhost:3000.

4.1.2 Folder Structure

The folder structure of this repo

..github # GitHub actions continous integration filesbackend # NodeJS serverclient # React App (frontend).gitignorepackage.json # Configuration file for npm (contains package

→˓dependencies)README.md

Backend

The backend is built for an API interface to drive the GUI. The runtime is NodeJS under the ExpressJS library. Isuggest doing some EpressJS examples if you are not fimilar with the library.

Resources: NodeJS Example, ExpressJS Example

The database used is a mongodb instance located on MongoDB Atlas. The API logic is loosely based on the Model-view-controller (MVC) pattern with the views being in React instead of with the backend files.

....backend # JavaScript backend scripts for the API server

config # Express/HTTP Server & Environment configurationcontrollers # Controller definitions (buisness logic of api

→˓endpoints)| helper # Helper functions| models # Mongoose schema definitions

routes # API express route definitions...

16 Chapter 4. Telemetry

Page 21: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Frontend

The frontend is built on top of ReactJS utilizing the Materialize library for the UI. The GPS mapping is done using theGoogle Maps components and the charts/graphs are created using D3.

....client # React frontend

public # Static public filessrc # React componets & source

...

4.1.3 SQL Schema Migrations

Sometimes we would like to change the schema of the database, create an extra table, etc. To do so we must createwhat are called SQL Schema Migrations. We use sequelize-cli for migrations, check out their documentation for moredetails on how to create migrations. We will go over how to make a basic migration.

First we need to create a sequelize migration script to do so, cd into the /backend directory, replace the ${NAME}with a custom name of your choosing and run this command.

$ npx sequelize-cli migration:generate --name ${NAME}

This will generate an empty migration skeleton in the /backend/migrations directory that looks like the fol-lowing.

module.exports = {up: async (queryInterface, Sequelize) => {},down: async (queryInterface, Sequelize) => {}

};

We will need to define our migration here using their api. Check their documentation for details on how to use it. Thefollowing is an example of creating a table called Instance.

module.exports = {up: async (queryInterface, Sequelize) => {await queryInterface.createTable('Instances', {

name: {type: Sequelize.STRING,allowNull: false,primaryKey: true

},type: {

type: Sequelize.STRING},createdAt: {

allowNull: false,type: Sequelize.DATE

},updatedAt: {

allowNull: false,type: Sequelize.DATE

}});

(continues on next page)

4.1. GUI 17

Page 22: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

},down: async (queryInterface, Sequelize) => {await queryInterface.dropTable('Instances');

}};

It is important that we define the down to undo what ever the up migration is doing. In this case we just need to dropthe table. Once we believe the migration is complete then run the following command to update the database.

$ npm run migrate

There should be no errors in the console after running this command. If there is then inspect the migration for it’saccuracy. The next step is to update the sequelize model in the /backend/models folder. For the above examplewe’d have to create a file called instance.js with the following code in it.

'use strict';const {

Model} = require('sequelize');module.exports = (sequelize, DataTypes) => {

class Instance extends Model {/*** Helper method for defining associations.

* This method is not a part of Sequelize lifecycle.

* The `models/index` file will call this method automatically.

*/static associate(models) {// define association here

}};Instance.init({name: {

type: DataTypes.STRING,primaryKey: true,allowNull: false

},type: DataTypes.STRING

}, {sequelize,modelName: 'Instance',

});return Instance;

};

Now we are done! We have created a migration. Check the official sequelize-cli documentation for more details.

18 Chapter 4. Telemetry

Page 23: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4.1.4 API Endpoints

GET /api/live/dataRetrieves the live telemetry data

Example request:

axios.get('/api/live/data')

Example response:

{"speed": {

"id":1,"speed":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"voltage":{

"id":1,"lowCellVoltage":20,"highCellVoltage":30,"avgCellVoltage":25,"packSumVoltage":200,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"duration":{

"id":1,"duration":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"temperature":{

"id":1,"temperature":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"stateofCharge":{

"id":1,"stateOfCharge":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"consumption":{

"id":1,"speed":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"panelPower":{

(continues on next page)

4.1. GUI 19

Page 24: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

"id":1,"panelPower":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

},"gps":{

"id":1,"heading":30,"latitude":"29.6472579","longitude":"-82.3496962","speed":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

}}

GET /api/graph/coordRetrieves the live graph data

Example request:

axios.get('/api/graph/coord')

Example response:

{"success": true,"data": {

"id":1,"heading":30,"latitude":"29.6472579","longitude":"-82.3496962","speed":10,"createdAt":"2020-05-10T12:00:00.000Z","updatedAt":"2020-05-10T12:00:00.000Z"

}}

POST /api/bmsCreates BMS data

Example request:

axios.post('/api/bms', {"lowCellVoltage": 20,"highCellVoltage": 30,"avgCellVoltage": 25,"packSumVoltage": 200

})

Example response:

{}

POST /api/gpsCreates GPS data

20 Chapter 4. Telemetry

Page 25: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Example request:

axios.post('/api/gps', {"heading":30,"latitude":"29.6472579","longitude":"-82.3496962","speed":10

})

Example response:

{}

4.2 Telemetry Collector

The code for this team is located in the telemetry-collector repository.

All communications from the vehicle come over the RFD900x module which reports UART back to us. This repositoryis the software responsible for decoding the message after it is sent over UART and sending it to the correct endpointon our GUI Server.

4.2.1 Model

The decoding of transmissions is roughly based on the OSI Model. Our implementation is simplified with three layersutilized, the physical layer, data link layer, and network layer. The first two layers are standard protocols that are listedbelow.

Physical Layer: UART Protocol

Data Link Layer: Byte Stuffing

The data link layer reports the data to the network layer which then reports to the correct database entry. The graphlooks a little like this

Custom (Network Layer)^|

Byte Stuffing (Data Link Layer)^|

UART Transmissions (Physical Layer)

Step 1: Data Link Layer

When the UART transmissions are reported to the Data Link Layer the messages are encoded using special bytes.There is a start byte indicating the beginning of a transmission and an end byte for the end of the transmission.Anything between the start and end bytes can be considered data. If the start or end bytes show up in the the datasection then they need to be escaped with the escape byte. The escape byte indicates that the next byte is a specialcharacter, but it can safely be ignored because it is part of the data. This prevents the transmission from ending early ifthe stop byte shows up in the data and other situations. Note that if the escape byte shows up in the data then it needsto be escaped too!

4.2. Telemetry Collector 21

Page 26: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Special BytesStart Byte 0xFFEnd Byte 0x3FEscape Byte 0x2F

Example

0xFF | 0x01 | 0x02 | 0x2F | 0x3F | 0x05 | 0x3F-----------------------------------------------START | DATA | DATA | ESC | DATA | DATA | END

Packet: 0x01, 0x02, 0x3F, 0x05

Step 2: Network Layer

The network layer is a custom protocol used for sending telemetry information in a way that is easily verifiable. Theprotocol is separated into messages and data. The first byte in the transmission is the number of messages in thetransmission. For every message there is an address, length and data package. The first byte contains the addresswhich corresponds to a telemetry item (ie Battery Cell 1, GPS, Temperature). The second byte in a message is thelength of the data packet that follows the first two bytes.

Below is a graphical representation of what a transmission looks like.

8 bit message length | { 8 bit address | 8 bit data length | 1 byte of data | ... n→˓bytes of data }

Decoding messages

After passing through the Data Link layer the packet is passed up the the network layer. As previously mentioned, thenetwork layer reports the telemetry addresses to be inserted. The telemetry addresses have been predefined as neededbelow.

Telemetry AddressGPS 0x00MPPT 0x01BMS 0x02IMU 0x03

Each telemetry has a custom method for decoding based on it’s needs. There is not a generic method that fits all ofthem, so each one has it’s own implmentation.

22 Chapter 4. Telemetry

Page 27: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Step 3: API End Points

After being passed through the network layer the data is delivered to the proper endpoint to be stored in a database.The list of endpoints can be found here.

4.2.2 Getting Started

To get started with the project you will need NodeJS and NPM installed. Then install the local dependancies using thenpm install command.

npm install

Then to start run the following command

npm start

4.2.3 Usage with Raspberry PI

The telemetry collector was designed to run on a raspberry pi during competition, although it is important to note thatit can run on any device that supports nodejs (nearly all). This guide is for getting your Raspberry PI working.

Hardware

• Raspberry Pi

• 8GB+ Micro SD Card

• Micro SD Card Reader

• Digital Analog Discovery 2 (optional)

Installing Operating System

Before we can start using our Raspberry Pi for anything, we need to get an OS installed. Raspberry Pi OS (previouslycalled Raspbian) is a free operating system based on Debian Linux, and it is optimized for Raspberry Pi.

I suggest downloading the Raspberry Pi OS Lite image from their downloads page. The lite OS does not come with agraphical interface, but we will not need it since we can do everything from the command line. The graphical interfacetypically slows down the Pi considerable and takes longer to install & setup.

Next we will need software to mount our OS to a Micro SD card. Download and install Etcher for mounting our OS.

4.2. Telemetry Collector 23

Page 28: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

To flash the OS onto the SD card, follow these steps.

• Insert the micro SD card into the card reader and verify that your computer recognizes it.

• Click “Select image” button and find the Raspberry Pi OS Lite zip file that you downloaded.

• Click the “Select drive” button and specify the memory card as the target location.

• Click the “Flash!” button to write the image to the memory card.

Configuring Network

After Etcher is finished writing we need to configure the network for the Pi to connect to. These instructions are forthe Raspberry Pi 3, which has built in Wi-Fi capabilities.

If you have an earlier version that does not come with Wi-Fi you will need a mouse, keyboard and monitor. Onceobtaining these items connect them to the USB and HDMI ports. A command line terminal will appear on yourmonitor when loaded. You can now skip to the Installing NodeJs section.

If you have a Pi that comes with Wi-Fi you can configure your Pi to automatically connect to your Wi-Fi networkon first boot. You will need to define a wpa_supplicant.conf file for your particular wireless network. Put thisfile in root of the sd card, and when the Pi first boots, it will copy that file into the correct location in the Linux rootfile system and use those settings to start up wireless networking.

After Etcher completes it typically unmounts the sd card, so you may need to unplug it and plug the card in again.

Copy the wpa_supplicant.conf example file below and add your ssid and password.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1country=US

network={ssid="<Name of your wireless LAN>"psk="<Password for your wireless LAN>"

}

24 Chapter 4. Telemetry

Page 29: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

source: Setting up a Raspberry Pi headless

To enable ssh access on boot an empty ssh file should be created at the root of the boot sd card.

After adding the files the directory should look similar to the following.

Now remove the micro sd card and connect it to your raspberry pi. Give it a few minutes to configure. Now we willneed to open up a terminal to test our connection to the Pi. This must be done from a computer connected to the sameWi-Fi network as the Pi. To open up a terminal in Windows we can use cmd which can be opened by entering “cmd”into the home search bar. If on Mac open up the search bar and search for “terminal”.

Run the following command from terminal to test your connection with the Pi. Please note that this will not workon UF’s Wi-Fi, you may need to use a phone hotspot for this to work.

$ ping raspberrypi.local

If connected correctly you should get several replies from the Pi. If not connected then you may get an er-ror similar to Ping request could not find host raspberrypi.local. Please check thename and try again. This could mean that the Pi is still configuring the as it is the first boot, the Wi-Fi isnot configured correctly, mDNS is not working correctly on your device. If you have access to the router the Pi isconnected to confirm that it is connected from the router’s setting page. On the setting page of your router, there shouldbe a list of devices and your raspberry pi should be listed there with an ip address.

If it is not listed, please verify the ssid & password configured in the wpa_supplicant.conf.

If it is listed and you still can’t ping it attend to ping it’s ip address directly (ie ping 192.168.0.1).

If you still can not connect, I would suggest getting a mouse, keyboard and monitor to continue manually.

The next step is to ssh into the device. To do so simply run the following command.

$ ssh [email protected]$ ssh pi@${IP_ADDRESS} # Replace with ip address of pi

4.2. Telemetry Collector 25

Page 30: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

After doing so you will be prompted to enter a password to enter, the default password is raspberry. After enteringyou should see an empty command line terminal.

pi@raspberrypi: ~ $

Installing NodeJs

Next thing to do is to install NodeJs as it is required for this repository. To start off run this command:

pi@raspberrypi: ~ $ sudo apt update

Now we need to pull in the node package.

pi@raspberrypi: ~ $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

Next install node.

pi@raspberrypi: ~ $ sudo apt-get install -y nodejs

Now to verify that node is installed correctly run this command:

pi@raspberrypi: ~ $ node -v

Clone Repository

Raspberry Pi OS does not come with Git preinstalled, so we must install Git to continue.

pi@raspberrypi: ~ $ sudo apt install git

Now clone the telemetry collector repository.

pi@raspberrypi: ~ $ git clone https://github.com/Solar-Gators/telemetry-collector

Install the npm dependencies in the repository.

pi@raspberrypi: ~ $ cd telemetry-collectorpi@raspberrypi: ~ $ npm install

You may see some C errors when serialport is installing, you can ignore those as long as npm does not give you anerror.

Configuring UART

The Raspberry Pi comes with an UART interface on the GPIO pin breakouts. GPIO pin 14 is Tx and pin 15 is Rx.

26 Chapter 4. Telemetry

Page 31: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

In order to access these pins you must disable the Linux serial console. To do this follow the following steps.

• Start raspi-config

pi@raspberrypi: ~ $ sudo raspi-config

• Select option 5 - interfacing options.

• Select option P6 - serial.

• At the prompt Would you like a login shell to be accessible over serial? answer No

• At the prompt Would you like the serial port hardware to be enabled? answer Yes

• Exit raspi-config and reboot the Pi for changes to take effect.

Source: UART configuration

After rebooting the UART interface will be accessible. Run the following commands to list the interfaces.

pi@raspberrypi: ~ $ ls -l /dev | grep serial

You should see an output that looks like this.

lrwxrwxrwx 1 root root 5 Jul 5 00:54 serial0 -> ttyS0lrwxrwxrwx 1 root root 7 Jul 5 00:54 serial1 -> ttyAMA0

The ttyS0 (alias serial0) file is the interface for the UART GPIO pins.

Now run the following command from the root of the repository.

pi@raspberrypi: ~ $ npm start

4.2. Telemetry Collector 27

Page 32: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

Testing With The DAD

We use the Digital Analog Discovery (DAD) board for various things in classes like circuits 1, digital logic, etc. MostEE and CE majors have one laying around, so if you do not have one feel free to ask around.

If this is your first time using the DAD then you will need to download WaveForms.

WaveForms has a useful feature called “Protocol” it is located at the bottom left of the main menu. It can emulatemany embedded protocols. The one we are interested in here is the UART protocol that our physical layer uses.

• Select the “Protocol” button from the main menu

• Select the “UART” tab if it’s not already selected

• Select “DIO 0” for the TX if it’s not already selected

• Select “DIO 1” for the RX if it’s not already selected

• Connect GPIO 15 on the Pi to DIO 0

• Connect GPIO 14 on the Pi to DIO 1

Once everything is connected and the node server is running (npm start) then click the send button on WaveFormsnext to TX on the protocol tab.

There should be an output error similar to this.

This error is occurring because the data link layer expects the first byte to be a start byte. See the data link layer sectionfor details.

Emulation

We have built an emulation library for emulating transmissions using the DAD board. See Testing

RF900x Raspberry Shield

A raspberry pi shield has been designed for the raspberry pi.

TO DO:

• Assembly Guide

• Usage Guide

28 Chapter 4. Telemetry

Page 33: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4.3 Car Software

The code for this team is located in the Telemetry_2019-2020 repository.

4.3.1 Getting Started

First install the STM32CubeIDE as that is what we will be using for our toolchain and to program our boards.

Next, clone our repository. Open the STM32CubeIDE on your computer and navigate to File->Open Projects fromFile System. . . . Browse by Directory to the “Telemetry_2019-2020” cloned directory and select it. Then as in theFigure below, only select the “Telemetry_2019-2020\dev-board” folder to import as an Eclipse project and selectFinish. Now the project should be imported and you can see it on the Project Explorer pane to your left. If you arefamiliar with Eclipse, this IDE behaves very similar.

4.3. Car Software 29

Page 34: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4.3.2 Building and Running The Code

To build this project, simply open up any file from this project in the IDE and select the build icon in the top toolbar.This compiles all the code and should succeed if nothing has been changed within the project.

In order to actually run the code on a microcontroller. Plug in either the development board for the stm32f072rb or aprogrammer hooked up to the stm32f072rb. If you are using a ST-LINK programmer proceed to the next paragraph,otherwise keep reading. If you are using the SEGGER-J-LINK programmer you need to access the Debug Configu-rations menu which can be found by clicking the dropdown arrow attached to the debug icon in the top toolbar. Oncein the Debug Configurations menu, you must select select the “telemetry-dev-board.elf” file from the left hand pane.Then, click the Debugger tab at the top and change the Debug Probe to “SEGGER-J-LINK” and click Apply.

Now that the correct programmer has been selecting and hooked up to the computer and microcontroller, we can loadthe code on to the microcontroller by simply clicking the debug icon in the top toolbar.

4.3.3 File Structure

dev-board Folder

This folder holds all the source code for the project for the Telemetry board from 2019-2020. There are also severaldrivers that were created and can be found in the nested directories in the Src folder. Examples of how to use all of thedrivers can be found in ‘Src/main.cpp’

CAN Driver

This can be found in the ‘subsystem-can-driver’ which contains all of the header files for the CAN API. An exampleof how to use the CAN-driver can be found in ‘Src/main.cpp’ and documentation for all of the functions can be foundin their respective header files. Important: no external code is needed in order to get the CAN driver to run, theCAN driver handles all of the CAN peripheral initialization and interrupt handling that would normally be found in‘main.cpp’, ‘stm32f0xx_hal_msp.c’, and ‘stm32f0xx_it.c’. Therfore delete any code related to CAN in these files.

Importing the CAN Driver to your STM32 project

1. Copy the ‘subsystem-can-driver’ folder into your project

2. Add the ‘subsystem-can-driver’ folder to your include path in your IDE for your g++ compiler.

3. If you are using STM32CUBEIDE to generate your code, then either make sure CAN is initialized in the .iocand you will have to repeat step 6 every time you generate new code, or you will need to repeat steps 4-6 everytime you generate new code.

4. If your project is not already using CAN, copy ‘stm32f0xx_hal_can.h’ and ‘stm32f0xx_hal_can.c’ from ‘dev-board/Drivers/STM32F0xx_HAL_Driver’ Inc and Src directories respectively.

5. Now in ‘dev-board/Inc/stm32f0xx_hal_conf.h’ uncomment “#define HAL_CAN_MODULE_ENABLED”.

6. Delete all CAN initialization/interrupt code from ‘main.cpp’, ‘stm32f0xx_hal_msp.c’, and ‘stm32f0xx_it.c’

7. You are now ready to start using this library!

30 Chapter 4. Telemetry

Page 35: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

RF Driver

This is a driver for the RFD900x board from RFDesign. The API for this driver can be found in the ‘transport-layer.h’for initalizing and sending out RF packets and ‘rf-message-helper.h’ for adding messages to the RF packet beforesending it.

GPS Driver

This is a simple driver for the Ultimate GPS Breakout from Adafruit that initializes and starts reception before checkingif data is available and then getting the latest data. This driver utilizes a FIFO, so that more than one packet can bereceived at once.

IMU Driver

This is another simple driver used to interface with the bno055 IMU. All API documentation can be found in‘bno055.h’. This header also includes all initialization for the I2C peripheral which it uses inside of the source file,therefore no other initialization should be done for this I2C peripheral outside the library.

templates Folder

This folder holds templates for all C and C++ header and source files that should be used when developing for thisproject. These templates contain commenting styles as well as example comments.

4.3. Car Software 31

Page 36: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

32 Chapter 4. Telemetry

Page 37: Solar Gators Docs Documentation

CHAPTER

FIVE

AUXILIARY

During the competition, it is important to be able to communicate what you’re doing to other drivers, just like youwould when driving any other car. This communication happens mainly through the use of lights and the horn. Theauxiliary team’s role is to ensure that the car has this functionality and that the driver has easy access to it.

Auxiliary is responsible for two main systems:

5.1 Steering Wheel

The purpose of this system is essentially to allow for communication between the driver and the car.

5.1.1 PCB

As the name would suggest, this board is mounted on the steering wheel, and it has all the buttons and switches that thedriver will access. When the driver presses a button or flips a switch, it takes that input to the board’s microcontroller,which takes action based on the signal. If the driver presses the Hazards button, for instance, the microcontroller sendsout a signal to turn on an indicator LED near the button, so the driver knows that they’re on, and also sends a signal tothe lights board, so the hazards actually turn on.

Steering Wheel PCB Layout

In the center of the board, there’s an LCD screen that will display relevant information like speed and battery chargeto the driver. SPI, a communication protocol, is used to relay information to and from the screen. As explained in thecommunication section, most of the signals on this board are sent to and received from other boards through the CANBus communication protocol, meaning they must be encoded or decoded by the CAN transceiver after they come outof or before they go into the microcontroller. Notable exceptions include the startup sequence signals, reverse, andcruise control.

5.1.2 Code

Steering Wheel Code repo available here.

33

Page 38: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

5.2 Lights

The purpose of the lights system is to take in input signals and use them to control the car’s lighting (brake lights,headlights, left and right blinker, hazards).

5.2.1 PCB

The lights are wired so that their positive terminal is always connected to power, and their negative terminal is con-nected to the lights board. Depending on the input, the board can manipulate the voltage at the negative terminal toturn the lights on or off. The inputs for the blinkers, headlights, and hazards come from the steering wheel as a CANencoded signals and, after the CAN transceiver decodes them, go to the lights board microcontroller. From there, themicrocontroller sends an output to the gates of MOSFETs, which serve as switches to connect the negative terminalsof the lights to ground if the output from the microcontroller is high enough.

Lights PCB Layout

The brake input is a little more complicated, as it takes an analog value related to how much the brake pedal iscompressed to determine if the brake light should be on. A comparator is used to determine if the analog valueexceeds a set threshold and the appropriate signal is then fed to the microcontroller. From that point on, the process isthe same as it is to turn on the other lights.

5.2.2 Code

Lights Board Code repo available here.

34 Chapter 5. Auxiliary

Page 39: Solar Gators Docs Documentation

CHAPTER

SIX

POWER BOARD

The powerboard serves to step down the 100V supplied from the car’s battery to lower voltages, allowing otherelectrical subsystems to utilize the voltages that they need as an input. The board takes in voltage inputs from thebattery pack, the solar array, and the supplementary batteries at 100V and 12V. These voltages are then filtered outthrough the board and stepped down to 12V, 5V and 3.3V. The board also establishes the multiple power states of thecar in terms of the trip state and the main state.

From actpower.com, “The power supply works to convert the power from the source into the correct format andvoltage.” The car has two power sources: the solar cells charging a 100V battery and a 12V supplemental battery.Thus the power board has to manage those two sources while supplying power to other systems whose componentsonly need maybe 5V. Most of the other systems have to be powered through the power board PCB which is why it isso important.

Currently we only have the summary from last year but soon more resources detailing the power board system will beput out.

6.1 Power Board PCB

The Power Board PCB was developed to step down voltages for other electrical systems. The PCB is intended to havevery little latent power draw and to reduce noise from the input voltage sources.

6.1.1 DC/DC Converters

Our board uses 4 integrated DC/DC converters provided by TDK Lambda. These converters are used to safely stepdown the input voltages from 100V and 12V, to 5V and 3V3. The board includes a 100-12V converter, a 12-5Vconverter, and two 12-3.3V converters (One for the main state and one for the trip state).

6.1.2 Filters

We use filters in our board for many reasons. For one, these filters help to reduce noise coming from the DC voltagesources (Main battery pack and 12V lead acid battery). This means that the filters help to prevent spikes in voltageand current within the circuit. Large spikes in voltage and current can damage expensive components in our board, soit is very important to have these filters in place. The filters are placed as either inputs or outputs for each converterin order to protect the converters from being protected. Components used in these filters include capacitors, inductors,and diodes, which are much cheaper than the DC/DC Converters that we have in our board, protecting our boardelectrically and even economically.

35

Page 40: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

6.1.3 Fuses

Fuses are placed around our board to prevent the entire board from being damaged. The fuses are put in place as a fail-safe to human and calculation errors when soldering and testing the board. Obviously, it is a lot better economicallyto blow a fuse than to destroy the whole board and all of its components connected.

6.1.4 Diode Oring

The use of diode oring in the board allows the 100V and 12V sources to work together seamlessly. Two diodes havebeen placed in front of the 100V and 12V Supplementary lines to prevent voltage source backflow. When the 100Vsource is turned off, as the car enters its trip state, the diode on the 12V source is in forward bias, allowing currentto flow through it, while the diode on the 100V supply line is in reverse bias, protecting the battery from backflow.When the car enters its main state, and the 100V battery pack is turned on, the diode in front of the 100V suuply linegoes into forward bias and the 12V supply line diode enters reverse bias, preventing backflow from the higher voltagesource.

6.2 Trip State

The trip state of the car is a state in which things are powered during car start-up. Trip is reserved for things that ed tostay on even when the main battery is off. The trip power supply stems from a 12V supplementary battery in the car.Boards such as Telemetry, BMS, and the Driver Display.

6.3 Main State

The main state of the car happens after the main battery array is turned on. It’s important to note that this state includeseverything that was powered in the trip state. This state supplies 100V to the powerboard and in hand,powers the tripstate boards, Aux, MPPT and the Motors. This is also the state where the solar arrays are being utilized.

Diagram of how Powerboard connects with other components below.

Can be editted on: Google Drawing

36 Chapter 6. Power Board

Page 41: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

6.3. Main State 37

Page 42: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

38 Chapter 6. Power Board

Page 43: Solar Gators Docs Documentation

CHAPTER

SEVEN

MOTOR CONTROLLER

The Motor Controller Subsystem is responsible for understanding how to wire the controller to the motor as well asinterface with the controller through the configuration tool. In addition, this system develops a PCB that supplementsthe controller by adding features not supported by the controller.

7.1 Setting a Profile

7.1.1 Before Programming:

1. Make sure you have Mitsuba Configuration Tool

2. Get a USB Type B Mini

3. Identify the correct COM port before attempting to program

1. Plug into the controller

2. Go to device manager and check which COM port is being used

3. Set the COM port in the Mitsuba Configuration Tool

7.1.2 Programming:

1. Use file access options to either save a controller configuration or to load a previously saved controller configu-ration

2. Use controller access to set the COM port you previously identified. This section also contains the write andread options.

1. To load the settings that are currently on the controller use the read option.

2. To upload a new controller congifuration use the write option. Be warned, writing to the Mitsuba doestake a while (sometime a couple minutes)

3. Since writing takes a long time, make sure no one turns off the car so you dont have to redo the writingprocess from the start

3. Click End and close the tool when writing is completed

39

Page 44: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

7.1.3 Options:

1. Classified

2. Classified

3. Classified

4. Classified

5. Classified

7.2 Motor Controls PCB

The motor controls PCB was created to supplement other functions that already exist on the car, mainly pertaining tothe motor controller. This PCB has the following functions:

1. Precharge motor controller and mppts

2. Latch and maintain power to the motor controller and mppt contactors

3. Throttle input

4. Cruise Control

5. Regenerative braking input

7.2.1 Precharge

Precharge is necessary to prevent instantaneous short circuit current due to the massive capacitance of the motorcontroller and mppts. Without precharging these device may fail overtime.

Precharge is done by slowly charging the capacitors of these devices toward their nominal operating voltage. This isaccomplished by first connecting main power to the devices through a series resistor. After the precharge is completemain power is then directly connected to the devices and the series resisotr circuit is opened. The resistance value ofthe series resistor determines the precharge time. Lower resistance leads to faster precharge, but greater instaneouspower, so calculations should be done to ensure the resistor can handle the expected power.

We use mosfets driven by a uP to connect GND through a series resistor to the devics. This mosfet remains on for thecalculated precharge duration then turns off, thus disconnecting the path to ground through the series resistor.

7.2.2 Contactors

Our car has two contactors that control main power going to the motor controller and the MPPT. The 12v coils of thesecontactors are controlled by mosfets whose gates are driven by a uP. The mosfets connect the GND of the coils whenturned on. Since the coils of the contactors are an inductive load, a fly back diode must be used in reverse bias withthe mosfet to prevent the mosfets from being damaged by voltage spikes caused from the inductive load.

40 Chapter 7. Motor Controller

Page 45: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

7.2.3 Throttle Input

The Motor Controls board has a direct connection to the throttle that takes in driver input to control the car’s speed.The board then connect this throttle signal to the motor controller throttle input. This middle man connection is donedue to the addition of cruise control, which will be discussed in a later section.

The throttle operates on 0-5V. 5V being the maxium input that translates to the maximum programmed speed of themotor.

7.2.4 Cruise Control

The Motor Controls board will also allow the car to utilize cruise control, which is not a build in function of the MotorController. The basics of the cruise control is discrete logic that takes in input from the cruise and regen buttons, aswell as the brakes. These signals control a latch that determines whether the car is in cruise mode or not. If the car isnot in cruise control a mux is connecting the driver throttle directly to the motor controller. If the car is in cruise modethen the mux connects a signal from a DAC that will provide a continuous throttle signal. This signal is controlled bythe uP which will have PID control to regulate the car’s speed based on a reference set by the driver.

7.2.5 Regenerative Braking

The Motor Controller by default has regenerative breaking functionality. This allows the motor to act as an electronicbrake to slow the car down and also charge the batteries at the same time. An issue with the implementation of theregen braking was that a manual dial had to be turned to control the level of intensity and charge you wanted to regenbrake. To avoid distracting the driver we had set this to the maximum level at all times, however this lead to usovercharging and causing the car to trip. To avoid this issues, but still charge at the maximum rate allowed at anytime,the Motor Controls board will use CAN communication between the auxillary, BMS, and MPPT system to calculatethe optimal charge rate that the BMS will allow. By using CAN the car will know when the driver is activating theregen button, at this time message will send to the BMS and MPPT systems to get the maximum charge rate at thecurrent time, as well as the current charge rate from the MPPTS. Using this data the controls board uP will calculatethe highest allowable regen charge rate and output a control signal to the motor controller that corresponds to thatcharge rate.

7.2. Motor Controls PCB 41

Page 46: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

42 Chapter 7. Motor Controller

Page 47: Solar Gators Docs Documentation

CHAPTER

EIGHT

MPPT

Curent MPPT

Custom MPPT?

43

Page 48: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

44 Chapter 8. MPPT

Page 49: Solar Gators Docs Documentation

CHAPTER

NINE

KNOWLEDGE RETENTION

The following pages host general information about components used in Solar Gators Electrical.

9.1 Protocols

9.1.1 CAN

The CAN Bus protocol is used for most communication between boards. Essentially, it’s a system of encoding infor-mation that allows all the components on the car to speak onto one line, letting the highest priority messages throughfirst. The microprocessors on our boards can’t encode or decode CAN messages, so each board is also equipped with aCAN transceiver to serve this purpose. All outgoing messages are sent from the Rx and Tx pins on the microcontrollerto the transceiver, where they’re encoded before being sent to other boards. For incoming messages, the same thinghappens in reverse. The incoming CAN encoded messages are decoded by the transceiver before being fed into theRx and Tx pins, from which point they may be sent anywhere else on the board.

The CAN bus communication protocol is used in automobiles because it’s good for maintaining signal integrity overlong distances, even in high noise environments. This being said, we don’t use it for all signals on our car. The startupsequence signals, for instance, have to be taken care of with hardware alone because the CAN transceivers need powerto encode messages, and don’t have it until after the car has been turned on. Some other signals, like cruise controland reverse, aren’t sent with CAN for safety reasons. It’s essential that these functions work as they’re expected to,and there’s a smaller chance of error if the signal doesn’t need to be encoded, compete with all the other signals beingsent over CAN, and decoded again.

45

Page 50: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

46 Chapter 9. Knowledge Retention

Page 51: Solar Gators Docs Documentation

CHAPTER

TEN

MAINTAINING WEBSITE

We have a website located at ufsolargators.org which contains information about our organization for sponsors andother interested parties to see. It is hosted for free using GitHub Pages and has an API hosted on AWS.

The website was built using React and the repository can be found on our GitHub organization called Advertisement-Website. The code for the API is also under the GitHub org, however it is private due to security concerns. Pleaserequest access from a senior member and they can get you that.

10.1 Getting Set Up Locally

There are many guides on how to get setup with a react. Here are a few: Official React Guide, W3 Schools Guide.

To get started with making changes to the website nodeJS must be installed first, as it is a prerequisite to react.

Linux

Mac OSX

Windows 10

#Get Node sources$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -#Now install node$ sudo apt-get install nodejs

note: You may need to install curl if it’s not already

$ brew install node

note: You will need to install brew for this to work, refer to this article on how to do that.

Alternatively you can download node’s installer from their website, link is here.

The easiest way to install node on windows is to download the installer from their website. The link to their downloadpage is here.

Next clone the Advertisement-Website locally. Then cd into the directory of the project using your favorite terminal.

Now install the necessary packages using the following npm command.

$ npm install

After installing there should be no errors. If there was you might see some red text in your terminal. At this pointyou will likely need to google the specific error you got to figure out how to move forward.

Now run start to see the website!

47

Page 52: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

$ npm start

After doing so a new window in your favorite browser should open at http://localhost:3000. If it doesn’tyou may need to navigate directly there.

10.2 API Endpoints

Our API is located at api.ufsolargators.org and has various endpoints. This section will describe their use.

POST /api/contactThis is the endpoint that our contact form uses. It’s used to send a message directly to a fixed email accountdefined in the backend.

Example request:

axios.post('https://api.ufsolargators.org/api/contact', {email: email,name: name,msg: msg,token: captcha

})

Example response:

{msg: "Sent!",success: true

}

Query Parameters

• email – email address of the person to contacting us

• name – name of person contacting us

• msg – message they are sending

• token – captcha token

Response JSON Object

• msg (string) – returns Sent! when success is true, other wise contains the error message

• success (boolean) – when false there was an error, when true there was no error

10.3 DNS Configuration

The DNS is hosted by google domains. Contact a senior member to get the credentials if it needs to be edited.

48 Chapter 10. Maintaining Website

Page 53: Solar Gators Docs Documentation

CHAPTER

ELEVEN

DEVELOPING

The electrical team is responsible for developing hardware and software for the car. Every team has their own reposi-tories and how they like to do things but here we will discuss things that are common.

11.1 Using ClickUp

As the electrical team we practice a design paradigm known as Agile. To manage our development process we useClickUp. Everything that is being worked on should be under a clickup task that way we can track progress andplan the semester around everyone’s engineering capabilities. This might seem like a lot of extra work in addition toengineering systems for the car but we have tried to make it as simple as possible.

11.1.1 Creating a Task

Most of the times tasks should have been created by the electrical PM but in the case that you come across somethingthat deserves to be its own task these are the steps for making a task.

1. Check to see if a task exists already or if the issue is closely related with a task that already exists. The way todo this is go to ClickUp, go to the relevent year, go to the relevent semester and click on the folder. Go to thetop of the page and click on List, scroll through the list look through all the tasks.

2. If you still need to create a task decide whether it is important enough to be put in the backlog or in the currentsprint.

3. Create the task in the open status or blocked status make sure to give the task a meaningful name and an elaboratedescription so that anyone can pick up the task and know what to do ask yourself these questions: 1. Where isthe work needed 2. What should count as this task being completed. and 3. Who should work on this task.

4. Make sure to assign people and tag the task accordingly.

11.1.2 GitHub Branches with clickup

When doing development always make sure you are on a branch associated with your task. This will allow ClickUp toproperly move the task from open to in progress to closed. It will also give the branch a descriptive name that matchesit to the task. To create a branch do the following:

1. Go to your clickup task and open it.

2. At the top right you will see the GitHub symbol click on it this will open up the GitHub modal.

3. In the pannel on the right look to see if there are already branches for that task.

4. If there are no branches hit the create branch button in the bottom left.

49

Page 54: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

5. Select the correct repo for the task.

6. Select the appropriate branch as your source often times this will be master.

7. Hit create new branch.Now ClickUp will automatically create the branch. I suggest copying the branchname as it is often long.To get the branch on your computer:

8. Go to where you have the repo on your computer and open git bash.

9. Type git fetch to update your local copy with one at the origin.

10. Type git checkout branchName where you replace branchName by pasting or typing the branch nameyou would like to check out.

11. Start developing! Make sure to commit often and leave meaningful commit messges.

11.1.3 Statuses

Active

• OPEN - Not being worked on

• BLOCKED - Not being worked on and is blocked by another task (other task must be completed)

• IN PROGRESS - In development, design, or coding

• REVIEW - Waiting for system and group review, make sure no issues with PCB and with other systems

Done

• READY - Done and waiting for parts to be purchase and delivered

• TESTING - Ready to be put together, soldered, built and be test

Closed

• CLOSED - Either finished or split into other tasks

11.1.4 Lists

Lists are the sprints, backlog, bugs, etc. which list the task that must be completed.

Colors:

Blue - Backlog and bugs combined.

Yellow - Previous Sprints

Green - Current Sprint

50 Chapter 11. Developing

Page 55: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

11.2 SPRINTS

11.2.1 SPRINTS WORKLOAD

Sprints will hopefully be setup to achieve all tasks.

Any tasks that aren’t completed within a task can be carried over or split into smaller

tasks.

11.2.2 SPRINTS DURATION

Sprints will last for 2 weeks.

11.2.3 SUMMER PLANS

Summer is a rough test drive of click up.

Duration will be longer and prone to change.

11.3 Software Development Guide

Please Read the ClickUp guide first as this document will heavily rely on knowledge shared there.

11.3.1 Repositories

Organization is key to any team’s success and throughout this documentation we try to make that clear. Towards thatpoint repositories often do not have to be created but when they do here is how to do it:

Naming:

For car firmware the naming convention is carName-PLATFORM-systemName (ex. cielo-STM32F0-telemetry). Carswill often reuse improved versions of previous firmware; however, please make a new repository when working for anew car that way we can easily distigush what is used where.To add a new sfotware project to git

1. Make sure you are a member of the Solar-Gators GitHub organization.

2. Create navigate to your existing project. Note: How to make an STMCUBE IDE project can be found hereTODO.

3. Open git bash, command prompt (Windows) or terminal (OSX) and run git init

11.2. SPRINTS 51

Page 56: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4. Create a new repository by clicking on the new repository button.

5. Following the naming convention give the repository a name and a breif description do not add a git ignore orreadme.

6. Create the repository.

7. On the page following the “. . . or push an existing repository fromthe command line” instructions go to git bash and type those lines.

8. Now that you have set the remote repository for your project it is time to add a .gitignore. The easiest way to dothis is make a text file and rename it (including the .txt extension) to .gitignore

9. A great tool for making .gitingore is here type your enviornment and hit create and copy the output. Note: Ifthere is no ignore file for your envionrment don’t worry follow the steps and let someone else know so they canhelp you or if you know how to create an ignore file feel free to create one just make sure to comment why youexclude things.

10. Open up your .gitignore file and paste the output.

52 Chapter 11. Developing

Page 57: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

11. In git bash type git add .gitignore this will stage the git ignore file for commit.

12. In git bash type git commit -a -m "Added git ignore" this will commit the git ignore file.

13. In git bash type git add . this will add all files and stage them to be commited (Except those in the gitignore).

14. In git bash type git commit -a -m "First commit" this will add all your files to the repository.

15. In git bash type git push this will update the remote repository with all your changes. Other Notes Makesure that a proper .gitignore file is made for any new repository.

11.3.2 Branching

See the how to branch with ClickUp in the ClickUp documentation.

11.3.3 Peer Reviews

Before anything is merged onto the main branch we need to make sure that it is throroghly tested testing should bedone on your branch and when the code is ready it should be moved onto the main branch. Still we need to peer revieweachothers code to make sure the the style is up to standard and to make sure that we dont have any unneccessary code.So create a pull request either through CllickUp or on GitHub and make sure your task is updated accordingly.

11.3.4 Continuous integration

TODO

11.4 Hardware Development Guide

Please Read the ClickUp guide first as this document will heavily rely on knowledge shared there.

11.4.1 Repositories

Altium schematics, like software, are stored in the organization’s GitHub heres how to do that.

Naming:

For PCBs the naming convention is carName-subname-PCB (ex. cielo-telemetry-PCB, cielo-lights-PCB). Cars willoften reuse improved versions of previous PCBs; however, please make a new repository when working for a new carthat way we can easily distigush what is used where.To add a new altium project to git

1. Make sure you are a member of the Solar-Gators GitHub organization.

2. Create navigate to your existing project. Note: How to make an altium project can be found here TODO.

3. Open git bash, command prompt (Windows) or terminal (OSX) and run git init

11.4. Hardware Development Guide 53

Page 58: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

4. Create a new repository by clicking on the new repository button.

5. Following the naming convention give the repository a name and a breif description do not add a git ignore orreadme.

6. Create the repository.

7. On the page following the “. . . or push an existing repository fromthe command line” instructions go to git bash and type those lines.

8. Now that you have set the remote repository for your project it is time to add a .gitignore. The easiest way to dothis is make a text file and rename it (including the .txt extension) to .gitignore

9. A great tool for making .gitingore is here type altium hit create and copy the output.

10. Open up your .gitignore file and paste the output.

11. In git bash type git add .gitignore this will stage the git ignore file for commit.

12. In git bash type git commit -a -m "Added git ignore" this will commit the git ignore file.

54 Chapter 11. Developing

Page 59: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

13. In git bash type git add . this will add all files and stage them to be commited (Except those in the gitignore).

14. In git bash type git commit -a -m "First commit" this will add all your files to the repository.

15. In git bash type git push this will update the remote repository with all your changes.

Other Notes Make sure that a proper .gitignore file is made for any new repository. When PCBs are manufacturedmake sure to tag the commit that was used! How to tag: TODO

Additional Resources TODO

11.4.2 Branching

See the how to branch with ClickUp in the ClickUp documentation.

11.4.3 Continuous integration

TODO

11.5 Emulators

11.5.1 About

Often times it is inconvienent, difficult or impossible to access equipment needed to test our drivers to aid this issuewe have created a set of emmulators utilizing the Digital Analog Discovery board (DAD). This allows you to createa class in python that acts like the hardware you want to interface with. Currently the emulators support UART andCAN communications but it is not very difficult to add more or even custom protocols.

11.5.2 How to install

If you plan on using the DAD hardware make sure you have the SDK downloaded (Waveforms). If you plan on usingthe CANAdapter make sure you know what serial port it is connected to (no need to download anything). Dependecies:Python 3.x

11.5.3 Notes

These emulators take data from the mocks and implement the DAD board to simulate CAN or UART data. If you needa good file just to mess around in git will ignore a file named sandbox.py

11.5.4 Usage

To create a new emulator first decided on the hardware that you will use to emulate the protocol. Most of the filesincluded use the Digital Analog Discovery board from Diligent. Emulators could emulate a single peice of hardwareor they could emulate a whole system (see drivers details).

11.5. Emulators 55

Page 60: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

11.5.5 Examples

CAN

This example uses the DAD board as the hardware bridge for the CAN bus

# Initialize DAD boardemmulator = DAD()# Initialize CAN peripheral with default RX and TX pins, polarity and a baudrate of→˓500kbsemmulator.CAN_init(baudRate=500e3)# Turn on 5v to power the CAN tranciveremmulator.posSupply_init()# Create a mitsuba motor controller mockmc = Mitsuba(0x08F89540, 0x01, emmulator)# Create a Dilithium Proton 1 Mockmppt = Proton1(1024, 0x2, emmulator)# Create an Orion2 mockbms = Orion(0x6B0, 0x1)# Because the other mocks receive a RTR we don't need to actively send their data# This sets up the BMS mock to send its data every 0.1 seconds independently from the→˓main programbmsThread = threading.Timer(0.1, bms.sendCAN)# When the main program quits this thread does alsobmsThread.daemon = True# Start sending BMS databmsThread.start()# Create a dictionary of callbacks for receiving CAN messagescb = {mc.addr_CAN: mc.receiveCAN, mppt.addr_CAN: mppt.receiveCAN, bms.addr_CAN: bms.→˓receiveCAN}# Until we see ctrl+c receive messages and handle them with the cb# If a message is not in the cb it will be printed this is useful for spying on the→˓CAN bustry:

while True:emmulator.receiveCAN(cb)

except KeyboardInterrupt:print("Quitting...")

56 Chapter 11. Developing

Page 61: Solar Gators Docs Documentation

CHAPTER

TWELVE

CODE TEMPLATES

The Code Templates are templates for C and C++ header and source files. These templates should be used wheneveryou wish to create a new C/C++ file to standardize the file format. In order to standardize comment format allcomments should follow doxygen style.

12.1 C Header Template

/*** File Name:

* Description:

*/

// Header Guard#ifndef MY_HEADER_GUARD_H_#define MY_HEADER_GUARD_H_

/→˓***************************************************************************************************/→˓

/* Include Files *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Datatypes *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Constants *//→˓***************************************************************************************************/→˓

/* This is an example description for constants and variables. Delete this if it is→˓unused here and copy and paste it to where it is needed. *//**

(continues on next page)

57

Page 62: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

* @brief This is a brief description

*/

/→˓***************************************************************************************************/→˓

/* Public Variables(extern) *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Function Prototypes *//→˓***************************************************************************************************/→˓

/* This is an example description for function prototypes. Delete this if it is→˓unused here and copy and paste it to where it is needed. *//*** @brief This is a brief description

* @param Input_Param_Name Description of input parameter

* @return Description of return value

*/

#endif //End Header Guard

12.2 C Source Template

/*** File Name:

* Description:

*/

/→˓***************************************************************************************************/→˓

/* Include Files *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Data Types *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

(continues on next page)

58 Chapter 12. Code Templates

Page 63: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

/* Private Variables(static) *//→˓***************************************************************************************************/→˓

/*This is an example description for constants and variables. Delete this if it is→˓unused here and copy and paste it to where it is needed. *//*** @brief This is a brief description

*/

/→˓***************************************************************************************************/→˓

/* Public Variable Definitions *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Function Prototypes(static) *//→˓***************************************************************************************************/→˓

/*This is an example description for function prototypes. Delete this if it is unused→˓here and copy and paste it to where it is needed. *//*** @brief This is a brief description

* @param Input_Param_Name Description of input parameter

* @return Description of return value

*/

/→˓***************************************************************************************************/→˓

/* Public Function Definitions *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Function Definitions *//→˓***************************************************************************************************/→˓

12.2. C Source Template 59

Page 64: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

12.3 C Header Template

/*** File Name:

* Description:

*/

// Header Guard#ifndef MY_HEADER_GUARD_H_#define MY_HEADER_GUARD_H_

/→˓***************************************************************************************************/→˓

/* Include Files *//→˓***************************************************************************************************/→˓

// C Interface#ifdef __cplusplusextern "C" {#endif/→˓***************************************************************************************************/→˓

/* C Public Data Types *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* C Public Constants *//→˓***************************************************************************************************/→˓

/*This is an example description for constants and variables. Delete this if it is→˓unused here and copy and paste it to where it is needed. *//*** @brief This is a brief description

*/

/→˓***************************************************************************************************/→˓

/* C Public Variables(extern) *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* C Public Function Prototypes *//→˓***************************************************************************************************/→˓

(continues on next page)

60 Chapter 12. Code Templates

Page 65: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

/*This is an example description for function prototypes. Delete this if it is unused→˓here and copy and paste it to where it is needed. *//*** @brief This is a brief description

* @param Input_Param_Name - Description of input parameter

* @ret Description of return value

*/

#ifdef __cplusplus}#endif //End C Interface

// C++ Interface#ifdef __cplusplus

/→˓***************************************************************************************************/→˓

/* Public Function Prototypes *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Class Definitions *//→˓***************************************************************************************************/→˓

class MY_CLASS{public:/→˓***************************************************************************************************/→˓

/* Constructors *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Data Types *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Constants(static constexpr) *//→˓***************************************************************************************************/→˓ (continues on next page)

12.3. C Header Template 61

Page 66: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

/→˓***************************************************************************************************/→˓

/* Public Variables *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Public Function Prototypes *//→˓***************************************************************************************************/→˓

private:/→˓***************************************************************************************************/→˓

/* Private Data Types *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Constants(static constexpr) *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Variables *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Function Prototypes *//→˓***************************************************************************************************/→˓

};

#endif //End C++ Interface

#endif //End Header Guard

62 Chapter 12. Code Templates

Page 67: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

12.4 C++ Source Template

/*** File Name:

* Description:

*/

/→˓***************************************************************************************************/→˓

/* Include Files *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Data Types *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Variables(anonymous namespace) *//→˓***************************************************************************************************/→˓

/*This is an example description for constants and variables. Delete this if it is→˓unused here and copy and paste it to where it is needed. *//*** @brief This is a brief description

*/

/→˓***************************************************************************************************/→˓

/* Public Variable Definitions *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Function Prototypes(anonymous namespace) *//→˓***************************************************************************************************/→˓

/*This is an example description for function prototypes. Delete this if it is unused→˓here and copy and paste it to where it is needed. *//*** @brief This is a brief description

* @param Input_Param_Name Description of input parameter

* @return Description of return value

(continues on next page)

12.4. C++ Source Template 63

Page 68: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

(continued from previous page)

*/

/→˓***************************************************************************************************/→˓

/* Public Function Definitions *//→˓***************************************************************************************************/→˓

/→˓***************************************************************************************************/→˓

/* Private Function Definitions *//→˓***************************************************************************************************/→˓

Below is a list of docs for our Mechanical subteams.

64 Chapter 12. Code Templates

Page 69: Solar Gators Docs Documentation

CHAPTER

THIRTEEN

BATTERY BOX

13.1 What is it?

The battery pack includes 400+ batteries arranged together to act as a single battery as well as the housing andmounting of these batteries. When the sun is not providing enough energy, it provides power to the car, and when thecar is not using all the energy it is receiving from the sun, it stores the energy.

13.2 What are the goals?

Safety, reduce internal resistance in the pack, modularity, reduce weight, reduce cost, meet the time constraints,maintain a low center of gravity, and keep a layout that favors clean easy harnessing. Safety of the pack primarilyfocuses on reducing the chances of an accidental short happening or any electrical connections becoming undone.These problems could cause arcing within the pack leading to the batteries entering thermal runaway. Allowing forproper airflow through the battery pack is also important to prevent the batteries from overheating while running.Reducing internal resistance is necessary to waste as little energy as possible. Any form of resistance from wires oreven the internal resistance of the batteries will cause heat losses. The goal is to efficiently use the minimal energygathered from the sun to power the car and reducing resistance will increase efficiency. Modularity is about the easeof switching in and out of battery modules allowing for easier maintenance, repair, and interchangeability. This willhave to happen a few times over the lifetime of the pack and the battery pack will likely be fully disassembled at somepoint. This also includes a safety component. It is important to be aware of where tools will have to go to service thepack or bring modules in or out. These tools will likely be metal, so the removal should be designed in a way thatmakes it difficult to damage batteries or cause a short while working with the tools needed. Reduce weight pertainsto keeping the weight of the entire pack as low as possible in order to increase the efficiency of the car. With a lowerweight, the car requires less energy to drive which is comparable to a real car having better miles per gallon whenweight is reduced. Reduce cost in order to preserve the team’s finite budget allowing for more money to be spent onother systems or any unforeseen circumstances that may arise. Meeting the time constraints means having the packmanufactured in time for competition and ideally a couple of months in advance to allow for testing and coordinationwith other systems. Maintaining a low center of gravity is crucial to reduce the chance that the car will rollover. Thebattery pack is one of the largest point masses on the entire car so it is important to keep its weight as low in the caras possible. Design for easy, clean harnessing means that wires should not be haphazardly running all over the top ofthe pack making it difficult to work with and tell where each wire leads to. Although there will be a large number ofwires running over the pack between the voltage taps and thermistors, it should be designed in a way where wires areorganized and the pack is easy to work with.

65

Page 70: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

13.3 What are the priorities?

The first priority will always be safety, the battery pack can be very dangerous if done incorrectly (see Oregon State2011, Stanford and Vattenfall 2019). The next priority is time; the car will not be able to run without the battery packso keeping a tight schedule is important to ensure it is ready by competition. After that, all of the goals that increase carperformance, weight, resistance, and cost, must be considered to find what has the biggest impact Next is modularityand clean harnessing because this has a role in safety as well as ease of maintenance and repair of the pack. Finally, thelower the center of mass is mainly determined by the location of the pack in the chassis. The arrangement of batterieswithin will only affect its center of mass by a few inches.

13.4 How does the system interact with other systems?

Mostly affects electrical systems with our choice of pack voltage.

The battery pack voltage affects the following systems:

• Battery Management system: The pack voltage dictates how the electrical team configures the batterymanagement software to protect the car from unsafe battery conditions. (the configuration of itself, likemodule size, affects BMS taps and configuration).

• Power Board: Depending on the pack voltage the system’s power board needs to spec different parts to beable to convert the pack voltage into lower voltages that the auxiliary systems can utilize.

• Motor Controller: Depending on the module configuration there will be a system voltage and maximumcurrent draw. These values affect what the motor controller can be programmed for.

• Wire Harness: The values of the pack will affect what certain hardware components we need to get. Thisincludes: Wires, Fuses, Switches, and Connectors

We are a low priority mechanical system, others decisions mostly affect us, chassis defines how much space we have.But we also affect chassis with any welding that may be used for mounting Reducing the cost of the battery packsystem is important as it preserves the finite budget of the team so that more money can be allocated to other systems.

How the chassis affects the battery box:

• The box needs to be mounted in the chassis and able to withstand 2.5 g rollover front and side impacts. Themounting must be designed to reduce weight while also being able to withstand all the loading scenarios.The side impact is addressed by manufacturing the box to the exact width of the chassis. This means thechassis width is the side size constraint.

How the battery box affects the chassis system:

• To prevent the box from sliding forward or the front of the box from rising, T brackets are welded to thechassis in front of the box. L brackets extend over the box and there is a removable beam tube along therear. This affects the chassis system as the box specifications determine where the weld brackets will beplaced for mounting.

More Details

66 Chapter 13. Battery Box

Page 71: Solar Gators Docs Documentation

CHAPTER

FOURTEEN

BRAKES

14.1 Overview

The Brakes subsystem is one of the most critical when it comes to the safety of the driver and the solar car. It’s primary objectives are:

• Perform calculations to ensure the solar car will have the required retarding force to stop at half a “g” (9.8) of deceleration.

• Develop a lightweight, reliable, stopping mechanism (typically hydraulic brakes) for the solar car. Thisincludes the pedal assembly/caliper mounts/master cylinder mounts/etc.

• Develop a parking brake for solar car

• If deemed necessary, integrate the activation of the motor regen brakes into the overall brakes system

The brakes subsystems can be broken down into the following components/concepts:

67

Page 72: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

68 Chapter 14. Brakes

Page 73: Solar Gators Docs Documentation

CHAPTER

FIFTEEN

CHASSIS

The Chassis is the structural suport of the car. It is the frame which everything on the car holds on to.

More Details of the Chassis

69

Page 74: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

70 Chapter 15. Chassis

Page 75: Solar Gators Docs Documentation

CHAPTER

SIXTEEN

SUSPENSION

Bouncy

More Details of the Suspension

Below is a list of docs for our Aero-Body subteams.

71

Page 76: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

72 Chapter 16. Suspension

Page 77: Solar Gators Docs Documentation

CHAPTER

SEVENTEEN

BODY

17.1 Knowledge Retention

17.1.1 Fluid Dynamics

Fluid Dynamics

The study of how fluid moves. We use fluid dynamics to create objects which interact with their environment in anoptimal manor. Our car designs are no different. Reducing drag is a surefire way to better the performance of the car.

17.1.2 Solidworks Surfacing Course

Surfacing Course

Solidworks surfaces has been used throughout the creation of Car 3’s shell. Compared to solidworks features, surfacesgives us greater flexibility to create a smooth, uniform, and unique shell. Go through the surfaces course to learn theelements needed to design your own concept.

17.2 Software

17.2.1 Solidworks

• [Solidworks Installation](coming soon!)

17.2.2 Star CCM+

• [Star CCM+ Installation](coming soon!)

• StarCCM Instructions

73

Page 78: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

17.2.3 NX

coming soon!

17.2.4 Fibersim

coming soon!

17.3 Manufacturing

• Canopy Hinge

• Canopy Latch

• Body Hinge

74 Chapter 17. Body

Page 79: Solar Gators Docs Documentation

CHAPTER

EIGHTEEN

SOLAR ARRAY

More Power!

18.1 Documentation

SOPs

Cielo

Car 3

75

Page 80: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

76 Chapter 18. Solar Array

Page 81: Solar Gators Docs Documentation

CHAPTER

NINETEEN

COMPOSITES

Our body shell and ribbing (along with a myriad of components outside of Aerobody) are made with composites. Twomaterials, a matrix and its reinforcement, are combined to produce a composite material with unique and desirableproperties.

We use epoxy resin as a matrix and carbon fiber as the reinforcement to manufacture carbon fiber reinforced polymers(CFRP). We use CFRPs because of their high strength to weight ratio. This is a crucial property for the body shell,which should be strong enough to withstand any impact to the car and support the load of the chassis while adding aslittle weight to the car as a whole.

Manufacturing a CFRP involves saturating the carbon fiber with a thermosetting epoxy resin that will harden and bindthe reinforcement fibers together. There are multiple techniques that can be used.

Using a wet layup involves using alternating layers of resin and composite fibers.

Vacuum bagging uses a wet layup placed under a vacuum. The vacuum ensures that the resin is spread out and willremove resin if there is a heavy excess.

Vacuum infusion uses a vacuum to draw resin from a container and pulls it through the part, with the excess beingdrawn out. Vacuum infusion requires the most amount of setup, but the least amount of work during the process.Generally, a vacuum infused part will be the lightest, but careful work and time can make a wet layup just as light.

77

Page 82: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

78 Chapter 19. Composites

Page 83: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

To make a CFRP in the complex shape of a body shell, there are also several methods that can be used. The mosttraditional way is to first make a positive plug, then create a negative mold around the plug. Composite material isthen laid up inside the mold to make the final shell.Other options are to layup around a positive mold or layup inside anegative mold, each having advantages and drawbacks.

19.1 Manufacturing

19.1.1 Cielo

The 2017-2018 design cycle was the first in which the team made a significant attempt to optimize the aerodynamicsof the exterior shell of our car. It was also the first design cycle in which we actually had 5-axis CNC’d molds ofsomething we designed in CAD. In the 2016-2017 cycle, very crude molds were made with plywood and insulationfoam.

In this design cycle we landed a mold sponsorship with Marine Concepts in Sarasota, Florida. Unfortunately, MarineConcepts ran on a tight schedule and required final CAD earlier than expected. The body team had gone throughseveral different iterations of body designs and had found one which was relatively aerodynamic. When trying tosurface this design in conjunction with the final mechanical chassis/suspension CAD, Solidworks constantly failedto build the proper surfaces. With the Marine Concepts deadline fast approaching, a much worse design had to besubmitted as it was the only one Solidworks didn’t crash in trying to surface.

Our mold was a negative mold milled out of EPS foam and done by our sponsor with their 5-axis CNC machine. Oncethe mold was constructed, our team made regular trips to Tavares to complete the rest of the manufacturing process,albeit with the aid of our sponsor since we were unfamiliar with many of these processes. After mold construction,we performed a wet layup of fiberglass over the EPS foam to have a non-porous surface to be able to vacuum-bag offof. We then sprayed ITW spray-core, a type of tooling resin, over our mold to give it rigidity and a smoother surfacefinish.

We then sanded down the mold surface, starting with 60 grit and using successively finer sandpaper up to 400 grit.We then sprayed a final layer of Duratec Primer over our mold and followed the same process for sanding down thesurface.

19.1. Manufacturing 79

Page 84: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

To make our body shell, we used a resin infusion process with the help of our sponsor. This is a type of compositemanufacturing process that takes plenty of prior experience and additional expenses to perform; it is not recommendedfor future in-house manufactured body shells until we have enough collective experience as a team. An outline of theresin infusion process can be found here.

Our laminate sequence was a sandwich core structure with one ply of carbon fiber on each side of a layer of 3mm.Lantor Coremat Xi. We used a 2x2 twill weave for the outside layer of carbon fiber for optimal surface finish and useda unidirectional weave for the interior carbon fiber layer to minimize costs. We used Inkamesh as our flowmedia andimplemented scribe lines to differentiate between our part and flange. Multiple resin ports were used to account forthe size of our layup.

Pictures

19.1.2 Car Three

The construction of Car 3’s body shell for the 2019-2020 cycle has been repeatedly delayed for multiple reasons. Ourteam has had to transition from manufacturing a body shell with a sponsor who guided us through the resin infusionprocess while sponsoring all necessary materials for mold construction and a 5-axis CNC service) to manufacturing ourbody shell entirely in-house while maintaining the quality of our previous design. This presented multiple challengesto the team: (1) planning the manufacturing and surface preparation of our mold (2) creating our own compositesmanufacturing process that would work with our resources, (3) setting up a training protocol ensured that leadershipand team members had sufficient hands-on experience with composites. Manufacturing was further complicated dueto the Covid-19 pandemic, which resulted in the team’s access to our shop being delayed until October 2020. Ourteam has met our design challenges through a combination of research and hands-on experience; we are expecting tobegin manufacturing our body shell in the Spring 2020 semester.

We are making our molds out of XPS Foamular 250, which is economical while having sufficient density yield anacceptable surface finish from CNC milling with a local sponsor. We decided to construct a straight to negative moldby milling a cavity out of stacked foam sheets to ensure an optimal surface finish while avoiding the expense andlogistics involved in the conventional process of pulling a fiberglass negative mold from a positive plug. Compositematerial is then laid up inside the mold to make the final shell. A vacuum-bagging system will be used to draw outexcess resin and improve the composite’s strength to weight ratio.

To ensure proper mold design , it was important for us to understand how our CAD design would be translated througha CNC program and how milled into the foam and how to ensure proper draft angles. A negative draft angle willmake manufacturing extremely hard, if not impossible. We are currently finalizing our mold design with our CNCsponsor and expect to have our mold done by the end of the spring 2020 semester.

We used our limited time in the shop in the Fall 2020 semester to start manufacturing our ribbing components. Weplan to waterjet our CAD-designed profiles out of vacuum-bagged sandwich core carbon fiber panels. We have beenexperimenting with the amount of resin used in our layups in order to determine the optimal carbon fiber to resin ratiofor our body shell.

Pictures

19.2 Knowledge Retention

Our team is constantly striving to improve the manufacturing process for our body shell.

80 Chapter 19. Composites

Page 85: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

19.2.1 SOPs

Our standard operation procedures for working with composite materials in our shop are listed here:

• Plug Surfacing

• Fiberglass Molding

• Epoxy Resin Preparation

• Polyester Resin Preparation

19.2.2 Research

• We have a living document listing our accumulated knowledge of CFRP design and manufaturing

• We have documentation for the Aerobody and Mechanical systems’ research on designing and manufacturing aCFRP monocoque chassis.

19.2. Knowledge Retention 81

Page 86: Solar Gators Docs Documentation

Solar Gators Docs Documentation, Release 0.1.0

82 Chapter 19. Composites

Page 87: Solar Gators Docs Documentation

HTTP ROUTING TABLE

/apiGET /api/graph/coord, 20GET /api/live/data, 19POST /api/bms, 20POST /api/contact, 48POST /api/gps, 20

83