ThomasHeb / 4AxisFoamCutter

Arduino based CNC foam cutter with display and SD-Card
14 stars 8 forks source link

Code is not running #10

Closed LarsBrinck closed 3 years ago

LarsBrinck commented 3 years ago

Hi Thomas, AFter succesful uploading...nothing happens. Having verified the hardware setup using the rrd-glcd-test (found here on github) I´m quite lost. Screen background lights up but nothing happens. I can´t communicate through the serial monitor (?,§,! etc) - no response. I´ve tried to insert some Serial.print lines, buzzer etc in the code to get some idea of where the code stucks but no luck. (I have put 4 jumpers on X-/X+/Y-/Y+ and disabled limit switches and buttons in the config.h)

Any idea of how to debug or to pin down the problem?

ThomasHeb commented 3 years ago

Hi Lars,

the board must open the display and show a welcome screen and wait for a button/jog... or go to an error screen (limit switch or estop).... but it must show something and communication must work in the welcome screen.... i tested this two days ago with arduino / ramps / display and no other hardware and no modifications on the ramps. What board/arduino do you have? What size of code did you have? ROM 65586 Byte / 25%, RAM 5788 / 70%

I am a bit worried, that still some conflict with the libraries exist...

Appending a hex file, check out xloader for direct download https://www.hobbytronics.co.uk/arduino-xloader

If that is not working, I can setup a test-script tomorrow

Regards Thomas

FoamCutter.hex.zip

LarsBrinck commented 3 years ago

I´m off to work right now but can test this tomorrow night or the day after (sun). I have one cheap chinese arduino copy (12MHz!?) and one (expensive) original 16MHz arduino - I´ve tested both with same result.

I´ll be back as soon as I´ve tested.

Thanks for your help! /Lars

ThomasHeb commented 3 years ago

Hi Lars,

do you have some programming experience on arduino? Just asking from where I should start the test scripts. which type of ramps are you using? a had no problems with the one I bought first, the second one did not work at all, until I found a cold soldering connection on a 12V pin from ramps to arduino.

Regards Thomas

LarsBrinck commented 3 years ago

I got some basic experience doing a midi controller on a teensy making code snippets to make endless encoders behave ok, but that´s all. In this project I have called in support from a more experienced friend :)

Code size: "Sketch uses 67348 bytes (26%) of program storage space. Maximum is 253952 bytes. Global variables use 6071 bytes (74%) of dynamic memory, leaving 2121 bytes for local variables. Maximum is 8192 bytes."

I can´t see any manufacturing data on the ramps board - I bought it from banggood so it is probably a chinese copy. But if I upload the code to the arduino without the ramps board connected, I should be able to communicate with it through the serial monitor using grbl commands -or not?

Seems to me as the arduino gets "bricked"...

Regs, /Lars

ThomasHeb commented 3 years ago

Hi Lars,

yes, good idea. Disconnect the Ramps. If your download is working without any error, you should be able to communicate....

ok, let's start from the beginning:

Second Excample

Third Test

If possible download the hex file from my last post to your arduino with loader

Regards Thomas

LarsBrinck commented 3 years ago

Thx for your input!

Success uploading the .hex file to both Arduinos. Grbl commands show up and both Arduinos makes the display run through my Ramps board so that seems to be working so far. (The endless encoder code needs rewriting but that is NOT the issue now. Lets see what we can do about that later:))

I tried to upload code from the IDE of a PC that I have borrowed since my Mac gets this avrdude:timeout() error. No luck. That compiled code does not work. I think your guess that there are some conflicting libraries are right. This PC has U8G2 ver 2.27.6 installed and SdFat - Adafruit Fork ver 1.2.3 installed

Perhaps it would be easier for me to start soldering buttons and limit switches - but it seems strange not to see the actual code running?

Where do we go from here? I´ll try to attach drivers and steppers later tonight.

CHeers! /Lars

ThomasHeb commented 3 years ago

These are good news! Nevertheless PC compiled source should work, too. Libs are correct.... so very strange....

Next steps are:

Regards Thomas

LarsBrinck commented 3 years ago

Hi Thomas, I thought I would make another attempt to compile the code on the PC. Two questions arise: 1 - In your folder "03Firmware" there are the "libraries" folder with the two libraries "SdFat-_Adafruit_Fork" and "U8g2". Apart from that (and the folder "Foamcutter")there is a folder named "Lib_8UG2" - is that folder or the files within needed anywhere?

//Edit - have you changed/deleted these instructions? I can´t find them anymore...???: //2 - You mention in your instructions that the "fonts.cpp"-file is missing in your U8G2 library and should be copy/pasted from //another U8G2 library. But the "fonts.cpp"-file is not missing in your library? Is this of any significance i.e. should I download //the U8G2a library and copy that "fonts.cpp"-file and replace the one in your U8G2 library?

Sorry for the confusion but I´m just trying to find out why your .hex file works and not your un-compiled files...

(I really don´t want to solder buttons...:))

/Lars

ThomasHeb commented 3 years ago

Hi Lars,

in the folder 03_Firmware is

Bildschirmfoto 2020-10-20 um 18 25 45

I think you want to wo rk with a version w/o buttons. appending the hex file Archiv.zip

LarsBrinck commented 3 years ago

WHOOOOPS SAW YOUR ANSWER ABOVE AFTER POSTING THIS ---- Maybe your post solves the answer...:)

Hi again, Made an attempt on the PC and the results were not so uplifting: With your U8G2 library it won´t compile - seems to be a font missing. With latest U8G2 library it compiles. And it compiles with both SdFat-Adafruit fork libraries, yours and 1.2.3.

BUT I get the following errors in the compiling window:

Skärmavbild 2020-10-20 kl  18 27 53

and the arduino gets bricked.

SO Would you like to compile a .hex file with buttons and limit switches set to 0 and I will try that?

OR Just tell me to start soldering those (/&%€%& buttons :):):)

/Lars

ThomasHeb commented 3 years ago

Hi Lars,

here we go.

Limit0_Button0.zip Limit1_Button0.zip

the error above may result from the missing u8g2_fonts.c - see above.

LarsBrinck commented 3 years ago

YES! It accepted the compiled code when I changed those two U8G2-files. Plus - I can now change limits and buttons and it still compiles and the code is accepted. When I set buttons to 0 the endless encoder started to work with the LCD screen. Happy Happy! Time to connect the steppers! Thanks for your support!

ThomasHeb commented 3 years ago

You are welcome! Have fun with the project and happy cutting