DIY Electric Car Forums banner
21 - 25 of 25 Posts

· Registered
Joined
·
4 Posts
Having become frustrated in finding a CAN calibrator to program my SEVCON Powerpak controllers I set about to write a PC program.

If you're interested all the details can be found here - http://www.davescomputerstuff.com/sevcon/sevcon.html, including screen shots and explanations of what I've been able to discover to date. The long and the short of it is that together with a suitable CAN to Serial interface it's a fully functioning calibrator able to diagnose and program any (I think) Powerpak or Micropak controller.

Hello Dave, how are you?

My name is Darci, I am from Brazil, and I'm getting crazy to change my Powerpak PP745 controller. I have been working for a long time with industrial CAN interfaces, and I know a few CAN programmers.

I have been reading the discussion forum, and for a long time ago, you had published (on your personal website) information about CAN dictionary to SEVCON Powerpak.
Do you still have this information? Could you please share with us?

Thanks!
 

· Registered
Joined
·
5 Posts
I have put together an Arduino sketch that lets me talk to the controller, and have some responses from sending data to it as the calibrator but not yet have I figured out what they mean...



I send a down command, and get the following
Code:
408 1 252
4D6 8 32 32 32 32 32 32 32 32
4F8 8 49 46 49 32 84 114 97 99
4F9 8 116 105 111 110 32 32 32 32
4FA 8 80 101 114 115 111 110 97 108
4FB 8 105 116 105 101 115 32 32 32
4D6 8 105 116 105 101 115 32 32 32
4F8 8 49 46 49 46 49 65 32 84
4F9 8 114 97 99 32 80 101 114 115
4FA 8 73 46 32 77 97 120 46 32
4FB 8 32 32 32 32 52 48 48 65
4D6 8 32 32 32 32 52 48 48 65
C:
#include <SPI.h>
#include <mcp2515.h>

struct can_frame canMsg;
struct can_frame canMsg1;
MCP2515 mcp2515(10);

byte filterList[] = {0x429, 0x428, 0x420, 0x423, 0x478, 0x400, 0x42E, 0xAA, 0xFE};
int filterSize = 9;

int incomingByte = 0;


void setup() {
  canMsg1.can_id  = 0x4fc;
  canMsg1.can_dlc = 2;
  canMsg1.data[0] = 0x08;
  canMsg1.data[1] = 0xff;

  Serial.begin(115200);
 
  mcp2515.reset();
  mcp2515.setBitrate(CAN_100KBPS, MCP_8MHZ);
  mcp2515.setNormalMode();
 
  Serial.println("------- CAN Calibrator ----------");

  //delay(1000);
  //mcp2515.sendMessage(&canMsg1);
  //Serial.println("Messages sent");
  delay(100);
}

void loop() {
  if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) {

    if(canMsg.can_id == 0x471){
      mcp2515.sendMessage(&canMsg1);
      Serial.print("SENT");
      
    }
    if(filter(canMsg.can_id)){
    Serial.print(canMsg.can_id, HEX); // print ID
    Serial.print(" ");
    Serial.print(canMsg.can_dlc, HEX); // print DLC
    Serial.print(" ");

    
    for (int i = 0; i<canMsg.can_dlc; i++)  {  // print the data
      Serial.print(canMsg.data[i],DEC);
      Serial.print(" ");
    }
    Serial.println();
    }

          
  }

  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();
    Serial.println(incomingByte);
    switch (incomingByte) {
        case 49:
          Serial.println("up");
          canMsg1.data[1] = 0x80;
          break;
        case 50:
          Serial.println("down");
          canMsg1.data[1] = 0x40;
          break;
        case 51:
          Serial.println("left");
          canMsg1.data[1] = 0x20;
          break;
        case 52:
          Serial.println("right");
          canMsg1.data[1] = 0x10;
          break;
        case 53:
          Serial.println("Home");
          canMsg1.data[1] = 0xff;
          break;
      }
      mcp2515.sendMessage(&canMsg1);
  }
}


boolean filter(byte check)
{
  for (int x = 0; x < filterSize; x++)
  {
    if (filterList[x] == check)
    {
      return false;
    }   
  }
  return true;
}
 

· Registered
Joined
·
5 Posts
Some more digging and a russian forum had some more key info, "the data of messages 4F8h and 4F9h make up the first line, the data from 4FAh and 4FBh make up the second"

From that I can write some more code to hopefully get a working calibrator using arduino.


4F8 8 31 2E 31 20 54 72 61 63
4F9 8 74 69 6F 6E 20 20 20 20
4FA 8 50 65 72 73 6F 6E 61 6C
4FB 8 69 74 69 65 73 20 20 20


Becomes
1.1 Traction Personalities
 
21 - 25 of 25 Posts
Top