Coder Social home page Coder Social logo

smit-happens / ycp_evos Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 1.0 6.25 MB

Development for the 2018 YCP Formula Electric Vehicle

License: MIT License

C 1.31% C++ 98.41% Python 0.27%
embedded-devices electric-vehicles c-plus-plus teensy36 platformio capstone

ycp_evos's People

Contributors

joemaier avatar mdougla5 avatar mrjones2014 avatar pathock avatar shawnpierpont avatar smit-happens avatar youngmaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

atokosch

ycp_evos's Issues

Reverse Mode

Hardware exists to make it possible to drive the car in reverse.

  • Must change registers in Unitek

This issue is low priority - Reverse is not required.

Combine Pedal Models

End goal

Combine the pedal classes into one model due to @PatHock findings in the hybrid rules manual where the gaspedal only needs one potentiometer

Relavent Info/Links

The 2018 hybrid rules manual

Your Code

PedalController.cpp/hpp
BrakePedal.cpp/hpp
GasPedal.cpp/hpp

Gas Pedal polling

Involves working on the PedalController to use the GasPedal Model to grab the analog value and store it in the model

SD Card Logging

Implement basic SD card logging for the Teensy.

SD logs must be in CSV format, and include time stamps relative to when the GLV system is powered up.
Filenames must be dynamic and include the absolute start time of the GLV system.

Shutdown transition

We need to transition from Driving to Shutdown after running the car.

This stage needs to get executed whenever really according to the flowchart, but that can be done at a later date.

Power-On Reset (POR) and Brownout Detection

The Teensy's Kinetis microprocessor has built-in hardware to reset the Teensy during undervoltage conditions. These conditions prevent the Teensy in the Main Brain circuit from powering up reliably - we know that this is an issue.

Also, the Low Voltage Detect functionality can trigger the Teensy to enter the shutdown stage in the event that the Teensy loses power. This will become more useful later when implementing SD card Logging.

Differentiate Timer Event Flags from normal EFs

The code below shows how it is currently:

//Timer event flags
const uint32_t EF_GLCD             = 0b1;  //Glcd EF mask
const uint32_t EF_PEDAL            = 0b10;  //Pedal EF mask
const uint32_t EF_SDCARD           = 0b100;  //SdCard EF mask

An example implementation of this change is shown below:

//Timer event flags
const uint32_t EF_T_GLCD             = 0b1;  //Glcd EF mask
const uint32_t EF_T_PEDAL            = 0b10;  //Pedal EF mask
const uint32_t EF_T_SDCARD           = 0b100;  //SdCard EF mask

Add code to read and store the values of battery voltages

Add code to the OrionController and the OrionModel to read store the values of the battery voltages received from the BMS into the model using the controller. CANController will most likely need to be added to for functionality for communicating with the BMS.

Motor Controller Automator

Create software to control MC logic board inputs and CAN messages to MC.
End goal: eliminate/lessen the need for laptops to be used for MC testing.

Moving hardware initialization into another file

Consider moving the hardware initialization such as the analog bit resolution into another hardware initialization file. This will only be necessary if the amount of hardware initialization grows to a point where it is clogging up main.

SD card model

use the SdioEx library, will handle all the I/O operations and none of the logging (Logging will be a controller class due to the logic needed for formatting and labelling)

Request Unitek register read

We need a method to ask the Unitek to send back register data, this is somewhat implemented in

void CanController::sendUnitekRead(uint8_t regId, uint8_t pollTime = 0) {...}

There needs to be some support for using the CAN model to send the data out on the wire

Unitek setting speed value

Involves working on the UnitekController class to grab the pedal percentage from the PedalController (using the gasPedal model) and passing that percentage to the canController (along with the register to set in Unitek Model) to be sent off the wire and store the value locally in the Unitek model.

90% Precharge setting in Unitek

Correlates to #28 where we only have to have CAN TX working for the Unitek.

It would be beneficial to get CAN RX working, and that may be a side effect of CAN RX with Orion #30, but for now Priority for CAN Unitek is TX before RX

Make issue template

With the crazy amount of issues we'll be making, a common template to reference will help us make more standardized issues for ease of reviewing.

Make it titled ISSUE_TEMPLATE.md

Example Issue templates

Iterate through the stages

In order to operate the vehicle in a basic sense, we need to go through all the stages at least once

Bootup ▶️ self_test ▶️ Subsystem_test ▶️ Standby ▶️ Precharge ▶️ Energized ▶️ Drive ▶️ Shutdown

  • Bootup done
  • Self_test done
  • Subsystem_test implemented
  • Standby implemented
  • Precharge implemented
  • Energized implemented
  • Driving implemented
  • Shutdown implemented

Implement Startup Sound

From 2018 FSAE Formula Hybrid Rules:

EV 9.2.1: The car must make a characteristic sound, for a minimum of 1 second and a maximum of 3
seconds, when it is ready to drive.

Super loop structure

This will require some sort of implementation involving either Multiple Stages in one super loop or multiple super loops with the switch statement staging currently sketched out

Ready To Drive (RTD) transition

in order to transition from Energized stage to Driving Stage we need to have confirmation that the Unitek is done precharging, and the user has pressed the precharge button on the Dash.

Wayne's World

Implement very basic traction/launch control.
A "launch" is a limit on rear wheel RPMs to minimize slipping. This could be a crude hard-limit at first, but it would be better to have sensors on the front wheels to limit the rear wheel RPMs.
This will be useful for the autonomous car project. Not required for our end-of-semester goals.

Model Class structure

Model classes need local data storage for the hardware associated with them

Some ideas to consider:

  • Common data storage field in a BaseModel class
    • Is a common data field even possible with different types of data?
  • Size (in memory) of the variable used for each model
    • bool vs uint16_t vs float
  • Appropriate get/set/update methods for the manipulation of data storage in the model

Modify Port constants file for necessary buttons during stage iterations

Due to the lack of SMD pads on the current Teensy, the port file needs to be modified for the time being when we have to get buttons working for the basic operation of the car until new SMD headers come in.

Suggestion:

  • Mark the temporary port changes with a FIXME: comment on the same line so they show up when viewing the file
  • make an issue titled fix port file

Precharge transition

In order to transition from standby to precharge stages, there has to be a press of the precharge button on the Dash.

J-Link is not working

Been getting various errors with it

  • Low Memory
  • Identifies Cortex chip correctly but is configured wrong (M0 vs M4)
  • York Wifi

Shutdown circuit integration with Main Brain

  • Not priority for MS2
  • BMS, IMD error LEDs on the dashboard should respond to appropriate error inputs from shutdown circuit (required for FSAE rule compliance)
  • Putting the car into the shutdown stage could present some problems since the LEDs need to be updated

CAN TX for Unitek

In the most basic sense, the CanController needs to have sendUnitekWrite(...) working.

CAN RX is still important but we need to have TX working in order to run the motor at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.