Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
77f8bb5
add base thermal files (simple if loop)
ksthakkar Jun 11, 2025
e13b347
header file fix
ksthakkar Jun 11, 2025
ae4fce3
telemtry updates
ksthakkar Oct 17, 2025
237fb9c
clean up telemetry packets, only needed data for himac
ksthakkar Oct 17, 2025
b4560f7
add potential can loss dection
ksthakkar Oct 17, 2025
851def1
Updated mainline prints to be behind himac flag
nperrochon Oct 17, 2025
93ac93d
Can 2 to can3 and fixed HiMaC flag
ksthakkar Oct 22, 2025
67d8b25
Merge branch 'kt/himactestingv2' of https://github.com/Anteater-Elect…
ksthakkar Oct 22, 2025
96beabb
corrected state machine to match inverter docs
ksthakkar Oct 24, 2025
d44faa9
add debugging comments for himac 10-24
ksthakkar Oct 24, 2025
ff710a8
before adding pcc can defintions
ksthakkar Oct 24, 2025
ca59357
try to correct formatting and add correct spacings
ksthakkar Oct 24, 2025
c0efa4c
state machine fully verified, issues with motor phase leads
ksthakkar Oct 30, 2025
5af7a47
MOTOR SPINNING v2
ksthakkar Nov 5, 2025
ce410ae
post motor testing 11/5
ksthakkar Nov 7, 2025
6cc5aa5
Add pcc_receive.cpp
PranavKocharlakota Nov 7, 2025
79f6bfc
Merge pull request #42 from Anteater-Electric-Racing/pk/pcc_receive
ksthakkar Nov 7, 2025
cffe287
Merge branch 'kt/himactestingv2' of https://github.com/Anteater-Elect…
ksthakkar Nov 7, 2025
8da6d33
pcc can recieve testing
ksthakkar Nov 10, 2025
f5a593a
himac testing 10/11
ksthakkar Nov 11, 2025
c5b55f8
working pcc recieve
ksthakkar Nov 11, 2025
25ac7cb
pcc init added
ksthakkar Nov 12, 2025
c09357b
working integratoin test HIMAC, inverter faults tested and verified
ksthakkar Nov 12, 2025
0b657ca
reset torque to 0 when RTM is pressed.
ksthakkar Nov 12, 2025
5b37672
try to format on save
ksthakkar Nov 13, 2025
fe43d39
autosave clang
ksthakkar Nov 13, 2025
79e1f6f
fix pcc formatting
ksthakkar Nov 13, 2025
a8d810f
ifl100-36.h file formatted correctly
ksthakkar Nov 13, 2025
25559bf
BUGFIX: Reverted include order to compile correctly
nperrochon Nov 18, 2025
24983e7
Debugging APPS
KogantiAnoop Dec 27, 2025
c5efb39
format code
KogantiAnoop Dec 27, 2025
6be950f
Small fixes
KogantiAnoop Dec 27, 2025
d66963d
Add Faults to main.cpp
PranavKocharlakota Jan 15, 2026
1a56f02
Merge branch 'kt/himactestingv2' of https://github.com/Anteater-Elect…
PranavKocharlakota Jan 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions fsae-pcc/src/can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#define PCC_CAN_ID 0x123

typedef struct __attribute__((packed)) {
uint32_t timestamp; // Timestamp in milliseconds
uint8_t state; // Precharge state
// uint32_t timestamp; // Timestamp in milliseconds
uint8_t state; // Precharge state
uint8_t errorCode; // Error code
float accumulatorVoltage; // Accumulator voltage in volts
float tsVoltage; // Transmission side voltage in volts
// float accumulatorVoltage; // Accumulator voltage in volts
// float tsVoltage; // Transmission side voltage in volts
float prechargeProgress; // Precharge progress in percent
} PCC;

Expand All @@ -34,14 +34,16 @@ void CAN_Init() {
pccMsg.id = PCC_CAN_ID; // can change ID
}

void CAN_SendPCCMessage(uint32_t timestamp, uint8_t state, uint8_t errorCode, float accumulatorVoltage, float tsVoltage, float prechargeProgress) {
void CAN_SendPCCMessage(uint32_t timestamp, uint8_t state, uint8_t errorCode,
float accumulatorVoltage, float tsVoltage,
float prechargeProgress) {
pccData = {
.timestamp = timestamp,
.state = state,
.errorCode = errorCode,
.accumulatorVoltage = accumulatorVoltage,
.tsVoltage = tsVoltage,
.prechargeProgress = prechargeProgress
//.timestamp = timestamp, 4 bytes
.state = state, // 1 bytes
.errorCode = errorCode, // 1 bytes
//.accumulatorVoltage = accumulatorVoltage, 4 bytes
//.tsVoltage = tsVoltage, 4 bytes
.prechargeProgress = prechargeProgress // 4 bytes
};

// Serial.print("PCC Message: ");
Expand All @@ -60,4 +62,4 @@ void CAN_SendPCCMessage(uint32_t timestamp, uint8_t state, uint8_t errorCode, fl

memcpy(pccMsg.buf, &pccData, sizeof(PCC));
can1.write(pccMsg);
}
}
4 changes: 3 additions & 1 deletion fsae-pcc/src/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
#include <stdint.h>

void CAN_Init();
void CAN_SendPCCMessage(uint32_t timestamp, uint8_t state, uint8_t errorCode, float accumulatorVoltage, float tsVoltage, float prechargeProgress);
void CAN_SendPCCMessage(uint32_t timestamp, uint8_t state, uint8_t errorCode,
float accumulatorVoltage, float tsVoltage,
float prechargeProgress);
6 changes: 3 additions & 3 deletions fsae-pcc/src/gpio.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Anteater Electric Racing, 2025

#include <Arduino.h>
#include "gpio.h"
#include "utils.h"
#include <Arduino.h>

void gpioInit(void){
void gpioInit(void) {
pinMode(SHUTDOWN_CTRL_PIN, INPUT);
pinMode(FREQ_ACCU_PIN, INPUT);
pinMode(FREQ_TS_PIN, INPUT);
}
}
2 changes: 1 addition & 1 deletion fsae-pcc/src/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

#pragma once

void gpioInit(void);
void gpioInit(void);
41 changes: 21 additions & 20 deletions fsae-pcc/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@

#include <Arduino.h>
#include <arduino_freertos.h>
#include "precharge.h"

#include "can.h"
#include "gpio.h"
#include "precharge.h"
#include "utils.h"
#include "can.h"

static void threadMain(void *pvParameters);

void setup() {
Serial.begin(9600);

xTaskCreate(threadMain, "threadMain", THREAD_MAIN_STACK_SIZE, NULL, THREAD_MAIN_PRIORITY, NULL);
xTaskCreate(threadMain, "threadMain", THREAD_MAIN_STACK_SIZE, NULL,
THREAD_MAIN_PRIORITY, NULL);

gpioInit(); // Initialize GPIO pins

Expand All @@ -48,21 +50,21 @@ void threadMain(void *pvParameters) {

Serial.print("State: ");
switch (state) {
case STATE_STANDBY:
Serial.print("STANDBY");
break;
case STATE_PRECHARGE:
Serial.print("PRECHARGE");
break;
case STATE_ONLINE:
Serial.print("ONLINE");
break;
case STATE_ERROR:
Serial.print("ERROR");
break;
default:
Serial.print("UNDEFINED");
break;
case STATE_STANDBY:
Serial.print("STANDBY");
break;
case STATE_PRECHARGE:
Serial.print("PRECHARGE");
break;
case STATE_ONLINE:
Serial.print("ONLINE");
break;
case STATE_ERROR:
Serial.print("ERROR");
break;
default:
Serial.print("UNDEFINED");
break;
}
Serial.print(" | Accumulator Voltage: ");
Serial.print(accumulator_voltage, 4);
Expand All @@ -76,5 +78,4 @@ void threadMain(void *pvParameters) {
}
}

void loop() {
}
void loop() {}
Loading
Loading