Lydia - Printhead
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
config.h
Go to the documentation of this file.
1
#ifndef CONFIG_H
2
#define CONFIG_H
3
4
#include <Arduino.h>
5
#include <stdint.h>
6
8
//
9
// Platform
10
11
// #define PLATFORM_PORTENTA_H7_M7
12
// #define BOARD_NAME "Portenta H7 M7"
13
#define PLATFORM_CONTROLLINO_MEGA
14
15
#ifdef PLATFORM_PORTENTA_H7_M7
16
#include <Arduino_MachineControl.h>
17
using namespace
machinecontrol;
18
#endif
19
20
#ifdef PLATFORM_CONTROLLINO_MEGA
21
#include <Controllino.h>
22
#endif
23
25
//
26
// App Features
27
28
#define HAS_EXTRUDER_FEED
29
#define MODBUS_BRIDGE
30
31
// App Debugging (see more in)
32
33
// Print the Modbus registers on startup
34
#define PRINT_MODBUS_REGISTERS 1
35
36
// When printing Modbus registers (via serial), print register descriptions
37
#define HAS_MODBUS_REGISTER_DESCRIPTIONS 1
38
40
//
41
// Status Feedback Settings
42
43
#define HAS_STATUS
44
#define STATUS_WARNING_PIN CONTROLLINO_R12
45
#define STATUS_ERROR_PIN CONTROLLINO_R13
46
#define STATUS_BLINK_INTERVAL 800
47
49
//
50
// Serial Port Settings
52
#define SERIAL_BAUD_RATE 19200
53
54
#define SERIAL_COMMAND_PARSE_INTERVAL 100
55
57
//
58
// Features - Modbus
59
60
#ifdef MODBUS_BRIDGE
61
static
uint8_t
mac
[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x03};
62
static
uint8_t
ip
[] = {192, 168, 1, 177};
63
static
uint8_t
gateway
[] = {192, 168, 1, 1};
64
static
uint8_t
subnet
[] = {255, 255, 255, 0};
65
#endif
66
68
//
69
// Motor load settings, this requires a current sensor or can be
70
// taken from the VFD's output.
71
72
// Motor overload pin, if defined, this will be used to detect jamming
73
// On an OmronM2X :
74
// - set the output via C21 (for output pin 11) to 03 for
75
// - set C28 = 01 (Output Current) (../vendor/omron/mx2/I570-E2-02B.pdf Page - 252)
76
// 'Overload' (which is set in C41 )
77
//
78
// See wiring details ../vendor/omron/mx2/I570-E2-02B.pdf Page - 52
79
80
#define MOTOR_LOAD_PIN CONTROLLINO_A4
81
83
//
84
// Modbus - Commons
85
86
#define MODBUS_RS485_BAUDRATE 19200
87
#define MODBUS_RS485_PORT SERIAL_8N1
88
#define MODBUS_RS485_TIMEOUT 2000
89
90
#define MODBUS_SAME_REQUEST_INTERVAL 1000
91
#define MODBUS_QUEUE_MIN_FREE 2
92
94
//
95
// Omron Pids - E5.x series - Modbus interface
96
97
#define NB_OMRON_PIDS 2
98
#define OMRON_PID_SLAVE_START 4
99
#define OMRON_PID_UPDATE_INTERVAL 55
100
#define OMRON_PID_WRITE_INTERVAL 150
101
#define OMRON_PID_MAX_TEMPERATURE 280
102
#define OMRON_PID_READ_STATUS_REGISTERS 7
103
105
//
106
// Modbus settings - Omron - MX2
107
108
#define OMRON_MX2_SLAVE_ID 1
109
#define OMRON_MX2_STATE_INTERVAL 60
110
#define OMRON_MX2_MB_INTERVAL 60
111
#define OMRON_MX2_DEBUG_INTERVAL 100
112
#define OMRON_MX2_LOOP_INTERVAL 60
113
#define OMRON_MX2_SAME_REQUEST_INTERVAL 400
114
115
#define OMRON_VFD_MAX_FREQ 100
116
#define VFD_RETRACT_REVERSE_DURATION 1000
117
119
//
120
// Auxiliary Settings : Relays
121
122
#ifdef PLATFORM_PORTENTA_H7_M7
123
#define MB_RELAY_0 0
124
#define MB_RELAY_1 1
125
#define MB_RELAY_2 2
126
#define MB_RELAY_3 3
127
#define MB_RELAY_4 4
128
#define MB_RELAY_5 5
129
#define MB_RELAY_6 6
130
#define MB_RELAY_7 7
131
#endif
132
133
#ifdef PLATFORM_CONTROLLINO_MEGA
134
#define MB_RELAY_0 CONTROLLINO_R10
135
#define MB_RELAY_1 CONTROLLINO_R11
136
#define MB_RELAY_2 CONTROLLINO_R02
137
#define MB_RELAY_3 CONTROLLINO_R03
138
#define MB_RELAY_4 CONTROLLINO_R04
139
#define MB_RELAY_5 CONTROLLINO_R05
140
#define MB_RELAY_6 CONTROLLINO_R06
141
#define MB_RELAY_7 CONTROLLINO_R07
142
#endif
143
144
#define MB_RELAY_0_DEFAULT 1
145
#define MB_RELAY_1_DEFAULT 0
146
//
148
// Auxiliary Settings : Analog Inputs
149
150
#ifdef PLATFORM_PORTENTA_H7_M7
151
#define MB_ANALOG_0 0
152
#define MB_ANALOG_1 1
153
#define MB_ANALOG_2 2
154
#endif
155
156
#ifdef PLATFORM_CONTROLLINO_MEGA
157
#define MB_ANALOG_0 CONTROLLINO_A0
158
#define MB_ANALOG_1 CONTROLLINO_A1
159
// #define MB_ANALOG_2 CONTROLLINO_A2
160
#endif
161
163
//
164
// Auxiliary Settings : Analog Switch Inputs (3 Position Switches)
165
//
166
#ifdef PLATFORM_PORTENTA_H7_M7
167
#define MB_ANALOG_3POS_SWITCH_0 0
168
#define MB_ANALOG_3POS_SWITCH_1 1
169
#define MB_ANALOG_3POS_SWITCH_2 2
170
#define MB_ANALOG_3POS_SWITCH_3 3
171
#endif
172
173
#ifdef PLATFORM_CONTROLLINO_MEGA
174
#define MB_ANALOG_3POS_SWITCH_0 CONTROLLINO_A10
175
#define MB_ANALOG_3POS_SWITCH_1 CONTROLLINO_A11
176
#define MB_ANALOG_3POS_SWITCH_2 CONTROLLINO_A12
177
#define MB_ANALOG_3POS_SWITCH_3 CONTROLLINO_A13
178
#endif
179
181
//
182
// Auxiliary Settings : Stepper / PWM - 2 Wire
183
//
184
#ifdef PLATFORM_PORTENTA_H7_M7
185
#define MB_ANALOG_3POS_SWITCH_0 0
186
#define MB_ANALOG_3POS_SWITCH_1 1
187
#define MB_ANALOG_3POS_SWITCH_2 2
188
#define MB_ANALOG_3POS_SWITCH_3 3
189
#endif
190
191
#ifdef PLATFORM_CONTROLLINO_MEGA
192
#define MB_STEPPER_DIR_0 CONTROLLINO_D18
193
#define MB_STEPPER_PULSE_0 CONTROLLINO_D17
194
#define MB_STEPPER_OVERLOAD_0 CONTROLLINO_A5
195
#define MB_STEPPER_ENABLED_0 CONTROLLINO_D15
196
#define MB_STEPPER_FEEDBACK_0 CONTROLLINO_D16
197
198
// see ./config_adv.h for more settings
199
#endif
200
201
// Turn on Extruder-Feed (using stepper_0)
202
#define HAS_FEED_SERVO
203
204
// Extruder Feed Coupling to VFD Speed
205
// Range : 0 - 100 (Percentage, Modbus has no floats ...)
206
#define MB_RW_FEED_VFD_DEFAULT_SPEED_RATIO 90
207
209
210
#include "
config_adv.h
"
211
#include "
debug_config.h
"
212
#include "
config_validation.h
"
213
214
#endif // CONFIG_H
debug_config.h
config_adv.h
mac
static uint8_t mac[]
Definition:
config.h:61
ip
static uint8_t ip[]
Definition:
config.h:62
config_validation.h
gateway
static uint8_t gateway[]
Definition:
config.h:63
subnet
static uint8_t subnet[]
Definition:
config.h:64
firmware
firmware_v2_cm
config.h
Generated by
1.8.17