Prius IPM controller

Dependencies:   mbed

Fork of analoghalls5_5 by N K

main.cpp

Committer:
nki
Date:
2015-03-16
Revision:
33:e7b132029bae
Parent:
32:4e1a223fad52
Child:
34:bfe180de813a

File content as of revision 33:e7b132029bae:

#include "includes.h"
#include "transforms.h"
#include "filters.h"
#include "context.h"
#include "core.h"
#include "meta.h"
#include "sensors.h"
#include "callbacks.h"

int main() { 
    Context *context = new Context();
    context->ConfigureOutputs(D6, D13, D3, D8);
    context->ConfigureCurrentSensors(A1, A2, 0.01f, 0.7f);
    context->ConfigureIdPidController(0.01f, 0.8f, 0.0f, 2.0f, -2.0f);
    context->ConfigureIqPidController(0.01f, 0.8f, 0.0f, 2.0f, -2.0f);
    context->ConfigureThrottle(A0, 0.8f, 3.0f);
    context->ConfigurePositionSensor(A4, A5, 0.249f, 0.497f, 0.231f, 0.499f, 205.0f);
    context->ConfigureReference(5.0f);
    context->ConfigureDebugger(2, 1000);
    context->AttachCallBack(&fast, 5000);
    context->AttachCallBack(&slow, 10);
    context->AttachCallBack(&debug, 10);
    context->AttachCallBack(&log, 500);
    context->Start();
}