After measuring the frequency I get a 3 Byte variable (unsigned long freq) an I want to printed via serial monitor. But only the lower 16 bits are printed. I guess the binary to decimal routine uses only 16 bit even when the variable is declared long. How can I manage to get all 24 bits converted and printed?
When I just print the value direct it is correctly displayed.
When I use formated printing with sprintf the result is wrong. It seems that sprintf %d only works on the least significant bytes of the 4 byte long value. The sprintf works ok for number below 32767 (0X7FFF).
compiles to 2592 bytes. While sprintf() is a very powerful function, rarely does one program use a significant fraction of that power. In most cases, you can accomplish the same end result with other C functions and save a noticeable chunk of memory in the process.
I want to print out some hex values longer than 4 hex values long. I'm following a thread from a decade ago and it works perfectly up until 4 values. And recommendations on how to fix this in my code? I know that the value is actually being written into memory properly. I just can't write to Serial correctly. Currently it's chopping off any value above bit 4.
Long story short. The "X" parameter is just another reference to unsigned int. Changing the number of bytes requested doesn't change the bits written. "l" is for long. So effectively I needed to print a long int instead of just int.
I think I'd like to see leading zeroes in the format specifier, at least for the least significant part (see reply #8) - your example may work with the data given, but could give misleading results for other values.
Im working on an autonomous sailing drone. Ive connected my Arduino to my pixhawk and tried to collect GPS and attitude data via Mavlink. After a long time Ive managed to finally get the GPS lat and long data but struggle with yaw, roll and pitch. Serial.print shows me yaw and pitch: nan (not a number) and roll: 0.00.
My issue is that, with a larger surface on the bottom of my prints, a large part can be smooth, but the bottom surface is not uniform. I'm working on something where it would be a lot easier if I could have a smooth bottom surface to use as the visible part of a faceplate. While this isn't what I'm trying to print, it's a good example of my issue:
I had a similar issue with a much larger piece I was trying to print and it was warping. I solved the warping with glue. That was discussed in this thread and here's a shot of the bottom of the piece that warped:
That piece took a LONG time to print, so before I adjusted the print speed to slow it up, I just used glue and that kept it from warping. It's now mounted where I can't easily remove it and inspect the back at this point.
I got good advice in the thread I linked to, but this is slightly different, so I wanted to address it in a different topic. I'm not having the warp issue with my smaller pieces, but I am getting that uneven surface. Aside from using glue or another adhesive to help the filament stick to the print bed, what other things should I do to address the issue of an uneven bottom layer? Or is that and the warping all part of the same issue?
When I first got my printer, I found the same issue. Had issues trying to do the first layer calibration as the measurements were all over the place. Just did the silicone mod to my printer. I also found that the distortion of the build plate changed with the temperature of the plate. I used OctoPrint and the Bed Visualizer plugin. The errors before were about 0.5mm. Now less than 0.1mm in the center. My procedure it to preheat for at least 15 minutes before printing.
If this is not enough and if the design is yours, try making the bottom a little thinner and break up any long stringers that run the length of the part higher up where they otherwise exert huge forces as the part contracts in cooling.
It took me a while to get back to this thread because I wanted to try multiple different things to see what worked. I have yet to do the silicone mod, but I will be doing that. (I was hoping I'd get to that before I replied, but it's going to be a good while...) I have used adhesive and that was a major help. It's not a 100% and perfect solution, but it's pretty good.
No drafts, but I can't increase the temp since I'm often printing unattended with long prints where I just can't sit there and wait (and have a space heater on) and I'd have to increase the temp for the entire 2nd floor of the barn, so that one is out, but I may try some experiments with a space heater for the first few layers and see if that helps.
Without knowing how cold your barn is, it is hard to give suggestions. If it is cold enough, what you many not perceive as a draft, may be more than enough to cause problems with printing. The bed moving back and forth will cause a draft that you may not notice. Where I used to work, we had a 3D printer in one area. The temperature would fluctuate but no real draft. All kinds of issues with printing long prints. Finally, I convinced the people running the printer to put it in a cardboard box as a test. It worked and when I left, years later, the box was still over that printer. All the new printers were ordered with enclosures.
You may need to try the cardboard box idea for winter. I ordered an enclosure for my printer when I ordered the printer, partly due to my experience at work and to help control dust in my workshop. There are times when I have to clean my rods once a week due to dust so I am looking at how to seal the enclosure and filter all air going into it.
I didn't add any nuts to my mod. I put some Loctite 242 (off brand version) into the thread for the screws and just used some silicone tube. What delayed me was trying to get everything to zero. Won't happen since the head never goes to zero due to the head offset. Also I found, that the bed heating changed the settings.
I drew up and printed an angle gauge out of ASA so I didn't have to cool the bed down when I wanted to adjust the screws. I had printed out of PETG and that started to melt when adjusting since the bed temperature was close to the glass temperature of the PETG. I also created a spread sheet to arrange the numbers and make the degree calculations easier.
The operating range is 18C - 38C: are temperatures overnight dropping below this? If you are printing in a barn drafts are very likely... Try the cardboard box trick suggested by @robin_13, start the print and lower the box over the whole lot. There is no need to sit and wait; raise the temperature, and perhaps the bed temperature, in the slicer.
I understand the concern about the cardboard box over a printer and my print head went into thermal runaway earlier this year and melted. I was in attendance when it happened but the temperature on the display said everything was normal. it was hot enough to damage my SuperPinda.
I have done tests on starting fire to cardboard, and you need high temperatures to do that. Higher than your print head should be running. If your print head gets to a point of heating up the cardboard and starting it on fire, you will have the same issues without the cardboard. My printer enclosure gets to upper 30s when printing with PETG and ASA but not higher.
If not feeling safe with cardboard, make a box out of wood with a door. Many people run their printers in Ikea cabinets and don't think about it. Or a piece of sheet metal for the top. Many people use cardboard boxes for their 3D printers.
As I said, where I worked, the printer has been under a cardboard box for years and has done overnight prints with no one around. There box was built so it could be opened up to access the printer. I wish I had pictures. The 3D printer is an AirWolf.
@Robin_13 I agree that a cardboard box is probably safe as long as nothing bad happens to the printer. But if something bad does happen you just gave that small fire a large paper box to burn in a barn.
I am 100% in agreement on the fire risk since I have had a head melt due to a bad thermistor. New thermal model is supposed to prevent that but I am not sure about that since it depends on the thermistor that may be faulty. I am looking at some of the OctoPrint stuff to read thermistors and put a thermistor in the enclosure to measure ambient temperature. Also looking at having one right by the print head to do a second temperature around the head. If out of limits, shut the power down.
If I cannot get OctoPrint to do that, then I will build an Arduino controller to do that. I have read about some automatic kitchen fire extinguishers that people have used for their 3D printers. They can be ordered on Amazon. There is a fire suppression add-on for the Prusa enclosure that you can purchase for added safety. I may get one with my next Prusa order. That may be the best option.
Cooling near the bed is a bad idea. Using the OctoPrint bed levelling plug-in, I found out that heating the bed does change its shape. If I was going to put vent holes in, I would have them closer to the top than the bottom. Above the majority of the print height.