diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/0512160400_CRIMP_HOUSINGS.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/0512160400_CRIMP_HOUSINGS.pdf deleted file mode 100644 index ed83fdce..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/0512160400_CRIMP_HOUSINGS.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/23430.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/23430.pdf deleted file mode 100644 index ebc40e9c..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/23430.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/512160400_sd.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/512160400_sd.pdf deleted file mode 100644 index 7c0d0593..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/512160400_sd.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/Digi-Key - Online Order Summary.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/Digi-Key - Online Order Summary.pdf deleted file mode 100644 index 94e8bb06..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/Digi-Key - Online Order Summary.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAUserManual.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAUserManual.pdf deleted file mode 100644 index cabc29cb..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAUserManual.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAscaledatasheet.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAscaledatasheet.pdf deleted file mode 100644 index 26af14f3..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/ISAscaledatasheet.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-1K-U3-TOI-CAN2-12Connectors.html b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-1K-U3-TOI-CAN2-12Connectors.html deleted file mode 100644 index e4aab552..00000000 --- a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-1K-U3-TOI-CAN2-12Connectors.html +++ /dev/null @@ -1,4 +0,0 @@ -http://www.digikey.com/short/3c2wwr - -This digikey shopping cart contains all the connectors and pins -for the ISA IVT-1K-U3-TOI-CAN2-12 Current Sensor \ No newline at end of file diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-Mod_HowTo.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-Mod_HowTo.pdf deleted file mode 100644 index 240f5806..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT-Mod_HowTo.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT_Modular_datasheet_1.10.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT_Modular_datasheet_1.10.pdf deleted file mode 100644 index 26af14f3..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/IVT_Modular_datasheet_1.10.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/MolexMLX55487.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/MolexMLX55487.pdf deleted file mode 100644 index f6e47b7b..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/MolexMLX55487.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/eJWPF-335041.pdf b/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/eJWPF-335041.pdf deleted file mode 100644 index e47c71f1..00000000 Binary files a/Software/src/lib/smaresca-SimpleISA/DOCUMENTATION/eJWPF-335041.pdf and /dev/null differ diff --git a/Software/src/lib/smaresca-SimpleISA/README.md b/Software/src/lib/smaresca-SimpleISA/README.md deleted file mode 100644 index d544dee9..00000000 --- a/Software/src/lib/smaresca-SimpleISA/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# SimpleISA -Simple library for IVT shunts. -Based on the EVTV library of 2016, revised for use with CHAdeMO. -Originally intended to integrate with Arduino Due. -Adapted for ESP32 and ESP32-Arduino-CAN for use in the Battery-Emulator project https://github.com/dalathegreat/Battery-Emulator - hosted at https://github.com/smaresca/SimpleISA-ESP32-Arduino-CAN - -Derived from https://github.com/isaac96/simpleISA/ and https://github.com/damienmaguire/SimpleISA/ - diff --git a/Software/src/lib/smaresca-SimpleISA/SimpleISA.cpp b/Software/src/lib/smaresca-SimpleISA/SimpleISA.cpp deleted file mode 100644 index 06340d69..00000000 --- a/Software/src/lib/smaresca-SimpleISA/SimpleISA.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* This library supports ISA Scale IVT Modular current/voltage sensor device. These devices measure current, up to three voltages, and provide temperature compensation. - - - - This library was written by Jack Rickard of EVtv - http://www.evtv.me - copyright 2014 - You are licensed to use this library for any purpose, commercial or private, - without restriction. - - 2024 - Modified to make use of ESP32-Arduino-CAN by miwagner - -*/ - - -#include "SimpleISA.h" - -template inline Print &operator <<(Print &obj, T arg) { obj.print(arg); return obj; } - - -ISA::ISA() // Define the constructor. -{ - - timestamp = millis(); - debug=false; - debug2=false; - framecount=0; - firstframe=true; -} - - -ISA::~ISA() //Define destructor -{ -} - -void ISA::begin(int Port, int speed) -{ - - -} - - - -void ISA::handleFrame(CAN_frame_t *frame) - -//This is our CAN interrupt service routine to catch inbound frames -{ - - - switch (frame->MsgID) - { - case 0x511: - - break; - - case 0x521: - handle521(frame); - break; - - case 0x522: - handle522(frame); - break; - - case 0x523: - handle523(frame); - break; - - case 0x524: - handle524(frame); - break; - - case 0x525: - handle525(frame); - break; - - case 0x526: - handle526(frame); - break; - - case 0x527: - handle527(frame); - break; - - case 0x528: - handle528(frame); - break; - } - - if(debug)printCAN(frame); -} - -void ISA::handle521(CAN_frame_t *frame) //AMperes - -{ - framecount++; - long current=0; - current = (long)((frame->data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - milliamps=current; - Amperes=current/1000.0f; - - if(debug2)Serial<<"Current: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - Voltage=volt/1000.0f; - Voltage1=Voltage-(Voltage2+Voltage3); - if(framecount<150) - { - VoltageLO=Voltage; - Voltage1LO=Voltage1; - } - if(Voltage150)VoltageLO=Voltage; - if(Voltage>VoltageHI && framecount>150)VoltageHI=Voltage; - if(Voltage1150)Voltage1LO=Voltage1; - if(Voltage1>Voltage1HI && framecount>150)Voltage1HI=Voltage1; - - if(debug2)Serial<<"Voltage: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - Voltage2=volt/1000.0f; - if(Voltage2>3)Voltage2-=Voltage3; - if(framecount<150)Voltage2LO=Voltage2; - if(Voltage2150)Voltage2LO=Voltage2; - if(Voltage2>Voltage2HI&& framecount>150)Voltage2HI=Voltage2; - - - if(debug2)Serial<<"Voltage: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - Voltage3=volt/1000.0f; - if(framecount<150)Voltage3LO=Voltage3; - if(Voltage3150 && Voltage3>10)Voltage3LO=Voltage3; - if(Voltage3>Voltage3HI && framecount>150)Voltage3HI=Voltage3; - - if(debug2)Serial<<"Voltage: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - Temperature=temp/10; - - if(debug2)Serial<<"Temperature: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - - KW=watt/1000.0f; - - if(debug2)Serial<<"Power: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2]); - - AH+=(As-lastAs)/3600.0f; - lastAs=As; - - - if(debug2)Serial<<"Amphours: "<data.u8[5] << 24) | (frame->data.u8[4] << 16) | (frame->data.u8[3] << 8) | (frame->data.u8[2])); - KWH+=(wh-lastWh)/1000.0f; - lastWh=wh; - if(debug2)Serial<<"KiloWattHours: "<MsgID, frame->data.u8[0],frame->data.u8[1],frame->data.u8[2], - frame->data.u8[3],frame->data.u8[4],frame->data.u8[5],frame->data.u8[6],frame->data.u8[7],0); - Serial<<"Rcvd ISA frame: 0x"< -#include "../miwagner-ESP32-Arduino-CAN/CAN_config.h" -#include "../miwagner-ESP32-Arduino-CAN/ESP32CAN.h" - -class ISA -{ - - - - - - public: - ISA(); - ~ISA(); - void initialize(); - void begin(int Port, int speed); - void initCurrent(); - void sendSTORE(); - void STOP(); - void START(); - void RESTART(); - void deFAULT(); - - - float Amperes; // Floating point with current in Amperes - double AH; //Floating point with accumulated ampere-hours - double KW; - double KWH; - - - double Voltage; - double Voltage1; - double Voltage2; - double Voltage3; - double VoltageHI; - double Voltage1HI; - double Voltage2HI; - double Voltage3HI; - double VoltageLO; - double Voltage1LO; - double Voltage2LO; - double Voltage3LO; - - double Temperature; - - bool debug; - bool debug2; - bool firstframe; - int framecount; - unsigned long timestamp; - double milliamps; - long watt; - long As; - long lastAs; - long wh; - long lastWh; - void handleFrame(CAN_frame_t *frame); // CAN handler - uint8_t page; - - private: - CAN_frame_t frame; - unsigned long elapsedtime; - double ampseconds; - int milliseconds ; - int seconds; - int minutes; - int hours; - char buffer[9]; - char bigbuffer[90]; - uint32_t inbox; - CAN_frame_t outframe = { - .FIR = {.B = { - .DLC = 8, - .unknown_2 = 0, - .RTR = CAN_no_RTR, - .FF = CAN_frame_std, - }}, - .MsgID = 0x411, - .data = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; - - - void printCAN(CAN_frame_t *frame); - void handle521(CAN_frame_t *frame); - void handle522(CAN_frame_t *frame); - void handle523(CAN_frame_t *frame); - void handle524(CAN_frame_t *frame); - void handle525(CAN_frame_t *frame); - void handle526(CAN_frame_t *frame); - void handle527(CAN_frame_t *frame); - void handle528(CAN_frame_t *frame); - - -}; - -#endif /* SimpleISA_h */ diff --git a/Software/src/lib/smaresca-SimpleISA/examples/ISAScaleTest/ISAScaleTest.ino b/Software/src/lib/smaresca-SimpleISA/examples/ISAScaleTest/ISAScaleTest.ino deleted file mode 100644 index f2962e70..00000000 --- a/Software/src/lib/smaresca-SimpleISA/examples/ISAScaleTest/ISAScaleTest.ino +++ /dev/null @@ -1,188 +0,0 @@ - - - -#include -#include "variant.h" -#include - - #define Serial SerialUSB //Use native port - template inline Print &operator <<(Print &obj, T arg) { obj.print(arg); return obj; } //Allow streaming - -float Version=2.00; -uint16_t loopcount=0; -unsigned long startime=0; -unsigned long elapsedtime=0; -uint port=0; -uint16_t datarate=500; - - ISA Sensor; //Instantiate ISA Module Sensor object to measure current and voltage - - -void setup() -{ - Serial.begin(115200); - Sensor.begin(port,datarate); //Start ISA object on CAN 0 at 500 kbps - - Serial<<"\nISA Scale Startup Successful \n"; - - printMenu(); -} - -void loop() -{ - if(loopcount++==40000) - { - printStatus(); - loopcount-0; - } - checkforinput(); //Check keyboard for user input -} - - -void printStatus() -{ - char buffer[40]; - //printimestamp(); - - sprintf(buffer,"%4.2f",Sensor.Voltage); - Serial<<"Volt:"<0) - { - Serial<<"Datarate:"<1) Serial<<"Entry out of range, enter 0 or 1 \n"; - else - { - port=P; - Sensor.begin(port,datarate); - } -}