aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c5
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c38
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c34
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/buttons.c69
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/buttons.h45
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c8
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c18
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c13
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c4
11 files changed, 149 insertions, 88 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index eb4d0a49a..4f78d2134 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -83,6 +83,8 @@ bool watchdogCriticalAlarm = false;
uint32_t msec_millisecondCounter = 0;
+extern bool Machine_Idle_Mode;
+
MillisecMotorDataStruc ScrewSetMaxSpeedPending = {0};
MillisecMotorDataStruc ScrewMovePending = {0};
MillisecMotorDataStruc MotorData[NUM_OF_MOTORS] = {0};
@@ -420,6 +422,7 @@ uint32_t MillisecLoop(uint32_t tick)
Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER);
Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER);
Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER);
+
return OK;
}
uint32_t MillisecLowLoop(uint32_t tick)
@@ -445,6 +448,8 @@ uint32_t MillisecLowLoop(uint32_t tick)
//Speed_Data = Calculate_Speed_Sensor_Velocity();
//MillisecReadFromTempSensor(Sensor_Read, NULL);
//if (Sensor_Read++ >= MAX_TEMPERATURE_SENSOR_ID) Sensor_Read = 0;
+ if(Machine_Idle_Mode == true)
+ Machine_Idle_Breathing_Led();
}
if (Hundred_msTick)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 8349e7f91..100fefbd8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -51,6 +51,7 @@
#include <inc/hw_ints.h>
#include "drivers/adc_sampling/adc.h"
+#include "Modules/General/buttons.h"
#include "control.h"
#include "MillisecTask.h"
@@ -157,10 +158,20 @@ void ControlStop(void)
uint32_t ControlActivityLed( uint32_t Parameter1)
{
static bool flag = false;
+ static uint8_t counter;
+ const uint8_t Blink_Freq = 15;//odd number
+
if (flag==true)
{
COMM_RED_LED_ON;
ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF
+ if(power.color == fastBILNK)
+ Pannel_Leds(POWER_ON_OFF,MODE_OFF);
+
+ if((power.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(POWER_ON_OFF,MODE_OFF);
+ }
flag = false;
}
else
@@ -168,8 +179,22 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
COMM_RED_LED_OFF;
if (HeaterActive > 0)// Blink the led on heating
ACTIVITY_RED_LED_ON;// Heaters indication - at least one of the Heaters is ON
+
+ if(power.color == fastBILNK)
+ Pannel_Leds(POWER_ON_OFF,MODE_ON);
+
+ if((power.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(POWER_ON_OFF,MODE_ON);
+ }
+
flag = true;
}
+
+ if (counter < 0xFF)
+ counter++;
+ else
+ counter = Blink_Freq + 1;
return OK;
}
uint32_t ControlEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)
@@ -208,8 +233,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
uint32_t device_i;
uint32_t deviceId = 0xFF;
- if (CtrlFrequency == eOneMillisecond)
- {
+ //if (CtrlFrequency == eOneMillisecond)
+ //{
for(device_i = 0;device_i < MAX_TANGO_CONTROL_DEVICES;device_i++)
{
if (ControlArray[device_i].ControlActive == false)
@@ -218,8 +243,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
break;
}
}
- if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices))
- MaxHighDevices = deviceId;
+ /* if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices))
+ // MaxHighDevices = deviceId;
}
else
{
@@ -231,7 +256,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
break;
}
}
- }
+ }*/
if (deviceId == 0xFF)
{
@@ -348,7 +373,8 @@ uint32_t ControlLoop(uint32_t tick)
Tick998 = (tick%eOneSecond == 996) ?true:false;
*/
//ROM_IntMasterDisable();
- for (ControlDevice_i = 0; ControlDevice_i < MaxHighDevices;ControlDevice_i++)
+ //for (ControlDevice_i = 0; ControlDevice_i < MaxHighDevices;ControlDevice_i++)
+ for (ControlDevice_i = 0; ControlDevice_i < MAX_TANGO_CONTROL_DEVICES;ControlDevice_i++)
{
if (ControlArray[ControlDevice_i].ControlActive)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c
index 2011444e2..ae362d189 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c
@@ -58,7 +58,7 @@ uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer)
{
Turn_the_Blower_On();
intvoltage = voltage;
- Control_Voltage_To_Blower(intvoltage);
+ Cancel_Gradual_Increase_Blower(intvoltage);
}
break;
default:
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
index b00db94eb..f93bf8f60 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
@@ -99,7 +99,7 @@ DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS];
HeaterState **heatersstates;
HeaterState HeaterInfo[HEATER_TYPE__MixerHeater+1];
DigitalInterfaceState **digitalinterfacestates;
-DigitalInterfaceState DigitalOutputState[MAX_HEATERS_NUM];
+DigitalInterfaceState DigitalOutputState[MAX_HEATERS_NUM/*+1*/];
/*double dispenser1motorfrequency[DIAGNOSTICS_LIMIT];
double dispenser2motorfrequency[DIAGNOSTICS_LIMIT];
double dispenser3motorfrequency[DIAGNOSTICS_LIMIT];
@@ -237,6 +237,9 @@ void DiagnosticsLoadDigitalValues(void)
DigitalOutputState[9].interfaceio = INTERFACE_IOS__GPO_MIXCHIP_SSR4_CTRL;
DigitalOutputState[9].value = GetHeaterState(9);
+ //DigitalOutputState[9].interfaceio = INTERFACE_IOS__GPO_SPARE_SSR13_CTRL;
+ //DigitalOutputState[9].value = GetHeaterState(9);
+
}
void DiagnosticLoadTemperature(int HeaterId, int temperature)
{
@@ -315,30 +318,15 @@ void Diagnostic100msecCollection(void)
return;
DiagnosticLoadSpeedSensor(getSensorSpeedData());
-// dancer1angle[DiagnosticsIndex] = Control_Read_Dancer_Position(WINDER_DANCER, 0,0);
-// dancer2angle[DiagnosticsIndex] = Control_Read_Dancer_Position(POOLER_DANCER, 0,0);
-// dancer3angle[DiagnosticsIndex] = Control_Read_Dancer_Position(FEEDER_DANCER, 0,0);
//if (JobIsActive())
{
-/* DiagnosticLoadMotor(FEEDER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING)); ThreadGetMotorSpeed
- DiagnosticLoadMotor(DRYER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING));
- DiagnosticLoadMotor(POOLER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDRIVING));
- DiagnosticLoadMotor(WINDER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_WINDER));
- DiagnosticLoadMotor(SCREW_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW));*/
DiagnosticLoadMotor(FEEDER_MOTOR, ThreadGetMotorSpeed (FEEDER_MOTOR));
DiagnosticLoadMotor(DRYER_MOTOR, ThreadGetMotorSpeed (DRYER_MOTOR));
DiagnosticLoadMotor(POOLER_MOTOR, ThreadGetMotorSpeed (POOLER_MOTOR));
DiagnosticLoadMotor(WINDER_MOTOR, ThreadGetMotorSpeed (WINDER_MOTOR));
DiagnosticLoadMotor(SCREW_MOTOR, ThreadGetMotorSpeed (SCREW_MOTOR));
}
-/*
- feedermotorfrequency[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING);
- dryermotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING);
- pollermotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDRIVING);
- windermotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_WINDER);
- screwmotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW);
-*/
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__MixerHeater, TemperatureSensorRead( TEMP_SENSE_ANALOG_MIXCHIP_TEMP));
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1, TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP1));
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2, TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP2));
@@ -350,21 +338,9 @@ void Diagnostic100msecCollection(void)
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP1));
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP2));
DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP3));
- /*
- mixertemperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_AN_ENCLOSURETEMP3)/100;
- headzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP1)/100;
- headzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP2)/100;
- headzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP3)/100;
- headzone4temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP4)/100;
- headzone5temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP5)/100;
- headzone6temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_MIXCHIP_TEMP)/100;
- dryerzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP1)/100;
- dryerzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP2)/100;
- dryerzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP3)/100;
-*/
for (i=0;i<MAX_SYSTEM_DISPENSERS;i++)
{
- dispensermotorfrequency[i][DiagnosticsIndex] = MotorGetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1+i);
+ dispensermotorfrequency[i][DiagnosticsIndex] = IdsGetMotorSpeed(i);
dispenserspressure[i][DiagnosticsIndex] = GetDispenserPressure(i); //Read_MidTank_Pressure_Sensor
MidTankpressure[i][0] = Get_MidTank_Pressure_Sensor(i);
}
diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c
index 68199d19f..f80727dfc 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c
@@ -10,8 +10,9 @@
#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"//#include "FPGA_GPIO.h" // use for FPGA IO
#include "DataDef.h" // use for FPGA IO
#include "Modules/Control/control.h" // use for FPGA IO
-
+#include "Modules/General/buttons.h"
#include "StateMachines/Printing/PrintingSTM.h"
+#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
#include <stdlib.h>
#include <stdint.h>
@@ -26,15 +27,8 @@ int ch_to_power_down();
int ch_to_power_up();
int thredJog();
-typedef enum
-{
- colorOFF = 0,
- BLUE,
- BLINK,
- fastBILNK,
- BREATHING
-} PBcolor;
+/*
typedef enum
{
OFFPB = 0,
@@ -43,7 +37,7 @@ typedef enum
LONGPB ,
REPLONGPB //repeat long PB
}PBstat;
-
+*/
typedef enum
{
MSEC = 0,
@@ -53,47 +47,26 @@ typedef enum
MORE5000
}timems;
-typedef enum
-{
- sttOFF = 0,
- sttON,
- sttDISABLE,
- sttENABLE,
- sttIDLE,
- sttJOGGING,
- sttRDY,
- sttPRELOAD,
- sttLOADING,
- sttLOADSUCSESS,
- sttLOADFAIL
-} PBmachinState;
+
//enum PBstat OnOffPBstate = OFFPB;
//enum PBstat ret
//enum PBstat threadPB = OFFPB;
-struct button
-{
- char bttn_name[10]; //option
- int bttn_status; // 0=release 1=press
- /* enum */ PBstat Action; //offPB,shortPB,longPB,countPB,replongPB
- /* enum */ PBcolor color; //off, blue, blink, bithing
- /* enum */ PBmachinState state; //sttOFF, sttON, sttDISABLE, sttENABLE, sttIDLE, sttJOGGING
- uint32_t count;
-};
-struct button power , jog, load;
+
+button power , jog, load;
uint32_t ButtonsCallBackFunction(uint32_t IfIndex, uint32_t ReadValue);
uint32_t ButtonsCBFunction(uint32_t IfIndex, uint32_t ReadValue);
-uint32_t ShortLongOffPB(uint8_t OnOffPB, struct button *pBtn);
-uint32_t StateMachine(struct button *pBtn);
+uint32_t ShortLongOffPB(uint8_t OnOffPB, button *pBtn);
+uint32_t StateMachine( button *pBtn);
uint32_t ButtonJogCallBackFunction(uint32_t IfIndex, uint32_t ReadValue);
uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue);
uint8_t thraedJogging(uint8_t off);
-uint32_t setJoggingEnableCondition(struct button *pBtn);
-uint32_t joggingMachine(uint8_t OnOffPB, struct button *pBtn);
+uint32_t setJoggingEnableCondition( button *pBtn);
+uint32_t joggingMachine(uint8_t OnOffPB, button *pBtn);
uint32_t ButtonLoadCallBackFunction(uint32_t IfIndex, uint32_t ReadValue);
@@ -251,7 +224,7 @@ int StopTimer()
//ShortLongOffPB( OnOffPB, &ret)
-uint32_t ShortLongOffPB(uint8_t OnOffPB, struct button *pBtn)
+uint32_t ShortLongOffPB(uint8_t OnOffPB, button *pBtn)
{
uint8_t parameter = 0 ; // why we need it!!!!
@@ -333,7 +306,7 @@ uint32_t ShortLongOffPB(uint8_t OnOffPB, struct button *pBtn)
-uint32_t StateMachine(struct button *pBtn) //short press(=0)/long press(=1)
+uint32_t StateMachine( button *pBtn) //short press(=0)/long press(=1)
{
uint8_t parameter = 1;
@@ -373,10 +346,12 @@ uint32_t StateMachine(struct button *pBtn) //short press(=0)/long press(=1)
{
case LONGPB: //Power off from idle
pBtn->state = sttOFF; // todo
+ Pannel_Leds(POWER_ON_OFF,MODE_OFF); //AVI+ - TODO option MODE_ON to stop Breathing and the led will turn off in power down
REPORT_MSG(parameter,"Power state is OFF ");
break;
case SHORTPB: //Wake up from idle
pBtn->state = sttON;// to do ?
+ Pannel_Leds(POWER_ON_OFF,MODE_ON); //AVI+
REPORT_MSG(parameter,"Power state is ON ");
break;
default:
@@ -406,7 +381,7 @@ return 0;
-uint32_t setJoggingEnableCondition(struct button *pBtn)
+uint32_t setJoggingEnableCondition( button *pBtn)
{
if (0
// 1.
@@ -443,12 +418,13 @@ return 0;
*/
-uint32_t joggingMachine(uint8_t OnOffPB, struct button *pBtn)
+uint32_t joggingMachine(uint8_t OnOffPB, button *pBtn)
{
if (sttDISABLE == pBtn->state)
{
// jogging is disable
pBtn->color = colorOFF;
+ Pannel_Leds(THREAD_JOGGING,MODE_OFF);//AVI+
}
else
{
@@ -456,6 +432,7 @@ uint32_t joggingMachine(uint8_t OnOffPB, struct button *pBtn)
{
ThreadAbortJoggingFunc(); // to do!!!!
pBtn->color = BLUE;
+ Pannel_Leds(THREAD_JOGGING,MODE_ON);//AVI+
}
else
{
@@ -534,5 +511,13 @@ ShortLongOffPB( threadPB, ret,struct button *pBtn);
}
*/
+void test_avi()
+{
+
+ power.color = BLINK;
+ //power.color = fastBILNK
+ //Machine_Idle_Mode = true;
+
+}
diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.h b/Software/Embedded_SW/Embedded/Modules/General/buttons.h
index 897fb6031..e7a611e9b 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/buttons.h
+++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.h
@@ -1,6 +1,51 @@
#ifndef BUTTONS_H
#define BUTTONS_H
+typedef enum
+{
+ colorOFF = 0,
+ BLUE,
+ BLINK,
+ fastBILNK,
+ BREATHING
+} PBcolor;
+
+typedef enum
+{
+ OFFPB = 0,
+ COUNTPB ,
+ SHORTPB ,
+ LONGPB ,
+ REPLONGPB //repeat long PB
+}PBstat;
+
+typedef enum
+{
+ sttOFF = 0,
+ sttON,
+ sttDISABLE,
+ sttENABLE,
+ sttIDLE,
+ sttJOGGING,
+ sttRDY,
+ sttPRELOAD,
+ sttLOADING,
+ sttLOADSUCSESS,
+ sttLOADFAIL
+} PBmachinState;
+
+typedef struct
+{
+ char bttn_name[10]; //option
+ int bttn_status; // 0=release 1=press
+ /* enum */ PBstat Action; //offPB,shortPB,longPB,countPB,replongPB
+ /* enum */ PBcolor color; //off, blue, blink, bithing
+ /* enum */ PBmachinState state; //sttOFF, sttON, sttDISABLE, sttENABLE, sttIDLE, sttJOGGING
+ uint32_t count;
+}button;
+
+extern button power , jog, load;
+
uint32_t Buttons_Init(void);
uint32_t Button_load_Init(void);
uint32_t Button_JOG_Init(void);
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
index d6f661789..aa9e4df4a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
@@ -453,9 +453,9 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue)
{
Turn_the_Blower_On();//Turn on with the Default_Voltage
if (BlowerCfg.heatingvoltage)
- Control_Voltage_To_Blower(BlowerCfg.heatingvoltage);
+ Cancel_Gradual_Increase_Blower(BlowerCfg.heatingvoltage);
else
- Control_Voltage_To_Blower(BlowerCfg.voltage-500);
+ Cancel_Gradual_Increase_Blower(BlowerCfg.voltage-500);
}
if (SetTemperatue)
@@ -717,8 +717,8 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue)
{
Turn_the_Blower_On();//Turn on with the Default_Voltage
if (BlowerCfg.voltage)
- Control_Voltage_To_Blower(BlowerCfg.voltage);
-
+ Gradual_Increase_Blower(BlowerCfg.heatingvoltage,BlowerCfg.voltage);
+ //Control_Voltage_To_Blower(BlowerCfg.voltage);
}
}
return OK;
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
index 579c503bf..e748ea631 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c
@@ -33,6 +33,7 @@ double DispenserPreparePressure = DISPENSER_BUILD_PRESSURE_LIMIT;
uint32_t DispenserPrepareTimeout = DISPENSER_BUILD_PRESSURE_TIMEOUT;
uint32_t DispenserPrepareTimeLag = DISPENSER_BUILD_PRESSURE_LAG;
uint32_t DispenserPrepareTime[MAX_SYSTEM_DISPENSERS] = {0,0,0,0,0,0,0,0};
+uint32_t CurrentDispenserSpeed[MAX_SYSTEM_DISPENSERS] = {0, 0, 0, 0, 0, 0, 0, 0,};
callback_fptr DispenserCallback[MAX_SYSTEM_DISPENSERS] = {0, 0, 0, 0, 0, 0, 0, 0,};
uint32_t DispenserControlId[MAX_SYSTEM_DISPENSERS] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
@@ -49,6 +50,13 @@ void IDS_Dispenser_SetTimeOutValues(uint32_t CloseTimeout, uint32_t OpenTimeout)
CloseValveTimeout = CloseTimeout;
OpenValveTimeout = OpenTimeout;
}
+
+//********************************************************************************************************************
+uint32_t IdsGetMotorSpeed(uint32_t DispenserId)
+{
+ return CurrentDispenserSpeed[DispenserId];
+}
+
uint32_t IDS_Dispenser_EmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)
{
return OK;
@@ -79,6 +87,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
TimerMotors_t HW_Motor_Id = DispenserIdToMotorId[DispenserId];
MotorStop(HW_Motor_Id,Hard_Hiz);
+ CurrentDispenserSpeed[DispenserId] = 0;
if (DispenserCallback[DispenserId])
{
@@ -107,6 +116,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
DispenserPrepareTime[DispenserId]=0;
TimerMotors_t HW_Motor_Id = DispenserIdToMotorId[DispenserId];
MotorSetSpeed(HW_Motor_Id, DispenserPrepareSpeed);
+ CurrentDispenserSpeed[DispenserId] = DispenserPrepareSpeed;
}
return OK;
@@ -114,6 +124,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
uint32_t IDS_Dispenser_StopMotorCallback(uint32_t DispenserId, uint32_t ReadValue)
{
+ Report("IDS_Dispenser_Close_Valve_And_Stop_Motor callback",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)msec_millisecondCounter,0);
if (RemoveControlCallback(DispenserControlId[DispenserId], IDS_Dispenser_StopMotorCallback )==OK)
{
Report("Remove control callback",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)DispenserControlId[DispenserId],0);
@@ -135,6 +146,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
TimerMotors_t HW_Motor_Id = DispenserIdToMotorId[DispenserId];
MotorStop(HW_Motor_Id,Hard_Hiz);
+ CurrentDispenserSpeed[DispenserId] = 0;
if (DispenserCallback[DispenserId])
{
@@ -147,8 +159,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
uint32_t IDS_Dispenser_Close_Valve_And_Stop_Motor(int DispenserId, callback_fptr callback)
{
DispenserCallback[DispenserId] = callback;
-
- Report("Control3WayValvesWithCallback called ",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)0,0);
+ Report("IDS_Dispenser_Close_Valve_And_Stop_Motor",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)msec_millisecondCounter,0);
Control3WayValvesWithCallback ((Valves_t)DispenserId, CloseValve, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer
if (DispenserControlId[DispenserId] != 0xFF)
@@ -165,6 +176,7 @@ uint32_t IDS_Dispenser_Build_Pressure_Callback(uint32_t DispenserId, uint32_t Re
uint32_t IDS_Dispenser_OpenValveCallback(uint32_t DispenserId, uint32_t ReadValue)
{
+ Report("IDS_Dispenser_Start_Motor_and_Open_Valve Callback",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)msec_millisecondCounter,0);
if (RemoveControlCallback(DispenserControlId[DispenserId], IDS_Dispenser_OpenValveCallback )==OK)
{
@@ -199,8 +211,10 @@ uint32_t IDS_Dispenser_Start_Motor_and_Open_Valve(int DispenserId, int MotorSpee
TimerMotors_t HW_Motor_Id = DispenserIdToMotorId[DispenserId];
MotorSetSpeed(HW_Motor_Id, MotorSpeed);
+ CurrentDispenserSpeed[DispenserId] = MotorSpeed;
if (DispenserControlId[DispenserId] != 0xFF)
Report("Cannot Add control callback",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)DispenserControlId[DispenserId],0);
+ Report("IDS_Dispenser_Start_Motor_and_Open_Valve",__FILE__,__LINE__,(int)DispenserId,RpWarning,(int)msec_millisecondCounter,0);
DispenserControlId[DispenserId] = AddControlCallback( IDS_Dispenser_OpenValveCallback, OpenValveTimeout, IDS_Dispenser_EmptyCBFunction,DispenserId, DispenserId, 0 );
if (DispenserControlId[DispenserId] == 0xFF)
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
index 7d8a204ac..8f58bac3e 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h
@@ -61,5 +61,6 @@ void IDS_Dispenser_Content_Calculation (char DispenserId);
float CalculateDispenserPressure (int DispenserId);
float GetDispenserPressure(int DispenserId);
+uint32_t IdsGetMotorSpeed(uint32_t DispenserId);
#endif /* MODULES_IDS_IDS_EX_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index 119624e3d..5ee8a150d 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -319,6 +319,15 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId)
DispenserPreSegmentReady[DispenserId] = false;
REPORT_MSG(DispenserId,"IDS_Valve_Presegment start");
IDS_Dispenser_Set_Flow_Params(DispenserId,0,0);
+ if (JobTicket->segments[DispenserId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision != DISPENSER_STEP_DIVISION__Auto)
+ {
+ MotorSetMicroStep(HW_Motor_Id, JobTicket->segments[DispenserId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision);
+ }
+ else
+ {
+ MotorSetMicroStep(HW_Motor_Id, MotorsCfg[HW_Motor_Id].microstep);
+ }
+
if (JobTicket->segments[SegmentId]->brushstops[0]->dispensers[Dispenser_i]->nanolitterpersecond==0)
{
//MotorStop(HW_Motor_Id,Hard_Hiz);
@@ -397,14 +406,14 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId)
JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->nanoliterperpulse;
if (JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision != DISPENSER_STEP_DIVISION__Auto)
{
- MotorSetMicroStep(HW_Motor_Id, JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision);
+ //MotorSetMicroStep(HW_Motor_Id, JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision);
segmentfirst_speed/=JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision; //the dye supply is calculated based on a 1/8 microstep
IDS_Dispenser_Set_Flow_Params ( DispenserId, JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->nanoliterperpulse
, JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision);
}
else
{
- segmentfirst_speed/=MotorsCfg[HW_Motor_Id].microstep; //the dye supply is calculated based on a 1/8 microstep
+ //segmentfirst_speed/=MotorsCfg[HW_Motor_Id].microstep; //the dye supply is calculated based on a 1/8 microstep
IDS_Dispenser_Set_Flow_Params ( DispenserId, JobTicket->segments[CurrentSegment]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->nanoliterperpulse
,MotorsCfg[HW_Motor_Id].microstep);
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 58ade0802..e2f97d970 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -129,9 +129,9 @@
{
Turn_the_Blower_On();//Turn on with the Default_Voltage
if (BlowerCfg.heatingvoltage)
- Control_Voltage_To_Blower(BlowerCfg.heatingvoltage);
+ Cancel_Gradual_Increase_Blower(BlowerCfg.heatingvoltage);
else
- Control_Voltage_To_Blower(BlowerCfg.voltage-500);
+ Cancel_Gradual_Increase_Blower(BlowerCfg.voltage-500);
Control_Dryer_Fan(STOP,75);//use START or STOP, 0 - 100%
LoadStages++;
ThreadLoadStateMachine(LoadStages);