Пример #1
0
void EEPROM::writeByte(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR0,(int)pos);
    Com::print(' ');
    Com::print((int)HAL::epr_get_byte(pos));
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #2
0
void EEPROM::writeFloat(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR3,(int)pos);
    Com::print(' ');
    Com::printFloat(HAL::epr_get_float(pos),3);
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #3
0
void EEPROM::writeInt(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR1,(int)pos);
    Com::print(' ');
    Com::print(HAL::epr_get_int(pos));
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #4
0
void EEPROM::writeLong(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR2,(int)pos);
    Com::print(' ');
    Com::print(HAL::eprGetInt32(pos));
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #5
0
void EEPROM::writeFloat(uint pos,PGM_P text,uint8_t digits)
{
    Com::printF(Com::tEPR3,(int)pos);
    Com::print(' ');
    Com::printFloat(HAL::eprGetFloat(pos),digits);
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #6
0
void EEPROM::writeByte(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR0, static_cast<int>(pos));
    Com::print(' ');
    Com::print((int)HAL::eprGetByte(pos));
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #7
0
void EEPROM::writeInt(uint pos,PGM_P text)
{
    Com::printF(Com::tEPR1, static_cast<int>(pos));
    Com::print(' ');
    Com::print(HAL::eprGetInt16(pos));
    Com::print(' ');
    writeExtruderPrefix(pos);
    Com::printFLN(text);
}
Пример #8
0
/** \brief Writes all eeprom settings to serial console.

For each value stored, this function generates one line with syntax

EPR: pos type value description

With
- pos = Position in EEPROM, the data starts.
- type = Value type: 0 = byte, 1 = int, 2 = long, 3 = float
- value = The value currently stored
- description = Definition of the value
*/
void EEPROM::writeSettings()
{
#if EEPROM_MODE != 0
    writeLong(EPR_BAUDRATE,Com::tEPRBaudrate);
    writeFloat(EPR_PRINTING_DISTANCE,Com::tEPRFilamentPrinted);
    writeLong(EPR_PRINTING_TIME,Com::tEPRPrinterActive);
    writeLong(EPR_MAX_INACTIVE_TIME,Com::tEPRMaxInactiveTime);
    writeLong(EPR_STEPPER_INACTIVE_TIME,Com::tEPRStopAfterInactivty);
//#define EPR_ACCELERATION_TYPE 1
#if DRIVE_SYSTEM != DELTA
    writeFloat(EPR_XAXIS_STEPS_PER_MM,Com::tEPRXStepsPerMM,4);
    writeFloat(EPR_YAXIS_STEPS_PER_MM,Com::tEPRYStepsPerMM,4);
#endif
    writeFloat(EPR_ZAXIS_STEPS_PER_MM,Com::tEPRZStepsPerMM,4);
#if DRIVE_SYSTEM != DELTA
    writeFloat(EPR_X_MAX_FEEDRATE,Com::tEPRXMaxFeedrate);
    writeFloat(EPR_Y_MAX_FEEDRATE,Com::tEPRYMaxFeedrate);
#endif
    writeFloat(EPR_Z_MAX_FEEDRATE,Com::tEPRZMaxFeedrate);
#if DRIVE_SYSTEM != DELTA
    writeFloat(EPR_X_HOMING_FEEDRATE,Com::tEPRXHomingFeedrate);
    writeFloat(EPR_Y_HOMING_FEEDRATE,Com::tEPRYHomingFeedrate);
#endif
    writeFloat(EPR_Z_HOMING_FEEDRATE,Com::tEPRZHomingFeedrate);
    writeFloat(EPR_MAX_JERK,Com::tEPRMaxJerk);
#if DRIVE_SYSTEM != DELTA
    writeFloat(EPR_MAX_ZJERK,Com::tEPRMaxZJerk);
#endif
    writeFloat(EPR_X_HOME_OFFSET,Com::tEPRXHomePos);
    writeFloat(EPR_Y_HOME_OFFSET,Com::tEPRYHomePos);
    writeFloat(EPR_Z_HOME_OFFSET,Com::tEPRZHomePos);
    writeFloat(EPR_X_LENGTH,Com::tEPRXMaxLength);
    writeFloat(EPR_Y_LENGTH,Com::tEPRYMaxLength);
    writeFloat(EPR_Z_LENGTH,Com::tEPRZMaxLength);
#if ENABLE_BACKLASH_COMPENSATION
    writeFloat(EPR_BACKLASH_X,Com::tEPRXBacklash);
    writeFloat(EPR_BACKLASH_Y,Com::tEPRYBacklash);
    writeFloat(EPR_BACKLASH_Z,Com::tEPRZBacklash);
#endif

#if RAMP_ACCELERATION
    //epr_out_float(EPR_X_MAX_START_SPEED,PSTR("X-axis start speed [mm/s]"));
    //epr_out_float(EPR_Y_MAX_START_SPEED,PSTR("Y-axis start speed [mm/s]"));
    //epr_out_float(EPR_Z_MAX_START_SPEED,PSTR("Z-axis start speed [mm/s]"));
#if DRIVE_SYSTEM == TUGA
    writeFloat(EPR_DELTA_DIAGONAL_ROD_LENGTH,Com::tEPRDiagonalRodLength);
#endif
#if DRIVE_SYSTEM == DELTA
    writeFloat(EPR_Z_MAX_ACCEL,Com::tEPRZAcceleration);
    writeFloat(EPR_Z_MAX_TRAVEL_ACCEL,Com::tEPRZTravelAcceleration);
    writeFloat(EPR_DELTA_DIAGONAL_ROD_LENGTH,Com::tEPRDiagonalRodLength);
    writeFloat(EPR_DELTA_HORIZONTAL_RADIUS,Com::tEPRHorizontalRadius);
    writeFloat(EPR_DELTA_MAX_RADIUS,Com::tEPRDeltaMaxRadius);
    writeInt(EPR_DELTA_SEGMENTS_PER_SECOND_MOVE,Com::tEPRSegmentsPerSecondTravel);
    writeInt(EPR_DELTA_SEGMENTS_PER_SECOND_PRINT,Com::tEPRSegmentsPerSecondPrint);
    writeInt(EPR_DELTA_TOWERX_OFFSET_STEPS,Com::tEPRTowerXOffset);
    writeInt(EPR_DELTA_TOWERY_OFFSET_STEPS,Com::tEPRTowerYOffset);
    writeInt(EPR_DELTA_TOWERZ_OFFSET_STEPS,Com::tEPRTowerZOffset);
    writeFloat(EPR_DELTA_ALPHA_A,Com::tDeltaAlphaA);
    writeFloat(EPR_DELTA_ALPHA_B,Com::tDeltaAlphaB);
    writeFloat(EPR_DELTA_ALPHA_C,Com::tDeltaAlphaC);
    writeFloat(EPR_DELTA_RADIUS_CORR_A,Com::tDeltaRadiusCorrectionA);
    writeFloat(EPR_DELTA_RADIUS_CORR_B,Com::tDeltaRadiusCorrectionB);
    writeFloat(EPR_DELTA_RADIUS_CORR_C,Com::tDeltaRadiusCorrectionC);
    writeFloat(EPR_DELTA_DIAGONAL_CORRECTION_A,Com::tDeltaDiagonalCorrectionA);
    writeFloat(EPR_DELTA_DIAGONAL_CORRECTION_B,Com::tDeltaDiagonalCorrectionB);
    writeFloat(EPR_DELTA_DIAGONAL_CORRECTION_C,Com::tDeltaDiagonalCorrectionC);
#else
    writeFloat(EPR_X_MAX_ACCEL,Com::tEPRXAcceleration);
    writeFloat(EPR_Y_MAX_ACCEL,Com::tEPRYAcceleration);
    writeFloat(EPR_Z_MAX_ACCEL,Com::tEPRZAcceleration);
    writeFloat(EPR_X_MAX_TRAVEL_ACCEL,Com::tEPRXTravelAcceleration);
    writeFloat(EPR_Y_MAX_TRAVEL_ACCEL,Com::tEPRYTravelAcceleration);
    writeFloat(EPR_Z_MAX_TRAVEL_ACCEL,Com::tEPRZTravelAcceleration);
#endif
#endif
#if FEATURE_Z_PROBE
    writeFloat(EPR_Z_PROBE_HEIGHT,Com::tZProbeHeight);
    writeFloat(EPR_Z_PROBE_BED_DISTANCE,Com::tZProbeBedDitance);
    writeFloat(EPR_Z_PROBE_SPEED,Com::tZProbeSpeed);
    writeFloat(EPR_Z_PROBE_XY_SPEED,Com::tZProbeSpeedXY);
    writeFloat(EPR_Z_PROBE_X_OFFSET,Com::tZProbeOffsetX);
    writeFloat(EPR_Z_PROBE_Y_OFFSET,Com::tZProbeOffsetY);
    writeFloat(EPR_Z_PROBE_X1,Com::tZProbeX1);
    writeFloat(EPR_Z_PROBE_Y1,Com::tZProbeY1);
    writeFloat(EPR_Z_PROBE_X2,Com::tZProbeX2);
    writeFloat(EPR_Z_PROBE_Y2,Com::tZProbeY2);
    writeFloat(EPR_Z_PROBE_X3,Com::tZProbeX3);
    writeFloat(EPR_Z_PROBE_Y3,Com::tZProbeY3);
#endif
#if FEATURE_AUTOLEVEL
    writeByte(EPR_AUTOLEVEL_ACTIVE,Com::tAutolevelActive);
#endif

#if FEATURE_AXISCOMP
    writeFloat(EPR_AXISCOMP_TANXY,Com::tAxisCompTanXY);
    writeFloat(EPR_AXISCOMP_TANYZ,Com::tAxisCompTanYZ);
    writeFloat(EPR_AXISCOMP_TANXZ,Com::tAxisCompTanXZ);
#endif


#if HAVE_HEATED_BED
    writeByte(EPR_BED_HEAT_MANAGER,Com::tEPRBedHeatManager);
#if TEMP_PID
    writeByte(EPR_BED_DRIVE_MAX,Com::tEPRBedPIDDriveMax);
    writeByte(EPR_BED_DRIVE_MIN,Com::tEPRBedPIDDriveMin);
    writeFloat(EPR_BED_PID_PGAIN,Com::tEPRBedPGain);
    writeFloat(EPR_BED_PID_IGAIN,Com::tEPRBedIGain);
    writeFloat(EPR_BED_PID_DGAIN,Com::tEPRBedDGain);
    writeByte(EPR_BED_PID_MAX,Com::tEPRBedPISMaxValue);
#endif
#endif
    // now the extruder
    for(uint8_t i = 0; i < NUM_EXTRUDER; i++)
    {
        int o = i * EEPROM_EXTRUDER_LENGTH+EEPROM_EXTRUDER_OFFSET;
        writeFloat(o+EPR_EXTRUDER_STEPS_PER_MM,Com::tEPRStepsPerMM);
        writeFloat(o+EPR_EXTRUDER_MAX_FEEDRATE,Com::tEPRMaxFeedrate);
        writeFloat(o+EPR_EXTRUDER_MAX_START_FEEDRATE,Com::tEPRStartFeedrate);
        writeFloat(o+EPR_EXTRUDER_MAX_ACCELERATION,Com::tEPRAcceleration);
        writeByte(o+EPR_EXTRUDER_HEAT_MANAGER,Com::tEPRHeatManager);
#if TEMP_PID
        writeByte(o+EPR_EXTRUDER_DRIVE_MAX,Com::tEPRDriveMax);
        writeByte(o+EPR_EXTRUDER_DRIVE_MIN,Com::tEPRDriveMin);
        writeFloat(o+EPR_EXTRUDER_PID_PGAIN,Com::tEPRPGain,4);
        writeFloat(o+EPR_EXTRUDER_PID_IGAIN,Com::tEPRIGain,4);
        writeFloat(o+EPR_EXTRUDER_PID_DGAIN,Com::tEPRDGain,4);
        writeByte(o+EPR_EXTRUDER_PID_MAX,Com::tEPRPIDMaxValue);
#endif
        writeLong(o+EPR_EXTRUDER_X_OFFSET,Com::tEPRXOffset);
        writeLong(o+EPR_EXTRUDER_Y_OFFSET,Com::tEPRYOffset);
        writeInt(o+EPR_EXTRUDER_WATCH_PERIOD,Com::tEPRStabilizeTime);
#if RETRACT_DURING_HEATUP
        writeInt(o+EPR_EXTRUDER_WAIT_RETRACT_TEMP,Com::tEPRRetractionWhenHeating);
        writeInt(o+EPR_EXTRUDER_WAIT_RETRACT_UNITS,Com::tEPRDistanceRetractHeating);
#endif
        writeByte(o+EPR_EXTRUDER_COOLER_SPEED,Com::tEPRExtruderCoolerSpeed);
#if USE_ADVANCE
#if ENABLE_QUADRATIC_ADVANCE
        writeFloat(o+EPR_EXTRUDER_ADVANCE_K,Com::tEPRAdvanceK);
#endif
        writeFloat(o+EPR_EXTRUDER_ADVANCE_L,Com::tEPRAdvanceL);
#endif
#if MIXING_EXTRUDER
        for(uint8_t v = 0; v < VIRTUAL_EXTRUDER; v++)
        {
            uint16_t pos = o + EPR_EXTRUDER_MIXING_RATIOS + 2 * v;
            Com::printF(Com::tEPR1,(int)pos);
            Com::print(' ');
            Com::print(HAL::eprGetInt16(pos));
            Com::print(' ');
            writeExtruderPrefix(pos);
            Com::printFLN(PSTR("Weight "),(int)(v + 1));
        }
#endif
    }
#else
    Com::printErrorF(Com::tNoEEPROMSupport);
#endif
}