My newly ordered filastruder Duet2 board came in yesterday and I decided to install it today. I just knew it was going to fix my issue. I installed the new firmware, Got it connected to WiFi and traded my SD card with the one that came, hooked it all up and flipped the switch and.... DARN!! Same thing - Bed Temp fluctuating all over the place (within about 10c) So, I deducted my clone duet board was fine. Bright side: I now have a matching OEM Duet and Duex! I defiantly decided I was going to unplug every plug on the board, one at a time until I found the issue! As a test which I did several days before and it didn't make a difference, I connected another thermistor and left it hanging to the floor. The temp was perfectly stable. So, I began stripping the wires from the bed out of the wiring ducts with the fluctuating thermistor connected back up. nothing seemed to change it. I might mention I'm using a 120v silicone bed heater. I checked the thermistor to the bed for any stray voltage and found about 0.126 vac on the thermistor so I figured maybe some some inductance was going on but could never find it even after disconnecting most of the 120v bed wiring, I never disconnected the neutral from the bed heater. I also found about 4-6 vac between the bed heater frame and the earth ground. The bed frame is mounted in a kinematic setup so it floats on three points which the three bed leveling steppers are driving. I broke out the meter and started testing stuff. The bed frame is isolated as the meter showed infinity ohms from the bed frame to ground so I'm not sure where the stray voltage was coming from. I decided to try grounding the bed heater frame to ground and the temp stabilized perfectly. After the test, I ran a permanent ground to the bed frame, put it all back together and that fixed my issue. I plan to run grounds from all seven steppers as well since they are all mounting in plastic and add a few more here and there for good measure.
Hope this helps someone else.
Best posts made by wkellyo
-
RE: Why is my bed temp fluctuating around 10c without heat on?
-
RE: How can I control addressable RGB LEDS?
1RI, thank you so much for the information, I figured there was a way that even I could understand, this really helps a lot and I even have a few ESP32's laying around besides Nano's, Unos and even a few Mega Arduino's.
Latest posts made by wkellyo
-
RE: How can I control addressable RGB LEDS?
@Danal I guess the main goal was to have bed lighting color that I could change using DWC. Then the idea of interfacing it to the printer to change color depending on the printer status came to mind. I am fairly new to Arduino, Raspberry Pi, etc. and when it comes to coding, if I can't find an example to go by, modify, etc. I end up reaching out to others. I struggle to write from scratch and then only basic, simple stuff but I'm slowly learning. If I had a Duet3 board I'd look into the Dotstars instead. You mention these two Wireless type boards and I've seen them before but wasn't sure of being able to make them work for this or how to interface to the Duet. You also mention monitoring the printer status but I wouldn't really know where to begin. I'm always up for a challenge and if you know of better ways to do this please share with me. BTW you have a nice, well written web site, I spent the better part of an hour there a week or so ago!
-
RE: How can I control addressable RGB LEDS?
Hi, 1ri wrote the original code and shared with me. I added another color to the existing code, please see this this post and it should explain everything you need. If you need the files, let me know with a private IM and I'll get them to you.
https://forum.duet3d.com/topic/14411/gpio-pins-on-duex5-useage/10
-
RE: GPIO Pins on DUEX5 Useage
For anyone following this I got the Purple color to work perfectly and was sooo close
if (Value_pwm> 625 && Value_pwm <675) {Serial.println (Value_pwm); Serial.println ("Purple"); Purple ();} // M42 P0 S81 in the Duet
This code worked! I originally had an S79 but after taking @Danal advice I got the serial monitor working and studied it and found the PWM value was just a bit short of working. S81 in the code did the trick!
-
RE: GPIO Pins on DUEX5 Useage
@Danal Again, thanks for taking the time to help me. I've read about using the serial monitor, guess it's time to dig in and learn how to use it. I will be changing the Arduino Pin to A3 soon so I can use a 4 Pin shell housing to go from GND, VCC, skip, A3 with one plug. If you would like to see the printer in action Homing watch for the bed leds being in the Sleep mode then going full green while it's homing. After homing, they turn back to sleep. As soon as I get this ironed out, I'll be adding the GCodes to the files as we discussed in macro post. In the video you can see the light change for every direction due to having a "homeall.g file with nothing but pointers to the other homing files. I've rewritten the homeall.g with it's own code so the lights are on during the entire operation. Just looks cleaner to me.
-
RE: GPIO Pins on DUEX5 Useage
@Danal, Yes, it's a 5v pro mini and it's a one way direction from DUEX5 GPIO1 to Pin A2 Of the Pro Mini. I do have a 3.3 to 5v logic level converter device, I should put it in between? If I got a 3.3 v Pro Mini, I'd have more room to add PWM values?
Bottom line, I'm fairly new to Arduino and am trying to learn code. If you look at the first post of the code I've commented what each GCode does, I copied it in again below and bolded the GCodes and Colors. After I got it all working I thought I would try adding another color Purple. That code is bolded in the first post.What you are saying indicates that my guess of 625-675 is above the range. If you study the code I was trying to add (again just copying, pasting and altering the PWM in the same way the other codes are) It won't work. But, if I lower the PWM to say 600-620 or so It might work? If I tighten the ranges of the other colors I could also add more, keeping the last one under 624? I suppose if it's too tight, the arduino may not see the change? I studied the G42 write up but it wasn't clear enough for me. Thank you so much for replying, what you have said has helped me understand this even more.
if (Value_pwm> -1 && Value_pwm <100) {Serial.println (Value_pwm); Serial.println ("Sleep"); Standby ();} // M42 P0 S09 in Duet
if (Value_pwm> 125 && Value_pwm <175) {Serial.println (Value_pwm); Serial.println ("White"); White ();} // M42 P0 S20 in the Duet
if (Value_pwm> 200 && Value_pwm <250) {Serial.println (Value_pwm); Serial.println ("Red"); Red ();} // M42 P0 S29 in the Duet
if (Value_pwm> 275 && Value_pwm <325) {Serial.println (Value_pwm); Serial.println ("Green"); Green ();} // M42 P0 S39 in the Duet
if (Value_pwm> 350 && Value_pwm <400) {Serial.println (Value_pwm); Serial.println ("Blue"); Blue ();} // M42 P0 S49 in the Duet
if (Value_pwm> 425 && Value_pwm <475) {Serial.println (Value_pwm); Serial.println ("Off"); Off ();} // M42 P0 S58 in the Duet
if (Value_pwm> 525 && Value_pwm <575) {Serial.println (Value_pwm); Serial.println ("On"); On ();} // M42 P0 S68 in the Duet -
RE: GPIO Pins on DUEX5 Useage
What I have is GPIO1 of the Duex5 connected to Analog PIN "A2" of an Arduino Pro Mini. In Config.g, I have this to enable the GPIO pin: M950 P0 C"duex.gp1"
I have it all working and can change the addressable LED Lighting colors using the G Codes shown in the sketch code. I use the M42 command such as M42 P0 S20 which changes the LEDS to white. I've added Gcodes to some of the system files that run and the lights change depending on what the printer is doing.
Since I'm not a programmer, I'm not exactly sure what the code is doing when it references: if (Value_pwm> 200 && Value_pwm <250) but just guessing, its reading the PWM value that changes when sending the M42 command.
I was wondering how high I can go with the if (Value_pwm> xxx && Value_pwm <xxx) before exceeding the limits of the Duet System. As my earlier message said, I tried: if (Value_pwm> 625 && Value_pwm <675) without success. Either I goofed the code or sending the M42 P0 S79 didn't do anything. I also tried S73,4,5,6,7,8, and a few after that without success.
-
GPIO Pins on DUEX5 Useage
I use GPIO Pin1 on the DUEX5 to read a PWM value of the various functions of the printer using this Arduino Code which triggers NeoPixel LEDs for Bed Lights using macros and Gcode in the printer files. (I didn't write it A1r did).
My question is what is the min and max range of the PWM Values? These are millisecond values? I attempted to add another color using 625 -<675 as the PWM value and it didn't work. Is 575 as high as I can go? My added code is bolded below in the working code, please scroll down to see. I'm not asking for Arduino Coding just what the PWM range is.
The code below works:
// Command to change led scenarios: M42 P0 Sx (x in multiples of 10. Using GPIO Pin 1 on Duex5 Board)
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define delayLED 5
#define StandbyBrightness 30
#define LowBrightness 75
#define MidBrightness 127
#define HighBrightness 255
#define LED_COUNT 90Adafruit_NeoPixel strip = Adafruit_NeoPixel (LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
// Read pin, connected to pin P0 (GPIO1 on DUEX5) and duex.gp1 for RRF3
byte PWM_PIN = A2;
int Value_pwm;void setup () {
// Start LED strip
pinMode (PWM_PIN, INPUT);
Serial.begin (115200);
strip.begin ();
strip.setBrightness (255);// Initialize the strip
strip.show ();// Start orange sequence
for (int i = 0; i <LED_COUNT; i ++) {strip.setPixelColor (i, strip.Color (255,155,0));
strip.show ();
delay (delayLED);
}
}void loop () {
// Read the value of PWM_PIN and set it to Value_pwm
Value_pwm = pulseIn (PWM_PIN, HIGH);Serial.println (Value_pwm); // Submit the value to monitor sampled values
// comparison of stock strips to have sufficient clearance between stripe and stripe
if (Value_pwm> -1 && Value_pwm <100) {Serial.println (Value_pwm); Serial.println ("Sleep"); Standby ();} // M42 P0 S09 in Duet
if (Value_pwm> 125 && Value_pwm <175) {Serial.println (Value_pwm); Serial.println ("White"); White ();} // M42 P0 S20 in the Duet
if (Value_pwm> 200 && Value_pwm <250) {Serial.println (Value_pwm); Serial.println ("Red"); Red ();} // M42 P0 S29 in the Duet
if (Value_pwm> 275 && Value_pwm <325) {Serial.println (Value_pwm); Serial.println ("Green"); Green ();} // M42 P0 S39 in the Duet
if (Value_pwm> 350 && Value_pwm <400) {Serial.println (Value_pwm); Serial.println ("Blue"); Blue ();} // M42 P0 S49 in the Duet
if (Value_pwm> 425 && Value_pwm <475) {Serial.println (Value_pwm); Serial.println ("Off"); Off ();} // M42 P0 S58 in the Duet
if (Value_pwm> 525 && Value_pwm <575) {Serial.println (Value_pwm); Serial.println ("On"); On ();} // M42 P0 S68 in the DuetI added this under the above using S79 as the trigger. There is also another bit of code at the very bottom, scroll down:
// if (Value_pwm> 625 && Value_pwm <675) {Serial.println (Value_pwm); Serial.println ("Purple"); Purple ();} // M42 P0 S79 in the Duet
}
void Standby () {
// Sequentially put all the LEDs on Standby
strip.setBrightness (StandbyBrightness);
for (int i = 1; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (50,50,50));
strip.show ();
delay (delayLED);
}
while (Value_pwm> -1 && Value_pwm <100)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void White () {
// Sequentially set all LEDs to White
strip.setBrightness (HighBrightness);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (255,255,255));
strip.show ();
delay (delayLED);
}
while (Value_pwm> 125 && Value_pwm <175)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void Red () {
// Set all LEDs sequentially to Red
strip.setBrightness (MidBrightness);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (255,0,0));
strip.show ();
delay (delayLED);
}
while (Value_pwm> 200 && Value_pwm <250)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void Green () {
// Sequentially turn all LEDs to Green
strip.setBrightness (MidBrightness);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (0,255,0));
strip.show ();
delay (delayLED);
}
while (Value_pwm> 275 && Value_pwm <325)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void Blue () {
// Sequentially put all the LEDs to Blue
strip.setBrightness (MidBrightness);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (0,0,255));
strip.show ();
delay (delayLED);
}
while (Value_pwm> 350 && Value_pwm <400)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void Off () {
// Turn off all LEDs sequentially
strip.setBrightness (0);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (0,0,0));
strip.show ();
delay (delayLED);
}
strip.clear ();
while (Value_pwm> 425 && Value_pwm <475)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}
void On () {
// Sequentially turn on all the LEDs
strip.setBrightness (MidBrightness);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (255,128,0));
strip.show ();
delay (delayLED);
}
while (Value_pwm> 525 && Value_pwm <575)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
}My code was added end of the sketch.
void Purple () {
// Turns all LEDs sequentially
strip.setBrightness (0);
for (int i = 0; i <LED_COUNT; i ++) {
strip.setPixelColor (i, strip.Color (255,0,255));
strip.show ();
delay (delayLED);
}
strip.clear ();
while (Value_pwm> 625 && Value_pwm <675)
{Value_pwm = pulseIn (PWM_PIN, HIGH);
}
} -
RE: How do I trigger a macro during Certain Machine operations
Yes, I recognized that one as well. I make use of the mesh bed compensation and each time I run it, a new heightmap.csv file is created. Thanks!
-
RE: How do I trigger a macro during Certain Machine operations
Thanks so much Danal, that's quite a list of possible macros. This should definitely help me out. mrehorstdmd thanks for the tip about using the slicer I may try that as well but I was hoping to keep the printer and the light changes to itself so I don't have to do custom programming in the slicer. Its definitely an option though! Thanks!
-
RE: How do I trigger a macro during Certain Machine operations
Thanks Danal for the positive comments! As the video shows, the lights change to green when the printer is "calibrating" such as homing or bed leveling and after it's done, another GCode dims the lights back to an "Idle" color. I have GCode in the homeall.g file. I also have matching code in the Homez.g, homex.g and homey.g files. My bed lights run from a small arduino connected to a GPIO pin on the DUEX5 board and I'm using M42 to send commands to change the color.
Is it as simple as knowing which file is called during each operation? You mention a begin.g file, I don't have one with that name. Is there a Duet docs link that might explain more about all the various files I could make use of?Here are some other examples I would like to change color with:
When a print starts, which file could the GCode/macro be called from? I don't have a begin.g file....
When a print ends, my gcode would be called from stop.g?
When a print pauses, my gcode would be called from pause.g?
When a print resumes, my gcode would be called from resume.g?Maybe I was simply over analyzing this. I have about 5 colors I'd like to trigger depending on the printer's status.