ElectricMotorcycleForum.com

  • May 08, 2024, 04:22:27 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1]

Author Topic: Diginow Supercharger Source Code is now Available  (Read 13746 times)

GoneToPlaid

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Diginow Supercharger Source Code is now Available
« on: January 24, 2022, 05:11:15 AM »

Brandon Nozaki Miller has posted the Diginow Supercharger source code on GitHub. Thanks, Brandon!

https://github.com/RIAEvangelist/SCv2-sketches
Logged

Electric Cowboy

  • Hero Member
  • *****
  • Posts: 605
    • View Profile
    • Miller's Premium Brand Electrons : YouTube
Re: Diginow Supercharger Source Code is now Available
« Reply #1 on: January 24, 2022, 12:24:28 PM »

You're welcome. There are some treats in there as well, like the code to show the battery voltage on the dash when the throttle is rolled off.

Also, there is another repo which is the MIT licensed library for connecting to the Zero CAN bus. If any companies want to use it I am open to commercial licenses as well. Just be careful what you do with it. The warnings are real. I have welded contractors and had runaway bikes while performing discovery on the messages. I had to disassemble a power tank battery once to replace a contactor I borked when I was spamming the bus to see what happened on different commands. It caused the contactor to go nuts.

https://github.com/RIAEvangelist/zero-motorcycle-canbus

Kill3rT0fu

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #2 on: January 24, 2022, 08:31:10 PM »

I have a diginow pack I need to install. But I appreciate this kind of support in the community. It's part of why I went with this bike.

Unfortunately, after seeing NewZeroland's battle with the motor and encoder chip, I'm seeing how difficult it is for people to fix and repair on their own (that's a thread on its own). But I appreciate the effort when 3rd party builders open up and support a product or service
Logged

GoneToPlaid

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #3 on: June 30, 2022, 06:02:22 AM »

Here's something to get you started with a charger controller:

BOM

Arduino MKR WiFi 1010  SKU: 7630049200258
https://store-usa.arduino.cc/products/arduino-mkr-wifi-1010

Arduino MKR Can Shield  SKU: 7630049200302
https://store-usa.arduino.cc/products/arduino-mkr-can-shield?selectedStore=us

Connectors
https://www.amazon.com/MCIGICM-Waterproof-Electrical-Automotive-Connectors/dp/B0829Y7TGS

Arduino IDE
https://www.arduino.cc/en/software

CANbus library
https://github.com/coryjfowler/MCP_CAN_lib

One or more chargers. I've never bought these as I bought a used Diginow kit. Can anyone add to this thread how to option out one of these?
Elcon TC HK-J 3300W Charger
https://www.evcomponents.com/elcon-tc-hk-j-3300w-charger.html


The connector wires connect to the CANbus shield as follows:

----------------
| CAN Shield |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|  1  2  3  4   |
----------------

1 Red
2 Blue
3 Brown
4 Black



The Arduino code:

// This does the bare minimum to turn on Diginow chargers. Voltage and current are set in the program below.
// Requires the mcp_can library, from here: https://github.com/coryjfowler/MCP_CAN_lib

#include <mcp_can.h>
#include <SPI.h>

// User adjustments here
word outputvoltage = 1126; //Set starting output voltage *10.  For example, 1120 = 112.0v.  112.6 = 90% charge.   **Do not set more than 1164!!**
word outputcurrent = 60;   //Set starting output amps *10. 320 = 32A. Here, 60 means 6 amps DC output.
unsigned long int sendId = 0x1806E5F4; //CAN Id of Charge controllers - Works on Diginow chargers.

// Nothing to adjust below here
unsigned char voltamp[8] = {highByte(outputvoltage), lowByte(outputvoltage), highByte(outputcurrent), lowByte(outputcurrent),0x00,0x00,0x00,0x00}; //5th byte is charge enable. 0x01 puts it in standby.
MCP_CAN CAN(3); //CS pin for CAN Controller.

void setup() {
  Serial.begin(9600);
  while(CAN_OK != CAN.begin(MCP_ANY, CAN_250KBPS, MCP_16MHZ)){ //initialize canbus.
    delay(200);}
  CAN.setMode(MCP_NORMAL); //Change to normal mode to allow messages to be transmitted.
}

void loop() {
  CAN.sendMsgBuf(sendId, 1, 8, voltamp); //Turn on the chargers and set volts and amps, once per second.
  delay(1000);
}


Use at your own risk, of course. Hope this helps.
Logged

DerKrawallkeks

  • Full Member
  • ***
  • Posts: 225
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #4 on: June 30, 2022, 04:19:59 PM »

Hey, thanks for that info.

I ordered the Elcons with the following configuration:

Battery type: Lithium-ion
Cells in series: 28
Nominal voltage: 3,7V

The rest irrelevant. I recommend adding a note "For Zero motorcycle" cause the guy at evcomponents knows the Zeros. Also you have to decide if you want the charger to be preprogrammed (then the config can't be changed), or if you want it changable via CAN. I had to wait forever to get my chargers from evcomponents though..

I have code for a controller using an ESP32 instead of an Arduino. With my code, you can change the charging current and voltage, if anyone wants that
Logged

jorn

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #5 on: August 19, 2022, 12:49:33 PM »

Will this also work with the 1.8kw version of the elcon charger?
Logged
2022 Zero FX 7.2 (European version)
Stark Varg on order (Delivery date in May 2023 )

jorn

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #6 on: August 19, 2022, 02:12:58 PM »


I have code for a controller using an ESP32 instead of an Arduino. With my code, you can change the charging current and voltage, if anyone wants that

I would be interested in that code. Does it work with the 1.8kw verison also?

Some of the sellers of these chargers want me to specify which bms it wil be used with... what do I tell them when I want to use this arduiono/esp32 option(s) to control the charger?

Basically: What should I be ware of when ordering the can bus version?
Logged
2022 Zero FX 7.2 (European version)
Stark Varg on order (Delivery date in May 2023 )

DerKrawallkeks

  • Full Member
  • ***
  • Posts: 225
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #7 on: August 28, 2022, 12:04:16 AM »

Hey,
The 1.8 kW charger has a CAN protocol PDF, I am sure.
My guess is it is probably very similar, just a different identifier, so the code will work just fine (but that's just a guess).

The only thing to be aware of with the CAN version is that it can't be used without constantly sending the CAN message (aka you'll always need to have your little box connected).

The BMS doesn't matter for the charger

PM me for the code.
Logged

Amazombi

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Diginow Supercharger Source Code is now Available
« Reply #8 on: April 06, 2024, 06:04:28 PM »

Hey, thanks for that info.

I ordered the Elcons with the following configuration:

Battery type: Lithium-ion
Cells in series: 28
Nominal voltage: 3,7V

The rest irrelevant. I recommend adding a note "For Zero motorcycle" cause the guy at evcomponents knows the Zeros. Also you have to decide if you want the charger to be preprogrammed (then the config can't be changed), or if you want it changable via CAN. I had to wait forever to get my chargers from evcomponents though..

I have code for a controller using an ESP32 instead of an Arduino. With my code, you can change the charging current and voltage, if anyone wants that
Hallo. Habe Interesse an dem ESP32-Code. Könnte dann über WiFi auch Daten vom Ladezustand abfregen. Gruß, Werner
 
Logged
Pages: [1]