Merge branch 'edge-preview' of https://github.com/synthetos/g2 into edge-preview

This commit is contained in:
Rob Giseburt
2023-02-17 03:17:48 +00:00
22 changed files with 2295 additions and 2068 deletions
+15 -16
View File
@@ -1,18 +1,17 @@
{
"configurations": [
{
"name": "Mac",
"compileCommands": "${workspaceFolder}/g2core/compile_commands.json",
"compilerPath": "${workspaceFolder}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
"${workspaceFolder}"
]
}
}
],
"version": 4
"configurations": [
{
"name": "Mac",
"compileCommands": "${workspaceFolder}/g2core/compile_commands.json",
"compilerPath": "${workspaceFolder}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}"]
},
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
+35 -35
View File
@@ -14,12 +14,12 @@
"device": "ATSAMS70N19",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N19.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=fourcable"
},
@@ -33,12 +33,12 @@
"device": "ATSAMS70N20",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N20B.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=r7 Debug"
},
@@ -52,12 +52,12 @@
"device": "ATSAM3X8E",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sam3x/ATSAM3X8E.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=MiniMillgShield Debug"
},
@@ -71,12 +71,12 @@
"device": "ATSAM3X8E",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sam3x/ATSAM3X8E.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=ShapeokoDualY"
},
@@ -90,12 +90,12 @@
"device": "ATSAM3X8E",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sam3x/ATSAM3X8E.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=MiniMillv9 Debug"
},
@@ -105,16 +105,16 @@
"request": "launch",
"servertype": "jlink",
"cwd": "${workspaceRoot}/g2core/",
"executable": "./bin/MiniMill-gquintic-d/g2core.elf",
"executable": "./bin/MiniMill-gquintic-g/g2core.elf",
"device": "ATSAMS70N19",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N19.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=MiniMill Debug"
},
@@ -128,16 +128,16 @@
"device": "ATSAMS70N20",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N20B.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"swoConfig": {
"enabled": true,
"source":"probe",
"source": "probe",
"swoFrequency": 8000000,
"decoders": [
{
@@ -198,12 +198,12 @@
"device": "ATSAMS70N20",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N20B.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=MiniMill Debug"
},
@@ -217,12 +217,12 @@
"device": "ATSAMS70N19",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N19.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=CheapoLaser Debug"
},
@@ -235,13 +235,13 @@
"executable": "./bin/OthermillPro-g2v9k/g2core.elf",
"device": "ATSAM3X8E",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sam3x/ATSAM3X8E.svd",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=OthermillPro Debug"
},
@@ -255,12 +255,12 @@
"device": "ATSAMS70N20",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N20B.svd",
"interface": "swd",
"showDevDebugOutput": false,
"showDevDebugOutput": "none",
"osx": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-7u2/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/osx/gcc-arm-none-eabi-12.2r1/bin/"
},
"linux": {
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-9m/bin/"
"armToolchainPath": "${workspaceRoot}/Motate/Tools/linux/gcc-arm-none-eabi-12.2r1/bin/"
},
"preLaunchTask": "Build CONFIG=AxiDrawv3-quint Debug"
}
+22
View File
@@ -309,6 +309,17 @@
"fileLocation": ["relative", "${workspaceRoot}/g2core"]
}
},
{
"label": "Build CONFIG=r7-v9k Production",
"type": "process",
"command": "make",
"args": ["CONFIG=r7-v9k", "VERBOSE=2", "COLOR=0", "RECORD=1"],
"group": "build",
"problemMatcher": {
"base": "$gcc",
"fileLocation": ["relative", "${workspaceRoot}/g2core"]
}
},
{
"label": "Clean CONFIG=r7",
"type": "process",
@@ -320,6 +331,17 @@
"fileLocation": ["relative", "${workspaceRoot}/g2core"]
}
},
{
"label": "Clean CONFIG=r7-v9k",
"type": "process",
"command": "make",
"args": ["CONFIG=r7-v9k", "clean"],
"group": "build",
"problemMatcher": {
"base": "$gcc",
"fileLocation": ["relative", "${workspaceRoot}/g2core"]
}
},
{
"label": "Build CONFIG=CheapoLaser Debug",
"type": "process",
+1 -1
Submodule Motate updated: 20a2e13d70...ce6585499d
+1 -1
View File
@@ -1,6 +1,6 @@
<img src="https://raw.githubusercontent.com/wiki/synthetos/g2/images/g2core.png" width="300" height="129" alt="g2core">
[![Build Status](https://travis-ci.org/synthetos/g2.svg?branch=edge)](https://travis-ci.org/synthetos/g2) [![Issues in Ready](https://badge.waffle.io/synthetos/g2.svg?label=ready&title=Ready)](http://waffle.io/synthetos/g2) [![Issues in Progress](https://badge.waffle.io/synthetos/g2.svg?label=in%20progress&title=In%20Progress)](http://waffle.io/synthetos/g2)
[![Build Status](https://travis-ci.org/synthetos/g2.svg?branch=edge)](https://travis-ci.org/synthetos/g2)
# What it is
+1 -2
View File
@@ -65,8 +65,7 @@ endif
# DEVICE_DEFINES += DEBUG=1 IN_DEBUGGER=1 DEBUG_SEMIHOSTING=1
#endif
TOOLS_VERSION = 7u2
# TOOLS_VERSION = 9m
TOOLS_VERSION = 12.2r1
# Now invoke the Motate compile system
include $(MOTATE_PATH)/Motate.mk
+1 -44
View File
@@ -87,50 +87,6 @@ gpioDigitalOutputPin<OutputType<OUTPUT13_PWM, Motate::kOutput13_PinNumber>> dout
gpioDigitalInput* const d_in[] = {&din1, &din2, &din3, &din4, &din5, &din6, &din7, &din8, &din9};
gpioDigitalOutput* const d_out[] = {&dout1, &dout2, &dout3, &dout4, &dout5, &dout6, &dout7, &dout8, &dout9, &dout10, &dout11, &dout12, &dout13};
// not yet used
gpioAnalogInput* a_in[] = {};
// gpioAnalogOutput* a_out[A_OUT_CHANNELS];
#if HAS_PRESSURE
Motate::SPIChipSelectPin<Motate::kPressure_ChipSelectPinNumber> pressure_cs{};
// BME280<SPIBus_used_t::SPIBusDevice> pressure_sensor{spiBus, pressure_cs};
TruStabilitySSC<SPIBus_used_t::SPIBusDevice> pressure_sensor{spiBus,
pressure_cs,
/*min_output:*/ 1638, // 10% of 2^12
/*max_output:*/ 14745, // 90% of 2^12
/*min_value:*/ 0.0, // 0psi
/*max_value:*/ 15.0, // 15psi
PressureUnits::PSI};
#endif
/************************************************************************************
**** CODE **************************************************************************
************************************************************************************/
// Register a SysTick event to call start_sampling every temperature_sample_freq ms
const int16_t ain_sample_freq = 2;
int16_t ain_sample_counter = ain_sample_freq;
Motate::SysTickEvent ain_tick_event{
[] {
if (!--ain_sample_counter) {
ai1.startSampling();
ai2.startSampling();
ai3.startSampling();
ai4.startSampling();
#if HAS_PRESSURE
pressure_sensor.startSampling(); // has a timeout built in to prevent over-calling
#endif
ain_sample_counter = ain_sample_freq;
}
},
nullptr
};
/*
* gpio_reset() - reset inputs and outputs (no initialization)
*/
void outputs_reset(void) {
@@ -140,3 +96,4 @@ void outputs_reset(void) {
void inputs_reset(void) {
// nothing to do
}
//https://drive.google.com/file/d/1SAU-vpRx9YbPC1ikLeY-4K2qexnzPPKU/view?usp=sharing
+28 -38
View File
@@ -37,64 +37,54 @@
*/
//--- change as required for board and switch hardware ---//
#define D_IN_CHANNELS 10 // v9 // number of digital inputs supported
#define D_OUT_CHANNELS 13 // number of digital outputs supported
#define A_IN_CHANNELS 0 // number of analog inputs supported
#define A_OUT_CHANNELS 0 // number of analog outputs supported
#define D_IN_CHANNELS 10 // v9 // number of digital inputs supported
#define D_OUT_CHANNELS 13 // number of digital outputs supported
#define A_IN_CHANNELS 0 // number of analog inputs supported
#define A_OUT_CHANNELS 0 // number of analog outputs supported
#define INPUT_LOCKOUT_MS 10 // milliseconds to go dead after input firing
// Setup spindle and coolant pin assignments
#define SPINDLE_ENABLE_OUTPUT_NUMBER 1
#define SPINDLE_DIRECTION_OUTPUT_NUMBER 2
#define SPINDLE_PWM_NUMBER 3
#define MIST_ENABLE_OUTPUT_NUMBER 4
#define FLOOD_ENABLE_OUTPUT_NUMBER 0
#define SECONDARY_PWM_OUTPUT_NUMBER 0
#define INPUT_LOCKOUT_MS 10 // milliseconds to go dead after input firing
/*
* The GPIO objects themselves - this must match up with board_gpio.cpp!
*/
extern gpioDigitalInput* const d_in[D_IN_CHANNELS];
extern gpioDigitalOutput* const d_out[D_OUT_CHANNELS];
extern gpioDigitalInput* const d_in[D_IN_CHANNELS];
extern gpioDigitalOutput* const d_out[D_OUT_CHANNELS];
// extern gpioAnalogInput* a_in[A_IN_CHANNELS];
// extern gpioAnalogOutput* a_out[A_OUT_CHANNELS];
// prepare the objects as externs (for config_app to not bloat)
using Motate::IRQPin;
using Motate::PWMOutputPin;
using Motate::PWMLikeOutputPin;
template<bool can_pwm, Motate::pin_number... V>
using Motate::PWMOutputPin;
template <bool can_pwm, Motate::pin_number... V>
using OutputType = typename std::conditional<can_pwm, PWMOutputPin<V...>, PWMLikeOutputPin<V...>>::type;
extern gpioDigitalInputPin<IRQPin<Motate::kInput1_PinNumber>> din1;
extern gpioDigitalInputPin<IRQPin<Motate::kInput2_PinNumber>> din2;
extern gpioDigitalInputPin<IRQPin<Motate::kInput3_PinNumber>> din3;
extern gpioDigitalInputPin<IRQPin<Motate::kInput4_PinNumber>> din4;
extern gpioDigitalInputPin<IRQPin<Motate::kInput5_PinNumber>> din5;
extern gpioDigitalInputPin<IRQPin<Motate::kInput6_PinNumber>> din6;
extern gpioDigitalInputPin<IRQPin<Motate::kInput7_PinNumber>> din7;
extern gpioDigitalInputPin<IRQPin<Motate::kInput8_PinNumber>> din8;
extern gpioDigitalInputPin<IRQPin<Motate::kInput9_PinNumber>> din9;
extern gpioDigitalInputPin<IRQPin<Motate::kInput1_PinNumber>> din1;
extern gpioDigitalInputPin<IRQPin<Motate::kInput2_PinNumber>> din2;
extern gpioDigitalInputPin<IRQPin<Motate::kInput3_PinNumber>> din3;
extern gpioDigitalInputPin<IRQPin<Motate::kInput4_PinNumber>> din4;
extern gpioDigitalInputPin<IRQPin<Motate::kInput5_PinNumber>> din5;
extern gpioDigitalInputPin<IRQPin<Motate::kInput6_PinNumber>> din6;
extern gpioDigitalInputPin<IRQPin<Motate::kInput7_PinNumber>> din7;
extern gpioDigitalInputPin<IRQPin<Motate::kInput8_PinNumber>> din8;
extern gpioDigitalInputPin<IRQPin<Motate::kInput9_PinNumber>> din9;
extern gpioDigitalInputPin<IRQPin<Motate::kSocket2_SPISlaveSelectPinNumber>> din10;
// extern gpioDigitalInputPin<IRQPin<Motate::kInput11_PinNumber>> din11;
// extern gpioDigitalInputPin<IRQPin<Motate::kInput12_PinNumber>> din12;
extern gpioDigitalOutputPin<OutputType<OUTPUT1_PWM, Motate::kOutput1_PinNumber>> dout1;
extern gpioDigitalOutputPin<OutputType<OUTPUT2_PWM, Motate::kOutput2_PinNumber>> dout2;
extern gpioDigitalOutputPin<OutputType<OUTPUT3_PWM, Motate::kOutput3_PinNumber>> dout3;
extern gpioDigitalOutputPin<OutputType<OUTPUT4_PWM, Motate::kOutput4_PinNumber>> dout4;
extern gpioDigitalOutputPin<OutputType<OUTPUT5_PWM, Motate::kOutput5_PinNumber>> dout5;
extern gpioDigitalOutputPin<OutputType<OUTPUT6_PWM, Motate::kOutput6_PinNumber>> dout6;
extern gpioDigitalOutputPin<OutputType<OUTPUT7_PWM, Motate::kOutput7_PinNumber>> dout7;
extern gpioDigitalOutputPin<OutputType<OUTPUT8_PWM, Motate::kOutput8_PinNumber>> dout8;
extern gpioDigitalOutputPin<OutputType<OUTPUT9_PWM, Motate::kOutput9_PinNumber>> dout9;
extern gpioDigitalOutputPin<OutputType<OUTPUT1_PWM, Motate::kOutput1_PinNumber>> dout1;
extern gpioDigitalOutputPin<OutputType<OUTPUT2_PWM, Motate::kOutput2_PinNumber>> dout2;
extern gpioDigitalOutputPin<OutputType<OUTPUT3_PWM, Motate::kOutput3_PinNumber>> dout3;
extern gpioDigitalOutputPin<OutputType<OUTPUT4_PWM, Motate::kOutput4_PinNumber>> dout4;
extern gpioDigitalOutputPin<OutputType<OUTPUT5_PWM, Motate::kOutput5_PinNumber>> dout5;
extern gpioDigitalOutputPin<OutputType<OUTPUT6_PWM, Motate::kOutput6_PinNumber>> dout6;
extern gpioDigitalOutputPin<OutputType<OUTPUT7_PWM, Motate::kOutput7_PinNumber>> dout7;
extern gpioDigitalOutputPin<OutputType<OUTPUT8_PWM, Motate::kOutput8_PinNumber>> dout8;
extern gpioDigitalOutputPin<OutputType<OUTPUT9_PWM, Motate::kOutput9_PinNumber>> dout9;
extern gpioDigitalOutputPin<OutputType<OUTPUT10_PWM, Motate::kOutput10_PinNumber>> dout10;
extern gpioDigitalOutputPin<OutputType<OUTPUT11_PWM, Motate::kOutput11_PinNumber>> dout11;
extern gpioDigitalOutputPin<OutputType<OUTPUT12_PWM, Motate::kOutput12_PinNumber>> dout12;
extern gpioDigitalOutputPin<OutputType<OUTPUT13_PWM, Motate::kOutput13_PinNumber>> dout13;
#endif // End of include guard: BOARD_GPIO_H_ONCE
#endif // End of include guard: BOARD_GPIO_H_ONCE
+7
View File
@@ -258,6 +258,13 @@ ifeq ("$(CONFIG)","r7")
SETTINGS_FILE="settings_smw3d_r7.h"
endif
ifeq ("$(CONFIG)","r7-v9k")
ifeq ("$(BOARD)","NONE")
BOARD=g2v9k
endif
SETTINGS_FILE="settings_smw3d_r7_v9k.h"
endif
##########
# Synthetos Pendulum v2 config:
File diff suppressed because it is too large Load Diff
+439 -442
View File
File diff suppressed because it is too large Load Diff
+39 -44
View File
@@ -25,15 +25,15 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "g2core.h" // #1 dependency order
#include "config.h" // #2
#include "canonical_machine.h" // #3
#include "text_parser.h" // #4
#include "gpio.h"
#include "coolant.h"
#include "planner.h"
#include "canonical_machine.h" // #3
#include "config.h" // #2
#include "g2core.h" // #1 dependency order
#include "gpio.h"
#include "hardware.h"
#include "planner.h"
#include "text_parser.h" // #4
#include "util.h"
/**** Allocate structures ****/
@@ -57,7 +57,7 @@ coCoolant_t coolant;
/**** Static functions ****/
static void _exec_coolant_control(float* value, bool* flag);
static void _exec_coolant_control(float *value, bool *flag);
/****************************************************************************************
* coolant_init()
@@ -65,17 +65,17 @@ static void _exec_coolant_control(float* value, bool* flag);
*/
void coolant_init() {
if (MIST_ENABLE_OUTPUT_NUMBER > 0) {
coolant.mist.output = d_out[MIST_ENABLE_OUTPUT_NUMBER-1];
coolant.mist.output = d_out[MIST_ENABLE_OUTPUT_NUMBER - 1];
coolant.mist.output->setEnabled(IO_ENABLED);
coolant.mist.output->setPolarity((ioPolarity)COOLANT_MIST_POLARITY);
}
if (FLOOD_ENABLE_OUTPUT_NUMBER > 0) {
coolant.flood.output = d_out[FLOOD_ENABLE_OUTPUT_NUMBER-1];
coolant.flood.output = d_out[FLOOD_ENABLE_OUTPUT_NUMBER - 1];
coolant.flood.output->setEnabled(IO_ENABLED);
coolant.flood.output->setPolarity((ioPolarity)COOLANT_FLOOD_POLARITY);
}
coolant.mist.state = COOLANT_OFF;
coolant.mist.state = COOLANT_OFF;
coolant.flood.state = COOLANT_OFF;
}
@@ -90,16 +90,14 @@ void coolant_reset() {
* _exec_coolant_control() - actually execute the coolant command
*/
stat_t coolant_control_immediate(coControl control, coSelect select)
{
float value[] = { (float)control };
bool flags[] = { (select & COOLANT_MIST), (select & COOLANT_FLOOD) };
stat_t coolant_control_immediate(coControl control, coSelect select) {
float value[] = {(float)control};
bool flags[] = {(select & COOLANT_MIST), (select & COOLANT_FLOOD)};
_exec_coolant_control(value, flags);
return(STAT_OK);
return (STAT_OK);
}
stat_t coolant_control_sync(coControl control, coSelect select)
{
stat_t coolant_control_sync(coControl control, coSelect select) {
// Skip the PAUSE operation if pause_enable is not enabled (pause-on-hold)
// The pause setting in mist coolant is treated as the master even though it's replicated in flood
if ((control == COOLANT_PAUSE) && (!coolant.mist.pause_enable)) {
@@ -107,14 +105,13 @@ stat_t coolant_control_sync(coControl control, coSelect select)
}
// queue the coolant control
float value[] = { (float)control };
bool flags[] = { (select & COOLANT_MIST), (select & COOLANT_FLOOD) };
float value[] = {(float)control};
bool flags[] = {(select & COOLANT_MIST), (select & COOLANT_FLOOD)};
mp_queue_command(_exec_coolant_control, value, flags);
return(STAT_OK);
return (STAT_OK);
}
static void _exec_coolant_helper(coCoolantChannel_t &co, coControl control) {
bool action = true;
int8_t enable_bit = 0;
switch (control) {
@@ -152,16 +149,15 @@ static void _exec_coolant_helper(coCoolantChannel_t &co, coControl control) {
}
}
static void _exec_coolant_control(float* value, bool* flag) {
static void _exec_coolant_control(float *value, bool *flag) {
coControl control = (coControl)value[0];
if (control > COOLANT_ACTION_MAX) {
return;
}
if (flag[0]) { // Mist, M7
if (flag[0]) { // Mist, M7
_exec_coolant_helper(coolant.mist, control);
}
if (flag[1]) { // Flood, M8
if (flag[1]) { // Flood, M8
_exec_coolant_helper(coolant.flood, control);
}
}
@@ -176,31 +172,30 @@ bool coolant_ready() { return true; }
**** Coolant Settings ******************************************************************
****************************************************************************************/
stat_t co_get_com(nvObj_t *nv) { return(get_integer(nv, coolant.mist.state)); }
stat_t co_set_com(nvObj_t *nv) { return(coolant_control_immediate((coControl)nv->value_int, COOLANT_MIST)); }
stat_t co_get_cof(nvObj_t *nv) { return(get_integer(nv, coolant.flood.state)); }
stat_t co_set_cof(nvObj_t *nv) { return(coolant_control_immediate((coControl)nv->value_int, COOLANT_FLOOD)); }
stat_t co_get_com(nvObj_t *nv) { return (get_integer(nv, coolant.mist.state)); }
stat_t co_set_com(nvObj_t *nv) { return (coolant_control_immediate((coControl)nv->value_int, COOLANT_MIST)); }
stat_t co_get_cof(nvObj_t *nv) { return (get_integer(nv, coolant.flood.state)); }
stat_t co_set_cof(nvObj_t *nv) { return (coolant_control_immediate((coControl)nv->value_int, COOLANT_FLOOD)); }
stat_t co_get_coph(nvObj_t *nv) { return(get_integer(nv, coolant.mist.pause_enable)); }
stat_t co_set_coph(nvObj_t *nv)
{
stat_t co_get_coph(nvObj_t *nv) { return (get_integer(nv, coolant.mist.pause_enable)); }
stat_t co_set_coph(nvObj_t *nv) {
ritorno(set_integer(nv, (uint8_t &)coolant.mist.pause_enable, 0, 1));
return (set_integer(nv, (uint8_t &)coolant.flood.pause_enable, 0, 1));
}
stat_t co_get_comp(nvObj_t *nv) { return(get_integer(nv, coolant.mist.polarity)); }
stat_t co_get_comp(nvObj_t *nv) { return (get_integer(nv, coolant.mist.polarity)); }
stat_t co_set_comp(nvObj_t *nv) {
stat_t ret = set_integer(nv, (uint8_t &)coolant.mist.polarity, 0, 1);
if (ret == STAT_OK && coolant.mist.output) {
coolant.mist.output->setPolarity((ioPolarity) coolant.mist.polarity);
coolant.mist.output->setPolarity((ioPolarity)coolant.mist.polarity);
}
return ret;
}
stat_t co_get_cofp(nvObj_t *nv) { return(get_integer(nv, coolant.flood.polarity)); }
stat_t co_get_cofp(nvObj_t *nv) { return (get_integer(nv, coolant.flood.polarity)); }
stat_t co_set_cofp(nvObj_t *nv) {
stat_t ret = set_integer(nv, (uint8_t &)coolant.flood.polarity, 0, 1);
if (ret == STAT_OK && coolant.flood.output) {
coolant.flood.output->setPolarity((ioPolarity) coolant.flood.polarity);
coolant.flood.output->setPolarity((ioPolarity)coolant.flood.polarity);
}
return ret;
}
@@ -215,13 +210,13 @@ stat_t co_set_cofp(nvObj_t *nv) {
const char fmt_coph[] = "[coph] coolant pause on hold%7d [0=no,1=pause_on_hold]\n";
const char fmt_comp[] = "[comp] coolant mist polarity%7d [0=low is ON,1=high is ON]\n";
const char fmt_cofp[] = "[cofp] coolant flood polarity%6d [0=low is ON,1=high is ON]\n";
const char fmt_com[] = "[com] coolant mist%16d [0=OFF,1=ON]\n";
const char fmt_cof[] = "[cof] coolant flood%15d [0=OFF,1=ON]\n";
const char fmt_com[] = "[com] coolant mist%16d [0=OFF,1=ON]\n";
const char fmt_cof[] = "[cof] coolant flood%15d [0=OFF,1=ON]\n";
void co_print_coph(nvObj_t* nv) { text_print(nv, fmt_coph); } // TYPE_INT
void co_print_comp(nvObj_t* nv) { text_print(nv, fmt_comp); } // TYPE_INT
void co_print_cofp(nvObj_t* nv) { text_print(nv, fmt_cofp); } // TYPE_INT
void co_print_com(nvObj_t* nv) { text_print(nv, fmt_com); } // TYPE_INT
void co_print_cof(nvObj_t* nv) { text_print(nv, fmt_cof); } // TYPE_INT
void co_print_coph(nvObj_t *nv) { text_print(nv, fmt_coph); } // TYPE_INT
void co_print_comp(nvObj_t *nv) { text_print(nv, fmt_comp); } // TYPE_INT
void co_print_cofp(nvObj_t *nv) { text_print(nv, fmt_cofp); } // TYPE_INT
void co_print_com(nvObj_t *nv) { text_print(nv, fmt_com); } // TYPE_INT
void co_print_cof(nvObj_t *nv) { text_print(nv, fmt_cof); } // TYPE_INT
#endif // __TEXT_MODE
+243 -203
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -730,7 +730,7 @@ static stat_t _parse_gcode_block(char *buf, char *active_comment)
}
break;
}
case 49: SET_NON_MODAL (next_action, NEXT_ACTION_CANCEL_TL_OFFSET);
case 49: SET_NON_MODAL (next_action, NEXT_ACTION_CANCEL_TL_OFFSET);
case 53: SET_NON_MODAL (absolute_override, ABSOLUTE_OVERRIDE_ON_DISPLAY_WITH_NO_OFFSETS);
case 54: SET_MODAL (MODAL_GROUP_G12, coord_system, G54);
case 55: SET_MODAL (MODAL_GROUP_G12, coord_system, G55);
+171 -176
View File
File diff suppressed because it is too large Load Diff
+197 -235
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -47,7 +47,7 @@
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_SPINUP_DELAY 1.0
#define SPINDLE_PWM_NUMBER 6
#define SPINDLE_PWM_NUMBER 3
#define SECONDARY_PWM_OUTPUT_NUMBER 0 // disabled
// #define LASER_FIRE_PIN_NUMBER Motate::kOutput3_PinNumber // note this is a MOTATE pin number, NOT a GPIO pin number
+1 -1
View File
@@ -86,7 +86,7 @@
#endif
#ifndef SPINDLE_ENABLE_POLARITY
#define SPINDLE_ENABLE_POLARITY SPINDLE_ACTIVE_HIGH // {spep: 0=active low, 1=active high
#define SPINDLE_ENABLE_POLARITY 1 // 0=active low, 1=active high
#endif
#ifndef SPINDLE_DIR_POLARITY
+15 -1
View File
@@ -35,6 +35,20 @@
//**** GLOBAL / GENERAL SETTINGS ******************************************************
#define MIST_ENABLE_OUTPUT_NUMBER 0
#define FLOOD_ENABLE_OUTPUT_NUMBER 0
// #define SPINDLE_ENABLE_OUTPUT_NUMBER 4
// #define SPINDLE_DIRECTION_OUTPUT_NUMBER 5
// #define SPINDLE_PWM_NUMBER 6
#define SPINDLE_ENABLE_OUTPUT_NUMBER 1
#define SPINDLE_DIRECTION_OUTPUT_NUMBER 2
#define SPINDLE_PWM_NUMBER 3
// #define FEEDHOLD_Z_LIFT 3 // mm to lift Z on feedhold
#define JUNCTION_INTEGRATION_TIME 0.1 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.01 // chordal accuracy for arc drawing (in mm)
@@ -46,7 +60,7 @@
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_SPINUP_DELAY 0.1 // after unpausing and turning the spindle on, dwell for 1.5s
#define SPINDLE_SPEED_CHANGE_PER_MS 7.0
#define SPINDLE_SPEED_CHANGE_PER_MS 7.0 // external non-speed-controlled spindle, but we can use this as a built-in delay
#define ESC_BOOT_TIME 5000 // how long the ESC takes to boot, in milliseconds
#define ESC_LOCKOUT_TIME 900 // how long the interlock needs to be engaged before killing power... actually 1s, but be conservative
+128 -127
View File
@@ -36,141 +36,143 @@
// Machine configuration settings
#define JUNCTION_INTEGRATION_TIME 0.75 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.01 // chordal tolerance for arcs (in mm)
#define JUNCTION_INTEGRATION_TIME 0.75 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.01 // chordal tolerance for arcs (in mm)
#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 0 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 1 // 0=off, 1=on
#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 0 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 1 // 0=off, 1=on
#define SPINDLE_ENABLE_OUTPUT_NUMBER 4
#define SPINDLE_ENABLE_POLARITY 0 // 1=active low, 0=active high
#define SPINDLE_ENABLE_POLARITY 0 // 1=active low, 0=active high
#define SPINDLE_DIRECTION_OUTPUT_NUMBER 5
#define SPINDLE_DIR_POLARITY 1 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_SPINUP_DELAY 10.0
#define SPINDLE_PWM_NUMBER 6
#define SECONDARY_PWM_OUTPUT_NUMBER 0 // disabled
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_SPINUP_DELAY 1.0
#define SPINDLE_PWM_NUMBER 6
#define SECONDARY_PWM_OUTPUT_NUMBER 0 // disabled
#define COOLANT_MIST_POLARITY 0 // 1=active low, 0=active high
#define COOLANT_FLOOD_POLARITY 0 // 1=active low, 0=active high
#define COOLANT_PAUSE_ON_HOLD false
#define FLOOD_ENABLE_OUTPUT_NUMBER 9 // disabled
#define MIST_ENABLE_OUTPUT_NUMBER 7 // disabled
#define COOLANT_MIST_POLARITY 0 // 1=active low, 0=active high
#define COOLANT_FLOOD_POLARITY 0 // 1=active low, 0=active high
#define COOLANT_PAUSE_ON_HOLD false
#define FLOOD_ENABLE_OUTPUT_NUMBER 9 // disabled
#define MIST_ENABLE_OUTPUT_NUMBER 7 // disabled
#define FEEDHOLD_Z_LIFT -1 // mm to lift Z on feedhold, or -1 to go to Z-max
#define FEEDHOLD_Z_LIFT -1 // mm to lift Z on feedhold, or -1 to go to Z-max
// Communications and reporting settings
#define USB_SERIAL_PORTS_EXPOSED 1 // 1=single endpoint usb, 2=dual endpoint usb
#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
#define XIO_ENABLE_FLOW_CONTROL FLOW_CONTROL_RTS // FLOW_CONTROL_OFF, FLOW_CONTROL_RTS
#define USB_SERIAL_PORTS_EXPOSED 1 // 1=single endpoint usb, 2=dual endpoint usb
#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
#define XIO_ENABLE_FLOW_CONTROL FLOW_CONTROL_RTS // FLOW_CONTROL_OFF, FLOW_CONTROL_RTS
#define TEXT_VERBOSITY TV_VERBOSE // one of: TV_SILENT, TV_VERBOSE
#define JSON_VERBOSITY JV_MESSAGES // one of: JV_SILENT, JV_FOOTER, JV_CONFIGS, JV_MESSAGES, JV_LINENUM, JV_VERBOSE
#define QUEUE_REPORT_VERBOSITY QR_OFF // one of: QR_OFF, QR_SINGLE, QR_TRIPLE
#define TEXT_VERBOSITY TV_VERBOSE // one of: TV_SILENT, TV_VERBOSE
#define JSON_VERBOSITY JV_MESSAGES // one of: JV_SILENT, JV_FOOTER, JV_CONFIGS, JV_MESSAGES, JV_LINENUM, JV_VERBOSE
#define QUEUE_REPORT_VERBOSITY QR_OFF // one of: QR_OFF, QR_SINGLE, QR_TRIPLE
#define STATUS_REPORT_VERBOSITY SR_FILTERED // one of: SR_OFF, SR_FILTERED, SR_VERBOSE
#define STATUS_REPORT_VERBOSITY SR_FILTERED // one of: SR_OFF, SR_FILTERED, SR_VERBOSE
#define STATUS_REPORT_MIN_MS 100 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable
#define STATUS_REPORT_MIN_MS 100 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable
//#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","posa","feed","vel","unit","coor","dist","admo","frmo","momo","stat"
#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","feed","vel","momo","stat"
// #define STATUS_REPORT_DEFAULTS
// "line","posx","posy","posz","posa","feed","vel","unit","coor","dist","admo","frmo","momo","stat"
#define STATUS_REPORT_DEFAULTS "line", "posx", "posy", "posz", "feed", "vel", "momo", "stat"
// Alternate SRs that report in drawable units
//#define STATUS_REPORT_DEFAULTS "line","vel","mpox","mpoy","mpoz","mpoa","coor","ofsa","ofsx","ofsy","ofsz","dist","unit","stat","homz","homy","homx","momo"
//#define STATUS_REPORT_DEFAULTS "_ts1","_cs1","_es1","_xs1","_fe1","line","posx","posy","posz","vel","stat"
// #define STATUS_REPORT_DEFAULTS
// "line","vel","mpox","mpoy","mpoz","mpoa","coor","ofsa","ofsx","ofsy","ofsz","dist","unit","stat","homz","homy","homx","momo"
// #define STATUS_REPORT_DEFAULTS "_ts1","_cs1","_es1","_xs1","_fe1","line","posx","posy","posz","vel","stat"
// Gcode startup defaults
#define GCODE_DEFAULT_UNITS MILLIMETERS // MILLIMETERS or INCHES
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
#define GCODE_DEFAULT_UNITS MILLIMETERS // MILLIMETERS or INCHES
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_DISTANCE_MODE
// *** motor settings ************************************************************************************
#define MOTOR_POWER_MODE MOTOR_POWERED_IN_CYCLE // default motor power mode (see cmMotorPowerMode in stepper.h)
#define MOTOR_POWER_TIMEOUT 2.00 // motor power timeout in seconds
#define MOTOR_POWER_MODE MOTOR_POWERED_IN_CYCLE // default motor power mode (see cmMotorPowerMode in stepper.h)
#define MOTOR_POWER_TIMEOUT 2.00 // motor power timeout in seconds
#define M1_MOTOR_MAP AXIS_X // 1ma
#define M1_STEP_ANGLE 1.8 // 1sa
#define M1_TRAVEL_PER_REV 8.0934060625 // 1tr
#define M1_MICROSTEPS 64 // 1mi 1,2,4,8,16,32
#define M1_POLARITY 1 // 1po 0=normal, 1=reversed
#define M1_POWER_MODE MOTOR_ALWAYS_POWERED // 1pm TRUE=low power idle enabled
#define M1_POWER_LEVEL 0.500
#define M1_MOTOR_MAP AXIS_X // 1ma
#define M1_STEP_ANGLE 1.8 // 1sa
#define M1_TRAVEL_PER_REV 8.0934060625 // 1tr
#define M1_MICROSTEPS 64 // 1mi 1,2,4,8,16,32
#define M1_POLARITY 1 // 1po 0=normal, 1=reversed
#define M1_POWER_MODE MOTOR_ALWAYS_POWERED // 1pm TRUE=low power idle enabled
#define M1_POWER_LEVEL 0.500
#define M2_MOTOR_MAP AXIS_Y
#define M2_STEP_ANGLE 1.8
#define M2_TRAVEL_PER_REV 8.0934060625
#define M2_MICROSTEPS 64
#define M2_POLARITY 0
#define M2_POWER_MODE MOTOR_ALWAYS_POWERED
#define M2_POWER_LEVEL 0.500
#define M2_MOTOR_MAP AXIS_Y
#define M2_STEP_ANGLE 1.8
#define M2_TRAVEL_PER_REV 8.0934060625
#define M2_MICROSTEPS 64
#define M2_POLARITY 0
#define M2_POWER_MODE MOTOR_ALWAYS_POWERED
#define M2_POWER_LEVEL 0.500
#define M3_MOTOR_MAP AXIS_Y
#define M3_STEP_ANGLE 1.8
#define M3_TRAVEL_PER_REV 8.0934060625
#define M3_MICROSTEPS 64
#define M3_POLARITY 0
#define M3_POWER_MODE MOTOR_ALWAYS_POWERED
#define M3_POWER_LEVEL 0.500
#define M3_MOTOR_MAP AXIS_Y
#define M3_STEP_ANGLE 1.8
#define M3_TRAVEL_PER_REV 8.0934060625
#define M3_MICROSTEPS 64
#define M3_POLARITY 0
#define M3_POWER_MODE MOTOR_ALWAYS_POWERED
#define M3_POWER_LEVEL 0.500
#define M4_MOTOR_MAP AXIS_Z
#define M4_STEP_ANGLE 1.8
#define M4_TRAVEL_PER_REV 8.0934060625
#define M4_MICROSTEPS 64
#define M4_POLARITY 1
#define M4_POWER_MODE MOTOR_ALWAYS_POWERED
#define M4_POWER_LEVEL 0.750
#define M4_MOTOR_MAP AXIS_Z
#define M4_STEP_ANGLE 1.8
#define M4_TRAVEL_PER_REV 8.0934060625
#define M4_MICROSTEPS 64
#define M4_POLARITY 1
#define M4_POWER_MODE MOTOR_ALWAYS_POWERED
#define M4_POWER_LEVEL 0.750
// *** axis settings **********************************************************************************
#define JERK_MAX 5000
#define JERK_MAX 5000
#define X_AXIS_MODE AXIS_STANDARD // xam see canonical_machine.h cmAxisMode for valid values
#define X_VELOCITY_MAX 2000 // xvm G0 max velocity in mm/min
#define X_FEEDRATE_MAX X_VELOCITY_MAX // xfr G1 max feed rate in mm/min
#define X_TRAVEL_MIN 0 // xtn minimum travel for soft limits
#define X_TRAVEL_MAX 824 // xtm travel between switches or crashes
#define X_JERK_MAX 3500 // xjm jerk * 1,000,000
#define X_JERK_HIGH_SPEED 20000 // xjh
#define X_HOMING_INPUT 1 // xhi input used for homing or 0 to disable
#define X_HOMING_DIRECTION 1 // xhd 0=search moves negative, 1= search moves positive
#define X_SEARCH_VELOCITY 1000 // xsv minus means move to minimum switch
#define X_LATCH_VELOCITY 100 // xlv mm/min
#define X_LATCH_BACKOFF 4 // xlb mm
#define X_ZERO_BACKOFF 2 // xzb mm
#define X_AXIS_MODE AXIS_STANDARD // xam see canonical_machine.h cmAxisMode for valid values
#define X_VELOCITY_MAX 2000 // xvm G0 max velocity in mm/min
#define X_FEEDRATE_MAX X_VELOCITY_MAX // xfr G1 max feed rate in mm/min
#define X_TRAVEL_MIN 0 // xtn minimum travel for soft limits
#define X_TRAVEL_MAX 824 // xtm travel between switches or crashes
#define X_JERK_MAX 3500 // xjm jerk * 1,000,000
#define X_JERK_HIGH_SPEED 20000 // xjh
#define X_HOMING_INPUT 1 // xhi input used for homing or 0 to disable
#define X_HOMING_DIRECTION 1 // xhd 0=search moves negative, 1= search moves positive
#define X_SEARCH_VELOCITY 1000 // xsv minus means move to minimum switch
#define X_LATCH_VELOCITY 100 // xlv mm/min
#define X_LATCH_BACKOFF 4 // xlb mm
#define X_ZERO_BACKOFF 2 // xzb mm
#define Y_AXIS_MODE AXIS_STANDARD
#define Y_VELOCITY_MAX 4000
#define Y_FEEDRATE_MAX Y_VELOCITY_MAX
#define Y_TRAVEL_MIN 0
#define Y_TRAVEL_MAX 781
#define Y_JERK_MAX 3500
#define Y_JERK_HIGH_SPEED 20000
#define Y_HOMING_INPUT 2
#define Y_HOMING_DIRECTION 1
#define Y_SEARCH_VELOCITY 1000
#define Y_LATCH_VELOCITY 100
#define Y_LATCH_BACKOFF 4
#define Y_ZERO_BACKOFF 2
#define Y_AXIS_MODE AXIS_STANDARD
#define Y_VELOCITY_MAX 4000
#define Y_FEEDRATE_MAX Y_VELOCITY_MAX
#define Y_TRAVEL_MIN 0
#define Y_TRAVEL_MAX 781
#define Y_JERK_MAX 3500
#define Y_JERK_HIGH_SPEED 20000
#define Y_HOMING_INPUT 2
#define Y_HOMING_DIRECTION 1
#define Y_SEARCH_VELOCITY 1000
#define Y_LATCH_VELOCITY 100
#define Y_LATCH_BACKOFF 4
#define Y_ZERO_BACKOFF 2
#define Z_AXIS_MODE AXIS_STANDARD
#define Z_VELOCITY_MAX 1200
#define Z_FEEDRATE_MAX Z_VELOCITY_MAX
#define Z_TRAVEL_MAX 75
#define Z_TRAVEL_MIN -15
#define Z_JERK_MAX 500
#define Z_JERK_HIGH_SPEED 1000
#define Z_HOMING_INPUT 3
#define Z_HOMING_DIRECTION 1
#define Z_SEARCH_VELOCITY (Z_VELOCITY_MAX * 0.66666)
#define Z_LATCH_VELOCITY 25
#define Z_LATCH_BACKOFF 4
#define Z_ZERO_BACKOFF 2
#define Z_AXIS_MODE AXIS_STANDARD
#define Z_VELOCITY_MAX 1200
#define Z_FEEDRATE_MAX Z_VELOCITY_MAX
#define Z_TRAVEL_MAX 75
#define Z_TRAVEL_MIN -15
#define Z_JERK_MAX 500
#define Z_JERK_HIGH_SPEED 1000
#define Z_HOMING_INPUT 3
#define Z_HOMING_DIRECTION 1
#define Z_SEARCH_VELOCITY (Z_VELOCITY_MAX * 0.66666)
#define Z_LATCH_VELOCITY 25
#define Z_LATCH_BACKOFF 4
#define Z_ZERO_BACKOFF 2
//*** Input / output settings ***
/*
@@ -194,38 +196,37 @@
#define PROBING_INPUT 5
#define DI1_POLARITY IO_ACTIVE_HIGH
#define DI1_POLARITY IO_ACTIVE_HIGH
// #define DI1_ACTION INPUT_ACTION_LIMIT
#define DI1_ACTION INPUT_ACTION_NONE
#define DI1_ACTION INPUT_ACTION_NONE
#define DI2_POLARITY IO_ACTIVE_HIGH
#define DI2_POLARITY IO_ACTIVE_HIGH
// #define DI2_ACTION INPUT_ACTION_LIMIT
#define DI2_ACTION INPUT_ACTION_NONE
#define DI2_ACTION INPUT_ACTION_NONE
#define DI3_POLARITY IO_ACTIVE_HIGH
//#define DI3_ACTION INPUT_ACTION_LIMIT
#define DI3_ACTION INPUT_ACTION_NONE
#define DI3_POLARITY IO_ACTIVE_HIGH
// #define DI3_ACTION INPUT_ACTION_LIMIT
#define DI3_ACTION INPUT_ACTION_NONE
#define DI4_POLARITY IO_ACTIVE_HIGH
//#define DI4_ACTION INPUT_ACTION_LIMIT
#define DI4_ACTION INPUT_ACTION_NONE
#define DI4_POLARITY IO_ACTIVE_HIGH
// #define DI4_ACTION INPUT_ACTION_LIMIT
#define DI4_ACTION INPUT_ACTION_NONE
#define DI5_POLARITY IO_ACTIVE_LOW // Z probe
#define DI5_ACTION INPUT_ACTION_NONE
#define DI5_POLARITY IO_ACTIVE_LOW // Z probe
#define DI5_ACTION INPUT_ACTION_NONE
#define DI6_POLARITY IO_ACTIVE_HIGH
//#define DI6_ACTION INPUT_ACTION_LIMIT
#define DI6_ACTION INPUT_ACTION_NONE
#define DI6_POLARITY IO_ACTIVE_HIGH
// #define DI6_ACTION INPUT_ACTION_LIMIT
#define DI6_ACTION INPUT_ACTION_NONE
#define DI7_ENABLED IO_DISABLED
#define DI7_ACTION INPUT_ACTION_NONE
#define DI7_ENABLED IO_DISABLED
#define DI7_ACTION INPUT_ACTION_NONE
#define DI8_ENABLED IO_DISABLED
#define DI8_ACTION INPUT_ACTION_NONE
#define DI9_ENABLED IO_DISABLED
#define DI9_ACTION INPUT_ACTION_NONE
#define DI8_ENABLED IO_DISABLED
#define DI8_ACTION INPUT_ACTION_NONE
#define DI9_ENABLED IO_DISABLED
#define DI9_ACTION INPUT_ACTION_NONE
// *** PWM SPINDLE CONTROL ***
@@ -257,7 +258,7 @@
*/
#define P1_PWM_FREQUENCY 100000 // in Hz
#define P1_CW_SPEED_LO 1 // in RPM (arbitrary units)
#define P1_CW_SPEED_LO 1 // in RPM (arbitrary units)
#define P1_CW_SPEED_HI 24000
#define P1_CW_PHASE_LO 0.05 // phase [0..1]
#define P1_CW_PHASE_HI 1.0
+267
View File
@@ -0,0 +1,267 @@
/*
* settings_smw3d_r7.h - SMW3d r7 machine with VFD
* This file is part of the g2core project
*
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
*
* This file ("the software") is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 as published by the
* Free Software Foundation. You should have received a copy of the GNU General Public
* License, version 2 along with the software. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, you may use this file as part of a software library without
* restriction. Specifically, if other files instantiate templates or use macros or
* inline functions from this file, or you compile this file and link it with other
* files to produce an executable, this file does not by itself cause the resulting
* executable to be covered by the GNU General Public License. This exception does not
* however invalidate any other reasons why the executable file might be covered by the
* GNU General Public License.
*
* THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/***********************************************************************/
/**** Shapeoko2 500mm profile ******************************************/
/***********************************************************************/
// ***> NOTE: The init message must be a single line with no CRs or LFs
#define INIT_MESSAGE "Initializing configs to SMW3d r7"
//**** GLOBAL / GENERAL SETTINGS ******************************************************
// Machine configuration settings
#define JUNCTION_INTEGRATION_TIME 0.75 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.01 // chordal tolerance for arcs (in mm)
#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 0 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 1 // 0=off, 1=on
#define SPINDLE_ENABLE_OUTPUT_NUMBER 1
#define SPINDLE_ENABLE_POLARITY 1 // 0=active low, 1=active high
#define SPINDLE_DIRECTION_OUTPUT_NUMBER 2
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_SPINUP_DELAY 1.0
#define SPINDLE_PWM_NUMBER 3
#define SECONDARY_PWM_OUTPUT_NUMBER 0 // disabled
#define COOLANT_MIST_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_FLOOD_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_PAUSE_ON_HOLD false
#define FLOOD_ENABLE_OUTPUT_NUMBER 0 // disabled
#define MIST_ENABLE_OUTPUT_NUMBER 4 // "coolant enable"
// Communications and reporting settings
#define USB_SERIAL_PORTS_EXPOSED 1 // 1=single endpoint usb, 2=dual endpoint usb
#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
#define XIO_ENABLE_FLOW_CONTROL FLOW_CONTROL_RTS // FLOW_CONTROL_OFF, FLOW_CONTROL_RTS
#define TEXT_VERBOSITY TV_VERBOSE // one of: TV_SILENT, TV_VERBOSE
#define JSON_VERBOSITY JV_MESSAGES // one of: JV_SILENT, JV_FOOTER, JV_CONFIGS, JV_MESSAGES, JV_LINENUM, JV_VERBOSE
#define QUEUE_REPORT_VERBOSITY QR_OFF // one of: QR_OFF, QR_SINGLE, QR_TRIPLE
#define STATUS_REPORT_VERBOSITY SR_FILTERED // one of: SR_OFF, SR_FILTERED, SR_VERBOSE
#define STATUS_REPORT_MIN_MS 100 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable
//#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","posa","feed","vel","unit","coor","dist","admo","frmo","momo","stat"
#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","feed","vel","momo","stat"
// Alternate SRs that report in drawable units
//#define STATUS_REPORT_DEFAULTS "line","vel","mpox","mpoy","mpoz","mpoa","coor","ofsa","ofsx","ofsy","ofsz","dist","unit","stat","homz","homy","homx","momo"
//#define STATUS_REPORT_DEFAULTS "_ts1","_cs1","_es1","_xs1","_fe1","line","posx","posy","posz","vel","stat"
// Gcode startup defaults
#define GCODE_DEFAULT_UNITS MILLIMETERS // MILLIMETERS or INCHES
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_DISTANCE_MODE
// *** motor settings ************************************************************************************
#define MOTOR_POWER_MODE MOTOR_POWERED_IN_CYCLE // default motor power mode (see cmMotorPowerMode in stepper.h)
#define MOTOR_POWER_TIMEOUT 2.00 // motor power timeout in seconds
#define M1_MOTOR_MAP AXIS_X // 1ma
#define M1_STEP_ANGLE 1.8 // 1sa
#define M1_TRAVEL_PER_REV 8.0934060625 // 1tr
#define M1_MICROSTEPS 64 // 1mi 1,2,4,8,16,32
#define M1_POLARITY 1 // 1po 0=normal, 1=reversed
#define M1_POWER_MODE MOTOR_ALWAYS_POWERED // 1pm TRUE=low power idle enabled
#define M1_POWER_LEVEL 0.500
#define M2_MOTOR_MAP AXIS_Y
#define M2_STEP_ANGLE 1.8
#define M2_TRAVEL_PER_REV 8.0934060625
#define M2_MICROSTEPS 64
#define M2_POLARITY 0
#define M2_POWER_MODE MOTOR_ALWAYS_POWERED
#define M2_POWER_LEVEL 0.500
#define M3_MOTOR_MAP AXIS_Y
#define M3_STEP_ANGLE 1.8
#define M3_TRAVEL_PER_REV 8.0934060625
#define M3_MICROSTEPS 64
#define M3_POLARITY 0
#define M3_POWER_MODE MOTOR_ALWAYS_POWERED
#define M3_POWER_LEVEL 0.500
#define M4_MOTOR_MAP AXIS_Z
#define M4_STEP_ANGLE 1.8
#define M4_TRAVEL_PER_REV 8.0934060625
#define M4_MICROSTEPS 64
#define M4_POLARITY 1
#define M4_POWER_MODE MOTOR_ALWAYS_POWERED
#define M4_POWER_LEVEL 0.750
// *** axis settings **********************************************************************************
#define JERK_MAX 5000
#define X_AXIS_MODE AXIS_STANDARD // xam see canonical_machine.h cmAxisMode for valid values
#define X_VELOCITY_MAX 5000 // xvm G0 max velocity in mm/min
#define X_FEEDRATE_MAX X_VELOCITY_MAX // xfr G1 max feed rate in mm/min
#define X_TRAVEL_MIN 0 // xtn minimum travel for soft limits
#define X_TRAVEL_MAX 824 // xtm travel between switches or crashes
#define X_JERK_MAX 3500 // xjm jerk * 1,000,000
#define X_JERK_HIGH_SPEED 20000 // xjh
#define X_HOMING_INPUT 1 // xhi input used for homing or 0 to disable
#define X_HOMING_DIRECTION 1 // xhd 0=search moves negative, 1= search moves positive
#define X_SEARCH_VELOCITY 2000 // xsv minus means move to minimum switch
#define X_LATCH_VELOCITY 100 // xlv mm/min
#define X_LATCH_BACKOFF 4 // xlb mm
#define X_ZERO_BACKOFF 2 // xzb mm
#define Y_AXIS_MODE AXIS_STANDARD
#define Y_VELOCITY_MAX 5000
#define Y_FEEDRATE_MAX Y_VELOCITY_MAX
#define Y_TRAVEL_MIN 0
#define Y_TRAVEL_MAX 781
#define Y_JERK_MAX 3500
#define Y_JERK_HIGH_SPEED 20000
#define Y_HOMING_INPUT 2
#define Y_HOMING_DIRECTION 1
#define Y_SEARCH_VELOCITY 2000
#define Y_LATCH_VELOCITY 100
#define Y_LATCH_BACKOFF 4
#define Y_ZERO_BACKOFF 2
#define Z_AXIS_MODE AXIS_STANDARD
#define Z_VELOCITY_MAX 1200
#define Z_FEEDRATE_MAX Z_VELOCITY_MAX
#define Z_TRAVEL_MAX 75
#define Z_TRAVEL_MIN -15
#define Z_JERK_MAX 500
#define Z_JERK_HIGH_SPEED 1000
#define Z_HOMING_INPUT 3
#define Z_HOMING_DIRECTION 1
#define Z_SEARCH_VELOCITY (Z_VELOCITY_MAX * 0.66666)
#define Z_LATCH_VELOCITY 25
#define Z_LATCH_BACKOFF 4
#define Z_ZERO_BACKOFF 2
//*** Input / output settings ***
/*
IO_MODE_DISABLED
IO_ACTIVE_LOW aka NORMALLY_OPEN
IO_ACTIVE_HIGH aka NORMALLY_CLOSED
INPUT_ACTION_NONE
INPUT_ACTION_STOP = 1 - stop at normal jerk - preserves positional accuracy
INPUT_ACTION_FAST_STOP = 2 - stop at high jerk - preserves positional accuracy
INPUT_ACTION_HALT = 3 - stop immediately - not guaranteed to preserve position
INPUT_ACTION_CYCLE_START = 4 - start / restart cycle after feedhold (RESERVED)
INPUT_ACTION_ALARM = 5 - initiate an alarm. stops everything immediately - preserves position
INPUT_ACTION_SHUTDOWN = 6 - initiate a shutdown. stops everything immediately - does not preserve position
INPUT_ACTION_PANIC = 7 - initiate a panic. stops everything immediately - does not preserve position
INPUT_ACTION_RESET = 8 - reset system
INPUT_ACTION_LIMIT = 9 - limit switch processing
INPUT_ACTION_INTERLOCK = 10 - interlock processing
*/
#define PROBING_INPUT 5
#define DI1_POLARITY IO_ACTIVE_HIGH
// #define DI1_ACTION INPUT_ACTION_LIMIT
#define DI1_ACTION INPUT_ACTION_NONE
#define DI2_POLARITY IO_ACTIVE_HIGH
// #define DI2_ACTION INPUT_ACTION_LIMIT
#define DI2_ACTION INPUT_ACTION_NONE
#define DI3_POLARITY IO_ACTIVE_HIGH
//#define DI3_ACTION INPUT_ACTION_LIMIT
#define DI3_ACTION INPUT_ACTION_NONE
#define DI4_POLARITY IO_ACTIVE_HIGH
//#define DI4_ACTION INPUT_ACTION_LIMIT
#define DI4_ACTION INPUT_ACTION_NONE
#define DI5_POLARITY IO_ACTIVE_HIGH // Z probe
#define DI5_ACTION INPUT_ACTION_NONE
#define DI6_POLARITY IO_ACTIVE_HIGH
//#define DI6_ACTION INPUT_ACTION_LIMIT
#define DI6_ACTION INPUT_ACTION_NONE
#define DI7_ENABLED IO_DISABLED
#define DI7_ACTION INPUT_ACTION_NONE
#define DI8_ENABLED IO_DISABLED
#define DI8_ACTION INPUT_ACTION_NONE
#define DI9_ENABLED IO_DISABLED
#define DI9_ACTION INPUT_ACTION_NONE
// *** PWM SPINDLE CONTROL ***
/* VFD settings:
P0 settings need to be changed:
P0-000 = 1 (Select command source = Analog terminal control)
P0-001 = 3 (Select frequency source = maxMain frequency source xAssistant frequency source y))
P0-002 = 2 (Main frequency source x selection = AIN1)
P0-007 = 400
P0-024 = 400 (set maximum frequency at 100%)
For run/stop and direction control:
P0-016 = 1 (factory) (X1 terminal function = forward run)
P0-017 = 2 (factory was 24) (X2 terminal function = reverse run)
P0-020 = 1 (2-wire mode = 2)
P0-021 = 0 (set minimum input)
P0-022 = 0 (set minimum speed)
Disconnect X1, X2, set P0-24 to 10, and P0-023 to 10, and read the monitor,
then set the g2 to 100% output (via M3 or direct json), then use the shown value for P0-23
P0-023 = 9.22 for me (set maximum input voltage)
X1 = running
X2 = reverse direction (low = forward)
*/
#define SPINDLE_SPEED_CHANGE_PER_MS 4 // 20k RPM in 5 seconds
#define P1_PWM_FREQUENCY 100000 // in Hz
#define P1_CW_SPEED_LO 1 // in RPM (arbitrary units)
#define P1_CW_SPEED_HI 24000
#define P1_CW_PHASE_LO 0.05 // phase [0..1]
#define P1_CW_PHASE_HI 1.0
#define P1_CCW_SPEED_LO 1
#define P1_CCW_SPEED_HI 24000.0
#define P1_CCW_PHASE_LO 0.05
#define P1_CCW_PHASE_HI 1.0
#define P1_PWM_PHASE_OFF 0.0
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
# Define function to print colored text
print_message () {
if [ $# -eq 2 ]; then
color=$1
message=$2
else
color="default"
message=$1
fi
case $color in
"red")
echo -e "\033[0;31m$message\033[0m"
;;
"green")
echo -e "\033[0;32m$message\033[0m"
;;
*)
echo $message
;;
esac
}
# Print message to indicate entering bootloader mode
print_message "green" "Entering G2Core into bootloader mode..."
# List available serial ports and prompt user to select a port
serial_ports=($(ls /dev/ttyACM*))
if [ ${#serial_ports[@]} -eq 0 ]; then
print_message "red" "No serial ports found. Make sure your device is connected and try again."
exit 1
fi
while true; do
print_message "default" "Select the serial port to use:"
for i in "${!serial_ports[@]}"; do
echo "$((i+1)). ${serial_ports[$i]}"
done
echo -n "Enter the number of the serial port to use: "
read port_number
# Check that the user entered a valid number
if [[ ! "$port_number" =~ ^[0-9]+$ ]]; then
print_message "red" "Invalid port number: $port_number"
elif [ $port_number -lt 1 ] || [ $port_number -gt ${#serial_ports[@]} ]; then
print_message "red" "Invalid port number: $port_number"
else
break
fi
done
# Construct the serial port path from the selected number
serial_port=${serial_ports[$((port_number-1))]}
# Set the baud rate on the selected serial port
stty -F "$serial_port" 1200 hup
stty -F "$serial_port" 9600
# Print message to flash the board
print_message "green" "G2core on port $serial_port should now be in bootloader mode. Execute this command:"
print_message "green" "bossac --port=$serial_port -u=true -e -w -v -i -b -R <path-to-board>/g2core.bin"
print_message "green" "to flash your g2core board."