Penn Electric Racing / Mbed 2 deprecated REVO_Updated_Steering

Dependencies:   CANBuffer KS0108_fork mbed-rtos mbed CAN Addresses

Fork of REVO_Updated_Steering by Penn Electric

Files at this revision

API Documentation at this revision

Comitter:
tmccurbin
Date:
Sun Feb 08 05:47:05 2015 +0000
Parent:
38:d04a430d7fe3
Child:
40:92f08fdc32df
Commit message:
Fixed filters. Implemented thresholds for variable updates.

Changed in this revision

CAN_Address.h Show annotated file Show diff for this revision Revisions of this file
CAN_Filter_LUT.h Show annotated file Show diff for this revision Revisions of this file
Steering.cpp Show annotated file Show diff for this revision Revisions of this file
Steering.h Show annotated file Show diff for this revision Revisions of this file
--- a/CAN_Address.h	Sun Feb 08 02:47:05 2015 +0000
+++ b/CAN_Address.h	Sun Feb 08 05:47:05 2015 +0000
@@ -15,12 +15,9 @@
 #define CURRENT_TX_ID           TX_BASE + 0x06
 #define CELLV_MMA_TX_ID_BASE    TX_BASE + 0x16
 #define CELLV_MMA_TX_ID_BASE2   TX_BASE + 0x17
-#define TEMP_MMA_TX_ID_BASE     TX_BASE + 0x18
-#define TEMP_MMA_TX_ID_BASE2    TX_BASE + 0x19
 #define BOARDTEMP_TX_ID         TX_BASE + 0x0E
 
 // Motor Screen Addresses
-#define MOC_MOTEMP_ID           0x212
 #define MOC_AIRTEMP_ID          0x213
 #define MOC_IGBTTEMP_ID         0x214
 #define MOC_RPM_ID              0x211
--- a/CAN_Filter_LUT.h	Sun Feb 08 02:47:05 2015 +0000
+++ b/CAN_Filter_LUT.h	Sun Feb 08 05:47:05 2015 +0000
@@ -24,12 +24,65 @@
  
 const uint16_t AF_LUT_SEI[] = {
 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00) !!
- 
+  
 // STANDARD EXPLICIT IDs - CAN CONTROLLER 1
-//( 0xID                              & STDMASK),
- 
+//( 0xID                            & STDMASK),
+  
 // STANDARD EXPLICIT IDs - CAN CONTROLLER 2
 //( 0xID                              & STDMASK) | 1<<13,
+
+( MOC_RPM_ID                        & STDMASK) | 1<<13, // 0x211
+
+( MOC_MOTEMP_ID                     & STDMASK) | 1<<13, // 0x212
+
+( MOC_AIRTEMP_ID                    & STDMASK) | 1<<13, // 0x213
+
+( MOC_IGBTTEMP_ID                   & STDMASK) | 1<<13, // 0x214
+
+( PCM_PEDALS_ID                     & STDMASK) | 1<<13, // 0x220
+
+( PCM_FRPM_ID                       & STDMASK) | 1<<13, // 0x222
+
+( PCM_TORQUERQ_ID                   & STDMASK) | 1<<13, // 0x231
+
+( FAULTCODE_TX_ID                   & STDMASK) | 1<<13, // 0x300
+
+( MODE_TX_ID                        & STDMASK) | 1<<13, // 0x301
+
+( CURRENT_TX_ID                     & STDMASK) | 1<<13, // 0x306
+
+( CHARGECURR_TX_ID                  & STDMASK) | 1<<13, // 0x307
+
+( VOLTAGE_TX_ID                     & STDMASK) | 1<<13, // 0x308
+
+( POWER_TX_ID                       & STDMASK) | 1<<13, // 0x309
+
+( SOC_TX_ID                         & STDMASK) | 1<<13, // 0x30B
+
+( BOARDTEMP_TX_ID                   & STDMASK) | 1<<13, // 0x30E
+
+( CELLV_MMA_TX_ID_BASE              & STDMASK) | 1<<13, // 0x316
+
+( CELLV_MMA_TX_ID_BASE2             & STDMASK) | 1<<13, // 0x317
+
+( TEMP_MMA_TX_ID_BASE               & STDMASK) | 1<<13, // 0x318
+
+( TEMP_MMA_TX_ID_BASE2              & STDMASK) | 1<<13, // 0x319
+
+( SYS_GLV_CURRENT_ID                & STDMASK) | 1<<13, // 0x510
+
+( SYS_GLV_SOC_ID                    & STDMASK) | 1<<13, // 0x513
+
+( SYS_DCDC_STATUS_ID                & STDMASK) | 1<<13, // 0x521
+
+( SYS_PWM_FAN_ID                    & STDMASK) | 1<<13, // 0x530
+
+( SYS_PWM_PUMP_ID                   & STDMASK) | 1<<13, // 0x531
+
+( SYS_IMD_RESIST_ID                 & STDMASK) | 1<<13, // 0x541
+
+( SYS_SWITCHES_ID                   & STDMASK) | 1<<13, // 0x560
+
 };
  
 const uint32_t AF_LUT_SIR[] = {
@@ -55,51 +108,6 @@
  
 const uint64_t AF_LUT_EIR[] = {
 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00), NO OVERLAPPING RANGES !!
-( SIGNALS_TX_ID                     & EXTMASK),
-( PROFILE_TX_ID                     & EXTMASK),
-( PACKERRS_TX_ID                    & EXTMASK),
-( AH_TX_ID                          & EXTMASK),
-( SUPPLY_TX_ID                      & EXTMASK),
-( VMISMATCH_TX_ID                   & EXTMASK),
-( FANSPEED_TX_ID                    & EXTMASK),
-( STACK_OPDATA_TX_ID                & EXTMASK),
-( INTREF_MMA_TX_ID_BASE             & EXTMASK),
-( DIETEMP_MMA_TX_ID_BASE            & EXTMASK),
-( VA_MMA_TX_ID_BASE                 & EXTMASK),
-( VDD_MMA_TX_ID_BASE                & EXTMASK),
-( SOC_MMA_TX_ID_BASE                & EXTMASK),
-( CELLV_TX_ID_BASE                  & EXTMASK),
-( CELLFLAGS_TX_ID_BASE              & EXTMASK),
-( TEMP_TX_ID_BASE                   & EXTMASK),
-( TEMPFLAGS_TX_ID_BASE              & EXTMASK),
-( IC_REF_SOC_TX_ID_BASE             & EXTMASK),
-( IC_VA_VDD_TX_ID_BASE              & EXTMASK),
-( IC_DIETEMP_TX_ID_BASE             & EXTMASK),
-( DIETEMPFLAGS_TX_ID_BASE           & EXTMASK),
-( IC_OPDATA_TX_ID_BASE              & EXTMASK),
-( PCM_ERROR_ID                      & EXTMASK),
-( PCM_MODE_ID                       & EXTMASK),
-( PCM_FLAGS_ID                      & EXTMASK),
-( LEFT_MOC_TXID                     & EXTMASK),
-( RIGHT_MOC_TXID                    & EXTMASK),
-( MOC_CURRENT_ID                    & EXTMASK),
-( MOC_VBUS_ID                       & EXTMASK),
-( PCM_DIGIOUT_ID                    & EXTMASK),
-( SYSMGMT_PUMPCMD_ID                & EXTMASK),
-( SYSMGMT_FANCMD_ID                 & EXTMASK),
-( MOC_FAULTS_ID                     & EXTMASK),
-( PCM_FAULTS_ID                     & EXTMASK),
-( FAULTCODE_TX_ID                   & EXTMASK),
-( SYS_ERROR_ID                      & EXTMASK),
-( SYS_XBEE1_ID                      & EXTMASK),
-( SYS_XBEE2_ID                      & EXTMASK),
-( SYS_TEMP_ID                       & EXTMASK),
-( SYS_GLV_CAPACITY_ID               & EXTMASK),
-( SYS_GLV_AH_ID                     & EXTMASK),
-( SYS_DCDC_CURRENT_ID               & EXTMASK),
-( SYS_IMD_STATUS_ID                 & EXTMASK),
-( SYS_IMD_LATCH_ID                  & EXTMASK),
-( SYS_AMS_LATCH_ID                  & EXTMASK),
 
 // EXTENDED ID RANGES - CAN CONTROLLER 1
 //( 0xLOWERBOUND & EXTMASK) << 32         | ( 0xUPPERBOUND & EXTMASK), lower/upperbounds are inclusive
--- a/Steering.cpp	Sun Feb 08 02:47:05 2015 +0000
+++ b/Steering.cpp	Sun Feb 08 05:47:05 2015 +0000
@@ -27,17 +27,14 @@
     display.GotoXY(10,16);
     display.SelectFont(Arial_14,BLACK,ReadData);
     display.PrintString("Penn Electric Racing");
-    wait(2);
-    display.ClearScreen();
-    display.GotoXY(10,16);
-    display.PrintString("Live the dream.");
-    wait(2);
+    wait(1);
+
+    CANMessage Rxmsg;
 
     Thread Thread2(ProcessButtons);
     Thread Thread1(DisplayCurrScreen);
 
     while(1) {
-        CANMessage Rxmsg;
         if (SteeringCANPort.rxRead(Rxmsg)) {
             ProcessCANMsg(Rxmsg);
         }
@@ -108,145 +105,229 @@
 void ProcessCANMsg(CANMessage& Rxmsg)
 {
     if (SteeringCANPort.rxRead(Rxmsg)) {
-        printf("Message ID: 0x%x len: %d hex: 0x%x float: %f\r\n", Rxmsg.id, Rxmsg.len, *((int*)((void*)(&Rxmsg.data[0]))), *((float*)((void*)(&Rxmsg.data[0]))));
-        for (int i=0; i < Rxmsg.len; i++) printf("D[%d]: %x ", i, Rxmsg.data[i]);
+        // Printing CAN message data:
+        // printf("Message ID: 0x%x len: %d hex: 0x%x float: %f\r\n", Rxmsg.id, Rxmsg.len, *((int*)((void*)(&Rxmsg.data[0]))), *((float*)((void*)(&Rxmsg.data[0]))));
+        // for (int i=0; i < Rxmsg.len; i++) printf("D[%d]: %x ", i, Rxmsg.data[i]);
         switch (Rxmsg.id) {
 
                 // HOME SCREEN *******************************************************************************************
             case SOC_TX_ID:
                 CANFloat = GetFloat;
-                sprintf(BigBatLifeBuffer,"%3.2d", int(CANFloat*100));                   // Big battery life percentage
-                display.PutString(1,40,BigBatLifeBuffer);
+                if (abs(CANFloat*100 - *BigBatLifeBuffer) >= 1) {
+                    sprintf(BigBatLifeBuffer,"%3.2d", int(CANFloat*100));                   // Big battery life percentage
+                    display.PutString(1,40,BigBatLifeBuffer);
+                }
                 break;
             case SYS_GLV_SOC_ID:
                 CANFloat = GetFloat;
-                sprintf(SmallBatLifeBuffer,"%3.2d", int(CANFloat*100));                 // Small battery life percentage 
-                display.PutString(1,60,SmallBatLifeBuffer);
+                if (abs(CANFloat*100 - *SmallBatLifeBuffer) >= 1) {
+                    sprintf(SmallBatLifeBuffer,"%3.2d", int(CANFloat*100));                 // Small battery life percentage
+                    display.PutString(1,60,SmallBatLifeBuffer);
+                }
                 break;
             case PCM_FRPM_ID:
                 CANFloat  = GetFloat;
                 CANFloat2 = GetFloat4;
-                sprintf(CarSpdBuffer,"%3.2d", int((CANFloat+CANFloat2)*WheelCircumference*30));     // Miles per hour
-                display.PutString(1,108,CarSpdBuffer);
+                if (abs((CANFloat+CANFloat2)*WheelCircumference*30 - *CarSpdBuffer) >= 1) {
+                    sprintf(CarSpdBuffer,"%3.2d", int((CANFloat+CANFloat2)*WheelCircumference*30));     // Miles per hour
+                    display.PutString(1,108,CarSpdBuffer);
+                }
+                break;
             case TEMP_MMA_TX_ID_BASE2:
                 CANFloat = GetFloat;
-                sprintf(AvgBatTBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));          // Degrees F
-                display.PutString(3,39,AvgBatTBuffer);
-                //display.PutString(5,108,AvgBatTBuffer); this is for the battery screen
+                if (abs((CANFloat*9.0/5.0)+32 - *AvgBatTBuffer) >=1) {
+                    sprintf(AvgBatTBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));          // Degrees F
+                    display.PutString(3,39,AvgBatTBuffer);
+                    //display.PutString(5,108,AvgBatTBuffer); this is for the battery screen
+                }
+                break;
             case TEMP_MMA_TX_ID_BASE:
                 CANFloat2 = GetFloat4;
-                sprintf(MaxBatTBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));          // Figure out Max/Min and Figure out various screen display
-                display.PutString(3,103,MaxBatTBuffer);
-                //display.PutString(5,20,MaxBatTBuffer); this is for the battery screen
+                if (abs((CANFloat2*9.0/5.0)+32 - *MaxBatTBuffer) >=1) {
+                    sprintf(MaxBatTBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));          // Figure out Max/Min and Figure out various screen display
+                    display.PutString(3,103,MaxBatTBuffer);
+                    //display.PutString(5,20,MaxBatTBuffer); this is for the battery screen
+                }
                 CANFloat = GetFloat;
-                sprintf(MinBatTBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));
-                //display.PutString(5,67,MinBatTBuffer); this is for the battery screen
+                if (abs((CANFloat*9.0/5.0)+32 - *MinBatTBuffer) >= 1) {
+                    sprintf(MinBatTBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));
+                    //display.PutString(5,67,MinBatTBuffer); this is for the battery screen
+                }
+                break;
             case MOC_MOTEMP_ID:
                 CANFloat = GetFloat;
-                sprintf(LMtrTmpBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));          // We need to figure out how to handle the bytes for left and right motors
-                display.PutString(5,34,LMtrTmpBuffer);
-                // display.PutString(1,34,LMtrTmpBuffer); this is for the motor screen
+                if (abs((CANFloat*9.0/5.0)+32 - *LMtrTmpBuffer) >= 1) {
+                    sprintf(LMtrTmpBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));          // We need to figure out how to handle the bytes for left and right motors
+                    display.PutString(5,34,LMtrTmpBuffer);
+                    // display.PutString(1,34,LMtrTmpBuffer); this is for the motor screen
+                }
                 CANFloat2 = GetFloat4;
-                sprintf(RMtrTmpBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));          // We need to figure out how to handle the bytes for left and right motors
-                display.PutString(5,34,RMtrTmpBuffer);
-                //display.PutString(1,98,LMtrTmpBuffer); this is for the motor screen
+                if (abs((CANFloat2*9.0/5.0)+32 - *RMtrTmpBuffer) >= 1) {
+                    sprintf(RMtrTmpBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));          // We need to figure out how to handle the bytes for left and right motors
+                    display.PutString(5,34,RMtrTmpBuffer);
+                    //display.PutString(1,98,LMtrTmpBuffer); this is for the motor screen
+                }
+                break;
+
                 // BATTERY SCREEN***********************************************************************************
             case VOLTAGE_TX_ID:
                 CANFloat = GetFloat;
-                sprintf(BigBatVoltBuffer,"%3.2d", int(CANFloat));                       // Volts
-                //display.PutString(1,10,BigBatVoltBuffer);
-                //display.PutString(3,94,BigBatVoltBuffer); this is for the charging screen
+                if (abs(CANFloat - *BigBatVoltBuffer) >= 0.1) {
+                    sprintf(BigBatVoltBuffer,"%3.2d", int(CANFloat));                       // Volts
+                    //display.PutString(1,10,BigBatVoltBuffer);
+                    //display.PutString(3,94,BigBatVoltBuffer); this is for the charging screen
+                }
+                break;
             case POWER_TX_ID:
                 CANFloat = GetFloat;
-                sprintf(BigBatPowerBuffer,"%3.2d", int(CANFloat));                       // Watts
-                //display.PutString(1,55,BigBatPowerBuffer);
+                if (abs(CANFloat - *BigBatPowerBuffer) >= 1) {
+                    sprintf(BigBatPowerBuffer,"%3.2d", int(CANFloat));                       // Watts
+                    //display.PutString(1,55,BigBatPowerBuffer);
+                }
+                break;
             case CURRENT_TX_ID:
                 CANFloat = GetFloat;
-                sprintf(BigBatCurrentBuffer,"%3.2d", int(CANFloat));                       // Amps
-                //display.PutString(1,100,BigBatCurrentBuffer);
+                if (abs(CANFloat - *BigBatCurrentBuffer) >= 0.2) {
+                    sprintf(BigBatCurrentBuffer,"%3.2d", int(CANFloat));                       // Amps
+                    //display.PutString(1,100,BigBatCurrentBuffer);
+                }
+                break;
             case CELLV_MMA_TX_ID_BASE:
                 CANFloat2 = GetFloat4;
-                sprintf(VmaxBuffer,"%3.2d", int(CANFloat2));                                 // We need to figure out how to handle max and min
-                //display.PutString(3,20,VmaxBuffer);
+                if (abs(CANFloat2 - *VmaxBuffer) >= 0.1) {
+                    sprintf(VmaxBuffer,"%3.2d", int(CANFloat2));                                 // We need to figure out how to handle max and min
+                    //display.PutString(3,20,VmaxBuffer);
+                }
                 CANFloat = GetFloat;
-                sprintf(VminBuffer,"%3.2d", int(CANFloat));
-                //display.PutString(3,67,VminBuffer);
+                if (abs(CANFloat - *VminBuffer) >= 0.1) {
+                    sprintf(VminBuffer,"%3.2d", int(CANFloat));
+                    //display.PutString(3,67,VminBuffer);
+                }
+                break;
             case CELLV_MMA_TX_ID_BASE2:
                 CANFloat = GetFloat;
-                sprintf(VavgBuffer,"%3.2d", int(CANFloat));                                 // Volts
-                //display.PutString(3,108,VavgBuffer);
+                if (abs(CANFloat - *VavgBuffer) >= 0.1) {
+                    sprintf(VavgBuffer,"%3.2d", int(CANFloat));                                 // Volts
+                    //display.PutString(3,108,VavgBuffer);
+                }
+                break;
             case BOARDTEMP_TX_ID:
                 CANFloat = GetFloat;
-                sprintf(BoardTempBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));                                 // Degrees F
-                //display.PutString(7,87,BoardTempBuffer);
+                if (abs((CANFloat*9.0/5.0)+32 - *BoardTempBuffer) >= 1) {
+                    sprintf(BoardTempBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));                                 // Degrees F
+                    //display.PutString(7,87,BoardTempBuffer);
+                }
+                break;
 
                 // MOTOR SCREEN*****************************************************************
             case MOC_AIRTEMP_ID:
                 CANFloat = GetFloat;
+                if (abs((CANFloat*9.0/5.0)+32 - *LAirTmpBuffer) >= 1) {
                 sprintf(LAirTmpBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));                   // Figure out the left and the right
                 //display.PutString(2,34,LAirTmpBuffer);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs((CANFloat2*9.0/5.0)+32 - *RAirTmpBuffer) >= 1) {
                 sprintf(RAirTmpBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));                   // Degrees F
                 //display.PutString(2,98,RAirTmpBuffer);
+                }
+                break;
             case MOC_IGBTTEMP_ID:
                 CANFloat = GetFloat;
+                if (abs((CANFloat*9.0/5.0)+32 - *LIGBTmpBuffer) >= 1) {
                 sprintf(LIGBTmpBuffer,"%3.2d", int((CANFloat*9.0/5.0)+32));                   // Figure out the left and the right
                 //display.PutString(3,34,LIGBTmpBuffer);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs((CANFloat2*9.0/5.0)+32 - *RIGBTmpBuffer) >= 1) {
                 sprintf(RIGBTmpBuffer,"%3.2d", int((CANFloat2*9.0/5.0)+32));                   // Degrees F
                 //display.PutString(3,98,RIGBTmpBuffer);
+                }
+                break;
             case MOC_RPM_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat - *Rpm_LBuffer) >= 1) {
                 sprintf(Rpm_LBuffer,"%3.2d", int(CANFloat));                   // Figure out the left and the right
                 //display.PutString(5,30,Rpm_LBuffer);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs(CANFloat2 - *Rpm_RBuffer) >= 1) {
                 sprintf(Rpm_RBuffer,"%3.2d", int(CANFloat2));
                 //display.PutString(5,107,Rpm_RBuffer);
+                }
+                break;
             case PCM_TORQUERQ_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat*100 - *TRequestBufferL) >= 1) {
                 sprintf(TRequestBufferL,"%3.2d", int(CANFloat*100));             // Percentage
                 //display.PutString(7,89,TRequestBufferL);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs(CANFloat2*100 - *TRequestBufferR) >= 1) {
                 sprintf(TRequestBufferR,"%3.2d", int(CANFloat2*100));             // Percentage
                 //display.PutString(7,89,TRequestBufferR);
+                }
+                break;
 
                 // SYSTEM MANAGEMENT SCREEN***************************************************
             case SYS_GLV_CURRENT_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat - *SmallBatCurrentBuffer) >= 0.2) {
                 sprintf(SmallBatCurrentBuffer,"%3.2d", int(CANFloat));             // Amps
                 //display.PutString(1,30,SmallBatCurrentBuffer);
+                }
+                break;
             case SYS_SWITCHES_ID:
                 CANFloat = GetFloat;
                 sprintf(ShtdSwtchBuffer,"%3.2d", int(CANFloat));             // How the heck are we interpreting this data
                 //display.PutString(1,108,ShtdSwtchBuffer);
+                break;
             case SYS_PWM_FAN_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat*100 - *Fan1Buffer) >= 1) {
                 sprintf(Fan1Buffer,"%3.2d", int(CANFloat*100));                   // Duty Cycle. Figure out the left and the right
                 //display.PutString(3,30,Fan1Buffer);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs(CANFloat2*100 - *Fan1Buffer) >= 1) {
                 sprintf(Fan2Buffer,"%3.2d", int(CANFloat2*100));
                 //display.PutString(3,107,Fan2Buffer);
+                }
+                break;
             case SYS_PWM_PUMP_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat*100 - *Pump1Buffer) >= 1) {
                 sprintf(Pump1Buffer,"%3.2d", int(CANFloat*100));                   // Duty Cycle. Figure out the left and the right
                 //display.PutString(5,30,Pump1Buffer);
+                }
                 CANFloat2 = GetFloat4;
+                if (abs(CANFloat2*100 - *Pump2Buffer) >= 1) {
                 sprintf(Pump2Buffer,"%3.2d", int(CANFloat2*100));
                 //display.PutString(5,107,Pump2Buffer);
+                }
+                break;
             case SYS_DCDC_STATUS_ID:
                 CANFloat = GetFloat;
                 sprintf(DCDCBuffer,"%3.2d", int(CANFloat));             // How the heck are we interpreting this data
                 //display.PutString(7,30,DCDCBuffer);
+                break;
             case SYS_IMD_RESIST_ID:
                 CANFloat = GetFloat;
-                sprintf(IMDRBuffer,"%3.2d", int(CANFloat));             // How the heck are we interpreting this data
+                if (abs(CANFloat - *IMDRBuffer) >= 1) {
+                sprintf(IMDRBuffer,"%3.2d", int(CANFloat));
                 //display.PutString(7,107,IMDRBuffer);
+                }
+                break;
 
                 // CHARGER SCREEN *************************************************************
             case CHARGECURR_TX_ID:
                 CANFloat = GetFloat;
+                if (abs(CANFloat - *ChargeCurrBuffer) >= 0.1) {
                 sprintf(ChargeCurrBuffer,"%3.2d", int(CANFloat));                       // Amps
                 //display.PutString(3,94,ChargeCurrBuffer);
+                }
+                break;
+
                 // OTHER **********************************************************************
             case MODE_TX_ID:
                 CANFloat = GetFloat;
@@ -256,6 +337,7 @@
                 } else {
                     BLButtonRed;
                 }
+                break;
             default:
                 break;
         }
--- a/Steering.h	Sun Feb 08 02:47:05 2015 +0000
+++ b/Steering.h	Sun Feb 08 05:47:05 2015 +0000
@@ -26,8 +26,8 @@
 #define TRButtonRed     DigitalOut u1(P1_14,1);  DigitalOut u2(P1_9,0);
 
 float pi =                  3.14159;
-float WheelRadius =         5/6;              // In feet; same as 10 inches
-float WheelCircumference =  2*pi*WheelRadius; //In feet     
+float WheelRadius =         5.0/6.0;              // In feet; same as 10 inches
+float WheelCircumference =  2.0*pi*WheelRadius; //In feet     
 
 Serial pc(USBTX,USBRX);