Fixed multiple bugs and errors.

- Added WARNING handler
- put voltage calculations to dedicated module

fixed last errors. Updated menu repair screen without ERROR from PID 

This is version 0.9.0.3, which is used for the first duration test
Will also be tagged

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@272 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-11-15 15:40:39 +00:00
parent 17207a3a4b
commit 711f8e72be
46 changed files with 2572 additions and 454 deletions

View File

@@ -0,0 +1,108 @@
// -----------------------------------------------------------------------------
/// @file PIDParameters.c
/// @brief Description
// -----------------------------------------------------------------------------
// Micro-Key bv
// Industrieweg 28, 9804 TG Noordhorn
// Postbus 92, 9800 AB Zuidhorn
// The Netherlands
// Tel: +31 594 503020
// Fax: +31 594 505825
// Email: support@microkey.nl
// Web: www.microkey.nl
// -----------------------------------------------------------------------------
/// $Revision$
/// $Author$
/// $Date$
// (c) 2017 Micro-Key bv
// -----------------------------------------------------------------------------
/// @file PIDParameters.c
/// @ingroup {group_name}
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include "PIDParameters.h"
#include "PCBA.h"
#include "PID.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// File-scope variables
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function definitions
// -----------------------------------------------------------------------------
void PIDParameters_generateDefaultParameters(struct PIDParameters* self)
{
// Differ between positive and negative regulation
if (PCBA_getInstance()->pcba == PCBA_CathodeMCP)
{
// Negative regulation
self->iMin = -100000000;
self->iMax = 0;
}
else
{
// positive regulation
self->iMin = 0;
self->iMax = 100000000;
}
self->Kp = 3 * PID_FIXED_POINT_FACTOR / 10;
self->Ki = 2 * PID_FIXED_POINT_FACTOR / 10;
self->Kd = 0 * PID_FIXED_POINT_FACTOR / 10;
}
void PIDParameters_setKp(struct PIDParameters* self, int Kp)
{
self->Kp = Kp;
}
void PIDParameters_setKi(struct PIDParameters* self, int Ki)
{
self->Ki = Ki;
}
void PIDParameters_setKd(struct PIDParameters* self, int Kd)
{
self->Kd = Kd;
}
void PIDParameters_setiMin(struct PIDParameters* self, int iMin)
{
self->iMin = iMin;
}
void PIDParameters_setiMax(struct PIDParameters* self, int iMax)
{
self->iMax = iMax;
}