Giter VIP home page Giter VIP logo

gevcu6's Introduction

GEVCU

Generalized Electric Vehicle Control Unit

Our website can be found at : http://www.evtv.me

NOTE: This branch is quite old and not really supported at this point. Use the DEV branch of this project if at all possible. It is newer and better supported. Eventually the DEV branch will be merged back into this master branch.

A project to create a fairly Arduino compatible ECU firmware to interface with various electric vehicle hardware over CANbus (and possibly other comm channels)

The project now builds in the Arduino IDE. So, use it to compile, send the firmware to the GEVCU hardware, and monitor serial. It all works very nicely.

You will need the following to have any hope of compiling and running the firmware:

  • A GEVCU board. This version supports hardware 6.23c and later.
  • Arduino IDE 1.5.4 - or later
  • due_can library - There is a repo for this under github.com/Collin80
  • can_common library - Also under Collin80 repos
  • due_rtc library - Also under Collin80
  • due_wire library - once again
  • DueTimer library - and again
  • Microsmooth library (Also in repos: https://github.com/collin80/Microsmooth)
  • Adafruit_BLE_SPI library - You need the development branch from my repos: https://github.com/collin80/Adafruit_BLE_SPI/tree/development

All libraries belong in %USERPROFILE%\Documents\Arduino\libraries (Windows) or ~/Arduino/libraries (Linux/Mac). You will need to remove -master or any other postfixes. Your library folders should be named as above.

The canbus is supposed to be terminated on both ends of the bus. If you are testing with a DMOC and GEVCU then you've got two devices, each on opposing ends of the bus. GEVCU hardware is already terminated internally.

This software is MIT licensed:

Copyright (c) 2014 Collin Kidder, Michael Neuweiler, Charles Galpin, Jack Rickard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

gevcu6's People

Contributors

cadlab-io[bot] avatar cgalpin avatar collin80 avatar jrickard avatar neuweiler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gevcu6's Issues

Multiple Motor support

I am confronted with a project in which the vehicle has two separate motors, separately controlled (one per each rear wheel).

Everything is separate, drive mode, temperatures, cooling, power, CAN id's... The power mode, demands, etc. are intended to always be synchronized, but the motors have to turn in opposite directions. Before you say anything, I didn't design it, I'm only the software guy.

I started out thinking I could just use two instances of MotorController, but it became clear that there are a lot of places that assume there is only a single MotorController. I don't know if you have any interest in this problem, if not fine, I certainly can understand. But if you have ever thought about it, I would appreciate any ideas you may have come up with. I'd like to stay "in the spirit" of the architecture.

Adafruit implementation

Hi Collin,

I am trying to implement the Adafruit module on GEVCU 6.2. I have the module connected and configured in GEVCU, but I'm not able to see a Bluetooth device.

5147 - INFO: - add device: AdaFruit BLE (id: 0x1041, 0x20074EE0)

Do I need to do anything besides connecting it and enabling the device?

Thanks,
Bob

Failure to receive extended frames

Hi Collin,

I posted a parallel issue on the due_can repo. I am not able to get the GEVCU to receive extended frames. I tried the CAN_ExtendedPingPong example from the due_can library and was seeing the same result.

I have done this in GEVCO.35.ino setup:

	for (int filter = 4; filter < 7; filter++) {
		Can0.setRXFilter(filter, 0, 0, true);
	}

and this in the setup of my custom motor controller:

canHandlerEv.attach(this, 0xF9, 0x1FFFFFFF, true);

Hopefully I'm just doing something wrong, but I sure can't see it. I could use a boost here.

CAN transmission of extended messages is not working

I have gotten CAN messaging working now. I am able to communicate between GEVCU and the PowerKey Pro. I am monitoring the CAN traffic with a teensy using a SN65HVD230D tranceiver and the FlexCAN_Library. I can see the button presses from the PowerKey and the GEVCU response to set the LEDS.

What is not working is sending extended frames. Here is the routine that sends the frame:

bool FaradayMotorController::getBaseValues(int motor) {
  
  CAN_FRAME requestFrame;
  bool result;
  
  uint8_t buf[] = {0x0A, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  requestFrame.extended = 1; //J1939 frame
  requestFrame.fid = 0; //?
  requestFrame.priority = 7;
  requestFrame.rtr = 0;
  requestFrame.length = 3;
  uint32_t i = 0xEA00 + motor;
  requestFrame.id = (i << 8) + 0xF9; 
  memcpy(requestFrame.data.bytes, buf, 8);
  
  result = canHandlerEv.sendFrame(requestFrame);
  
  Logger::info("info request sent: %X result %d ", motor, result);
  return true;
}

Here is the CanHandler sendFrame routine:

bool CanHandler::sendFrame(CAN_FRAME& frame) 
{	
  logFrame(frame);   
  return bus->sendFrame(frame);
}

Here is the serial output on GEVCU:

32867 - INFO: CAN: ext=0x1 rtr=0x0 pri=0x7 fid=0x0 id=0xEA00F9 len=3 data=0xA,0xFF,0x0,0x0,0x0,0x0,0x0,0x0
32871 - INFO: info request sent: 0x0 result 1 

Everything appears to be working. No errors and a good return from bus->sendFrame, but nothing shows up on the wire.
When I change the extended setting to 0 (no other changes), then I can see the frame, although somewhat mangled. Output from the serial port on the teensy:

CAN 0: ext=0 rtr=0 pri=0 id=F9 len=3 0a ff 00
It appears that there are issues with the extended frames. What is the "family id" is this something I should be using with extended frames?

I Considered replacing the due_can library with FlexCAN, but I'm not sure how big a "can" of worms that would be.

As always, any help will be greatly appreciated.

Bob

EMAFilter does not name a type

Hello,

I am attempting to upload the DEV GEVCU6 software into GEVCU6 Hardware. However whenever I compile the GEVCU6.ino file into the hardware I receive an error in line 66 of BuiltinBMS.h 'EMAFilter' does not name a type. Any help you can provide is appreciated!

Thanks.

Further work on BLE code in DEV branch

At the moment the DEV branch has a very large rewrite of the BLE driver. It mostly works but sometimes commands to the BLE module fail and also it seems to not be reliably updating GATT characteristics quite as frequently as it should. Testing has revealed that it actually seems to get better as the update frequency is lowered. Investigate the source of the remaining issues.

Problems with 6.35

The current version of the software (downloaded from the EVTV website) is 6.35. It does not compile due to apparent naming issues with Adafruit library. (BLE.h vs. Adafruit_BLE.h).

I installed the current Adafruit library and changed the names of the .h files to include the Adafruit_ prefix, but then got some very ugly errors regarding missing methods, unknown types, etc.

There seems to be nothing here that matches version 6.35.
Can you provide any guidance on what version to use and where to get it?

Serial Port problem in 6.35

Hello,

We seem to have an issue with the serial monitor of the last release of your sw. The software gets uploaded succesfully (checked it by using the BLINK_LED also), but when i open the serial monitor nothing seems to be going on. At the same time, the PORT loses connection repeatedly, tested in more than 2 computers.

I tried unistalling everything and installing again but the problem persists (Including due libs & drivers etc.). I used the old sw (for versions until GEVCU 4) and it works fine with the serial, but in this one it does not recognize the inputs (I connected a potensiometer and checked that it works with a multimeter also-the input never showed up on the serial monitor), probably because of some changes in the pinout of the newer versions of GEVCU.

Do you have any solution in mind for that problem?

Thank you,

Charger Files?

Noticed that the Master branch includes IDs for several Chargers - Brusa, TCCH and the Lear Charger (see below), but I don’t see specific files for these chargers - e.g. LearCharge.cpp/.h

curious to know if any of these are located in another repo, buried somewhere else in the code, or something else altogether?

BRUSACHARGE = 0x1010,
TCCHCHARGE = 0x1011,
LEAR=0x1012,

BLE.h files

In file included from adafruitBLE.cpp:29:
/adafruitBLE.h:49: fatal error: BLE.h: No such file or directory
compilation terminated.

May I know which library fits for the BLE.h? Thx

CAN Bus not working

I am having problems getting the GEVCU CAN bus to work. I am using CAN0, with A2 as CANH0 and B2 as CANL0 on the 30 pin connector. I have the PowerKey keyboard and a CAN monitoring board on the CAN network (both at 500000 baud). I can see the CAN messages from the PowerKey, so I think the bus is functioning ok.

I put a log trace in at CanHandler::process, with the following results:

9246 - INFO: CAN: status=2162880 speed=500000
9247 - INFO: CAN: status=1151729664 speed=500000
9248 - INFO: CAN: status=2162880 speed=500000
9250 - INFO: CAN: status=1151729664 speed=500000

I have no way to interpret the status values.

I have tried simple hardware debugging:

Resistance (unpowered) between CANH0->GND and CANL0->GND seems to be infinite (no reading) in both cases.

The voltage (powered, obviously) between CANH0->GND and CANL0->GND is 0 in both cases. All measurements are at the wires from the 30 pin connector. I have verified that the multi-meter is working. Other devices show nominal readings.

Don't know what I'm doing wrong. Any ideas gratefully accepted.

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.