Add initial feed

The MCU board now lets the printer pull in the carrier until the new
paper in sensor is triggered for the first time and then starts the
print like before. The new "initial feed" provides an alignment of the
carrier which is exactly the same every time. Of course, the carrier now
needs two markings.
This commit is contained in:
fruchti 2015-10-04 11:51:38 +02:00
parent 8ac4d886e5
commit 2f9c8f51c7
4 changed files with 103 additions and 67 deletions

View file

@ -84,10 +84,21 @@ int main(void)
// blocked by carrier
if(HallSensorTimer < T_HALL_L && !(I_NPPINS & (1 << P_NPPINS)))
{
// Block carrier
O_CLUTCH |= (1 << P_CLUTCH);
// Unblock carrier
O_CLUTCH &= ~(1 << P_CLUTCH);
O_LED_GN |= (1 << P_LED_GN);
O_LED_RD &= ~(1 << P_LED_RD);
State = AlignFeed;
}
break;
case AlignFeed:
// Check if carrier has moved to the first marked position
if(I_NPPINS & (1 << P_NPPINS))
{
// Block carrier
O_CLUTCH |= (1 << P_CLUTCH);
State = ClutchDelay;
MillisecondCounter = 0;
}
@ -101,6 +112,15 @@ int main(void)
// Enable manual paper feed sensor
O_MNPFSO &= ~(1 << P_MNPFSO);
State = WaitingForFeed;
}
break;
case WaitingForFeed:
// Check if the end of the alignment marking on the carrier is
// hit (this state is needed because the alignment marking would
// lead to skipping the WaitingForPaperIn state right away)
if(!(I_NPPINS & (1 << P_NPPINS)))
{
State = WaitingForPaperIn;
}
break;

View file

@ -7,14 +7,27 @@
typedef enum
{
PowerOnWait,
Idle,
ClutchDelay,
WaitingForPaperIn,
ExitOnDelay,
ManualPaperFeedOffDelay,
PaperInOffDelay,
ExitOffDelay
PowerOnWait, // Power-on test state with all outputs
// enabled
Idle, // Waiting for print job
AlignFeed, // Initial pulling in for proper align-
// ment of the carrier
ClutchDelay, // Delay before main carrier feed
WaitingForFeed, // Waits for the end of the carrier
// alignment mark
WaitingForPaperIn, // Waits for the paper in mark on the
// carrier
ExitOnDelay, // Wait for print to be completed
ManualPaperFeedOffDelay, // Various delays
PaperInOffDelay, // for disabling the
ExitOffDelay // sensor signals again
} State_t;
int main(void);