Skip to content

Commit 8c61cad

Browse files
committed
VW e-Up: added acceleration support
1 parent d8028d5 commit 8c61cad

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

vehicle/OVMS.V3/changes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Open Vehicle Monitor System v3 - Change log
22

33
????-??-?? ??? ??????? OTA release
4+
- VW e-Up: added acceleration support; OBD by reading from ECU,
5+
T26 deriving from speed changes
46

57
2021-09-29 MB 3.2.017 OTA release
68
- Added VEHICLE_POLL_TYPE_ROUTINECONTROL to UDS (ISO 14229) service identifiers list

vehicle/OVMS.V3/components/vehicle_vweup/src/vehicle_vweup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <string>
3030
static const char *TAG = "v-vweup";
3131

32-
#define VERSION "0.20.2"
32+
#define VERSION "0.21.1"
3333

3434
#include <stdio.h>
3535
#include <string>

vehicle/OVMS.V3/components/vehicle_vweup/src/vweup_obd.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ void OvmsVehicleVWeUp::OBDInit()
266266
// Add high priority PIDs:
267267
m_poll_vector.insert(m_poll_vector.end(), {
268268
{VWUP_MOT_ELEC, UDS_READ, VWUP_MOT_ELEC_POWER_MOT, { 0, 0, 0, 1}, 1, ISOTP_STD},
269+
{VWUP_MOT_ELEC, UDS_READ, VWUP_MOT_ELEC_ACCEL, { 0, 0, 0, 1}, 1, ISOTP_STD},
269270
});
270271

271272
// Add model year specific AC charger PIDs:
@@ -1154,6 +1155,13 @@ void OvmsVehicleVWeUp::IncomingPollReply(canbus *bus, uint16_t type, uint16_t pi
11541155
VALUE_LOG(TAG, "VWUP_MOT_ELEC_POWER_MOT=%f => %f", value, StdMetrics.ms_v_inv_power->AsFloat());
11551156
}
11561157
break;
1158+
case VWUP_MOT_ELEC_ACCEL:
1159+
if (PollReply.FromInt16("VWUP_MOT_ELEC_ACCEL", value)) {
1160+
float accel = value / 1000;
1161+
StdMetrics.ms_v_pos_acceleration->SetValue(accel);
1162+
VALUE_LOG(TAG, "VWUP_MOT_ELEC_ACCEL=%f => %f", value, accel);
1163+
}
1164+
break;
11571165

11581166
case VWUP_MOT_ELEC_STATE:
11591167
if (PollReply.FromUint8("VWUP_MOT_ELEC_STATE", ivalue) && ivalue != 255) {

vehicle/OVMS.V3/components/vehicle_vweup/src/vweup_obd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ using namespace std;
112112
#define VWUP_MOT_ELEC_VIN 0xF802 // Vehicle Identification Number
113113
#define VWUP_MOT_ELEC_SPEED 0xF40D // Speed [kph]
114114
#define VWUP_MOT_ELEC_POWER_MOT 0x147E // Inverter output / motor input power level [kW]
115+
#define VWUP_MOT_ELEC_ACCEL 0x12B0 // Acceleration/deceleration [m/s²]
115116

116117
#define VWUP_BRK_TPMS 0x1821
117118

vehicle/OVMS.V3/components/vehicle_vweup/src/vweup_t26.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ void OvmsVehicleVWeUp::IncomingFrameCan3(CAN_frame_t *p_frame)
394394

395395
case 0x320: // Speed
396396
StandardMetrics.ms_v_pos_speed->SetValue(((d[4] << 8) + d[3] - 1) / 190);
397+
CalculateAcceleration(); // only necessary until we find acceleration on T26
397398
break;
398399

399400
case 0x527: // Outdoor temperature

0 commit comments

Comments
 (0)