Code to run on the charger board (used to charge the car from the mains).

Dependencies:   mbed CUER_CAN

charger.h

Committer:
DasSidG
Date:
2017-07-30
Revision:
5:756fae795d37
Parent:
3:a7626dffb64a
Child:
7:70cf5bff23f9

File content as of revision 5:756fae795d37:

#ifndef CHARGER_H
#define CHARGER_H

#include "mbed.h"

#define DEBUG 1

#define MAX_VOLTAGE 155000.0
#define MAX_CURRENT 10000.0
#define RISING_BALANCE_THRESHOLD 4150 //DUMMY VALUE FOR NOW, THINK ABOUT THE ACTUAL VALUE
#define KI_CHARGE 2.5
#define KI_BALANCE 0.6
#define TIME_STEP 500
#define PACK_CAPACITY 24 //in Ah
//#define TEMP_RAMP_START -5.0
//#define TEMP_RAMP_FINISH -1.5

#define CHARGER_MSG_TIMEOUT_MS 6000 
#define BMS_MSG_TIMEOUT_MS     2000 

//Macros for charging to avoid confusion and potentioal errors
#define START_CHARGING 0
#define STOP_CHARGING 1

#define CAN_BUFFER_SIZE 255 //Setting this to be quite large, should be equal to max # of ids expected to receive

// CAN pins
#define CAR_CAN_WRITE_PIN p29
#define CAR_CAN_READ_PIN p30
#define CHARGER_CAN_WRITE_PIN p10
#define CHARGER_CAN_READ_PIN p9



#endif