1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2025-09-04 01:05:56 +02:00
This commit is contained in:
Geoffrey Frogeye 2018-05-10 10:09:44 +02:00
parent 9802230d13
commit d30f0ed548
7 changed files with 36 additions and 27 deletions

View file

@ -11,7 +11,7 @@
#define FPGA_PORTNAME "/dev/ttyUSB0"
#define CF_BAUDRATE B115200
// #define PRINTRAWDATA
//
typedef void (*rxHandler)(void);
void registerRxHandlerCF(unsigned char code, rxHandler handler); // À utiliser après configureCF();

View file

@ -97,7 +97,7 @@ bool diagJustRun(void* arg)
{
void (*fonction)(void) = arg;
fonction();
usleep(1000*1000);
usleep(300*1000);
return true;
}
@ -160,8 +160,8 @@ void runDiagnostics()
i = 3;
execDiagnostic("Mot+Cod R AR", diagCodeuse, &i);
execDiagnostic("Fermeture loquet", diagJustRun, &diagSetLoquetFerme);
execDiagnostic("Ouverture loquet", diagJustRun, &diagSetLoquetOuvert);
execDiagnostic("Fermeture loquet", diagJustRun, &diagSetLoquetFerme);
execDiagnostic("Reset barillet", diagJustRun, &barilletReset);
execDiagnostic("T+1 barillet", diagJustRun, &barilletSuivant);
execDiagnostic("T+2 barillet", diagJustRun, &barilletSkip);

View file

@ -10,7 +10,7 @@
#define DIAGNOSTIC_TENSION_TEST 3
#define DIAGNOSTIC_CODEUSES_DIFF_MIN 100
#define DIAGNOSTIC_TEMPS_ROTATION 250
#define DIAGNOSTIC_TEMPS_ROTATION 500
typedef bool (*diagnosticFunc)(void* arg);

View file

@ -21,7 +21,7 @@
#define MOTOR_CONTROLLER_ALIMENTATION 24.0 // V (from elec)
#define MOTOR_CONTROLLER_REFERENCE 5 // V (from wiring)
#define MOTOR_SATURATION_MIN 0 // V (from random)
#define MOTOR_SATURATION_MAX 12.0 // V (from testing)
#define MOTOR_SATURATION_MAX 3.0 // V (from testing)
#define PWM_MAX 3.3 // V (from FPGA datasheet)
#define CODER_RESOLUTION 370.0 // cycles/motor rev
#define CODER_DATA_FACTOR 4.0 // increments/motor cycles
@ -38,8 +38,8 @@
#define O_DIR_ECART_MIN (5.0 / 360.0 * 2.0 * M_PI) // rad
#define O_DIR_ECART_MAX (25.0 / 360.0 * 2.0 * M_PI) // rad
#define O_ECART_MAX (25.0 / 360.0 * 2.0 * M_PI) // rad
#define O_GAIN 3.0
#define P 7.0
#define O_GAIN 5.0
#define P 5.0
#define I 0.0
#define D 0.0

View file

@ -21,6 +21,19 @@ void initLCD()
pinMode(LCD_ON_PIN, OUTPUT);
}
void eraseLCD()
{
lockLCD();
sendLCD(0x01, LCD_MODE_CMD);
sendLCD(0x02, LCD_MODE_CMD);
for (int i = 0; i < LCD_NB_TOTAL; i++) {
virtual[i] = ' ';
}
unlockLCD();
}
void onLCD()
{
digitalWrite(LCD_ON_PIN, LOW);
@ -32,7 +45,7 @@ void onLCD()
sendLCD(0x06, LCD_MODE_CMD); // Cursor move direction
sendLCD(0x0C, LCD_MODE_CMD); // Blink Off
sendLCD(0x28, LCD_MODE_CMD); // Data length, number of lines, font size
clearLCD();
eraseLCD();
delay(50);
}
@ -57,14 +70,8 @@ void resetLCD()
void clearLCD()
{
lockLCD();
sendLCD(0x01, LCD_MODE_CMD);
sendLCD(0x02, LCD_MODE_CMD);
for (int i = 0; i < LCD_NB_TOTAL; i++) {
virtual[i] = ' ';
}
unlockLCD();
offLCD();
onLCD();
}
void gotoLCD(uint8_t line)