Version 1.15 release

Relocated heater 7 to correrct pin on Duet WiFi
Fixed thermistor reading startup issues
Added over/under voltage count on Duet WiFi
This commit is contained in:
David Crocker 2016-08-23 21:28:28 +01:00
parent c64bf3f783
commit 658cfc8923
21 changed files with 35 additions and 18 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -26,11 +26,11 @@ Licence: GPL
// Firmware name is now defined in the Pins file
#ifndef VERSION
# define VERSION "1.15-rc4"
# define VERSION "1.15"
#endif
#ifndef DATE
# define DATE "2016-08-21"
# define DATE "2016-08-23"
#endif
#define AUTHORS "reprappro, dc42, zpl, t3p3, dnewman"

View file

@ -68,7 +68,7 @@ const Pin TEMP_SENSE_PINS[HEATERS] = { 45, 47, 44, 61, 62, 63, 59, 18 }; // Ther
#ifdef PROTOTYPE_1
const Pin HEAT_ON_PINS[HEATERS] = { 19, 20, 16, 15, 37, 40, 43, 38 }; // Heater pin numbers
#else
const Pin HEAT_ON_PINS[HEATERS] = { 19, 20, 16, 35, 37, 40, 43, 38 }; // Heater pin numbers (heater 7 pin TBC)
const Pin HEAT_ON_PINS[HEATERS] = { 19, 20, 16, 35, 37, 40, 43, 15 }; // Heater pin numbers (heater 7 pin TBC)
#endif
// Default thermistor parameters

View file

@ -467,10 +467,12 @@ namespace TMC2660
}
// Flag the the drivers have been powered up.
// Must call Init() before the first call to say the drivers have been powered uo.
// Important notes:
// 1. Before the first call to this function with powered true, you must call Init().
// 2. This may be called by the tick ISR with powered false, possibly while another call (with powered either true or false) is being executed
void SetDriversPowered(bool powered)
{
bool wasPowered = driversPowered;
const bool wasPowered = driversPowered;
driversPowered = powered;
if (powered && !wasPowered)
{
@ -483,7 +485,7 @@ namespace TMC2660
driverStates[drive].WriteAll();
}
}
else if (!powered and wasPowered)
else if (!powered && wasPowered)
{
digitalWrite(GlobalTmcEnablePin, HIGH); // disable the drivers
}

View file

@ -233,7 +233,7 @@ void PID::Spin()
break;
case HeaterMode::stable:
if (fabs(error) > MaxStableTemperatureError)
if (fabs(error) > MaxStableTemperatureError && temperature > MaxAmbientTemperature)
{
++heatingFaultCount;
if (heatingFaultCount * platform->HeatSampleInterval() > MaxHeatingFaultTime * SecondsToMillis)

View file

@ -69,9 +69,9 @@ uint32_t lastInterruptTime = 0;
void UrgentInit()
{
#ifdef DUET_NG
// When the reset button is pressed, if the TMC2660 drivers were previously enabled then we get uncommanded motor movements.
// Try to reduce that by initialising the drivers early here.
// On the production board we will also be able to set the ENN line high here.
// When the reset button is pressed on pre-production Duet WiFi boards, if the TMC2660 drivers were previously enabled then we get
// uncommanded motor movements if the STEP lines pick up any noise. Try to reduce that by initialising the drivers early here.
// On the production boards the ENN line is pulled high and that prevents motor movements.
for (size_t drive = 0; drive < DRIVES; ++drive)
{
pinMode(STEP_PINS[drive], OUTPUT_LOW);
@ -322,7 +322,7 @@ void Platform::Init()
}
const PinDescription& pinDesc = g_APinDescription[STEP_PINS[drive]];
pinDesc.pPort->PIO_OWER = pinDesc.ulPin; // enable parallel writes to the step pin
pinDesc.pPort->PIO_OWER = pinDesc.ulPin; // enable parallel writes to the step pins
motorCurrents[drive] = 0.0;
motorCurrentFraction[drive] = 1.0;
@ -403,6 +403,7 @@ void Platform::Init()
AnalogInEnableChannel(vInMonitorAdcChannel, true);
currentVin = highestVin = 0;
lowestVin = 9999;
numUnderVoltageEvents = numOverVoltageEvents = 0;
#endif
// Clear the spare pin configuration
@ -412,6 +413,12 @@ void Platform::Init()
lastTime = Time();
longWait = lastTime;
InitialiseInterrupts(); // also sets 'active' to true
// Allow the thermistors to collect enough readings to average before we response to PanelDue requests or allow heater to be turned on,
// otherwise we may send bad data to PanelDue, which confuses older firmware versions, and/or get PID problems.
// We read 1 heater every 2 system ticks, hence the wait for THERMISTOR_AVERAGE_READINGS * HEATERS * 2 ticks.
// We allow an extra 2 reads per thermistor, because the first few ADC readings may be inaccurate.
delay((THERMISTOR_AVERAGE_READINGS + 2) * HEATERS * 2);
}
void Platform::InvalidateFiles(const FATFS *fs)
@ -1207,12 +1214,19 @@ void Platform::Spin()
}
#ifdef DUET_NG
// Check whether the TMC drivers need to be initialised
// Check whether the TMC drivers need to be initialised.
// The tick ISR also looks for over-voltage events, but it just disables the driver without changing driversPowerd or numOverVoltageEvents
if (driversPowered)
{
if (currentVin < driverPowerOffAdcReading || currentVin > driverOverVoltageAdcReading)
if (currentVin < driverPowerOffAdcReading)
{
++numUnderVoltageEvents;
driversPowered = false;
}
else if (currentVin > driverOverVoltageAdcReading)
{
driversPowered = false;
++numOverVoltageEvents;
}
}
else if (currentVin >= driverPowerOnAdcReading && currentVin <= driverNormalVoltageAdcReading)
@ -1437,8 +1451,9 @@ void Platform::Diagnostics(MessageType mtype)
#ifdef DUET_NG
// Show the supply voltage
MessageF(mtype, "Supply voltage: min %.1f, current %.1f, max %.1f\n",
AdcReadingToPowerVoltage(lowestVin), AdcReadingToPowerVoltage(currentVin), AdcReadingToPowerVoltage(highestVin));
MessageF(mtype, "Supply voltage: min %.1f, current %.1f, max %.1f, under voltage events: %u, over voltage events: %u\n",
AdcReadingToPowerVoltage(lowestVin), AdcReadingToPowerVoltage(currentVin), AdcReadingToPowerVoltage(highestVin),
numUnderVoltageEvents, numOverVoltageEvents);
lowestVin = highestVin = currentVin;
#endif
@ -2811,9 +2826,8 @@ void Platform::Tick()
}
if (driversPowered && currentVin > driverOverVoltageAdcReading)
{
driversPowered = false;
TMC2660::SetDriversPowered(false);
//TODO set ENN high on production boards
// We deliberately do not clear driversPowered here or increase the over voltage event count - we let the spin loop handle that
}
#endif
}

View file

@ -879,7 +879,8 @@ private:
#ifdef DUET_NG
AnalogChannelNumber vInMonitorAdcChannel;
volatile uint16_t currentVin, highestVin, lowestVin;
uint16_t upperVinLimit, lowerVinLimit;
uint32_t numUnderVoltageEvents;
volatile uint32_t numOverVoltageEvents;
bool driversPowered;
#endif