Paciente8159 / uCNC

µCNC - Universal CNC firmware for microcontrollers
https://github.com/Paciente8159/uCNC/wiki
GNU General Public License v3.0
295 stars 64 forks source link

Nano 328p #782

Open Juank23 opened 4 days ago

Juank23 commented 4 days ago

Good morning, friend, download the ucnc firmware but I get this error, it is an arduino nano328p, stay tuned Nano

Paciente8159 commented 3 days ago

Hi there! Are you sure it's a 328p and not a 328pb? I was also surprised by my this on my Arduino Nano board. The chip says ATMEGA328P but the signature is actually from a ATMEGA328PB. These chips have populated the more recent Arduino UNO, mini and nano boards. Although they are both 328P they have some differences. For start the PB version as an additional HW UART port.

Try this:

Modify this line from extends = atmega328p to extends = atmega328pb

This requires that the Arduino Nano has the MiniCore bootloader.

Juank23 commented 3 days ago

Good day, I have an arduino nano 328p and one 328pu, the chip is smaller but it's the same, with grbl and vscode it goes up normal in any of the 2, here I send you a picture thank you IMG_20241120_114400 IMG_20241120_114407

Juank23 commented 3 days ago

I followed your instruction and now I get the following error E2

Paciente8159 commented 3 days ago

The thing is that the missmatch error you are having on your 328p is very odd. I never had any issue with my 328p on my arduino UNO.

I add signature issues with the Arduino Nano I got though. Here is a picture of mu Nano. 20241120_211928 It's actually an ATMEGA328PU.

This is what I did to get it to allow upload:

  1. I installed MiniCore on Arduino IDE
  2. Then with the help of my regular Arduino UNO (serving as a programmer) I installed the MiniCore (urboot) bootloader on the 328PU.
  3. After that I used the configuration on VSCode for the atmega328pb variant and all went as expected.

Here is the list of supported boards by the MiniCore

Juank23 commented 3 days ago

See now what it does E3

Paciente8159 commented 3 days ago

In that case (and since you now installed the MiniCore (urboot) try to change the board to Atmega328P to see if it works.

Like this. Change from this:

image

to this

image

Juank23 commented 3 days ago

I followed all your instructions but it didn't work. e4

Paciente8159 commented 2 days ago

You did not used the minicore config. Look at your line 33. It should end in 328pb and not 328p. Look at the images I sent you before.

You are trying to upload using arduino bootloader but your board (I assume ) has minicore urboot bootloader.

Paciente8159 commented 2 days ago

I've modified the avr.ini a bit with some more clarifications about the subject. You can look at it here.

I 've also updated the wiki.

Juank23 commented 2 days ago

Good morning, thanks for your help, I did everything I did but nothing worked me indiscaste, I did several tests without good results.... to the last I changed the bootloader for the arduino one and worked well, now I have another question, starts to work well but at the end of the gcode is in a state of pause and you have to cancel to start again here a screenshot ... C1

Paciente8159 commented 2 days ago

Control pins (Emergency stop, hold, and cycle start/resume pins) are defined by default and have a weak pull-up enabled by default. That means you need to pull them down to ground.

If you don't need them, then you can simply disable them. To do that depends on what method you are using to configure the project. Did you use the web-builder or you manually configured the project).

If you configured manually you can disable control pins here

Juank23 commented 2 days ago

my friend I'm doing it manually in vscode, but I followed your instructions and still the same, I just got a couple of plates that I bought stm32f401 I uploaded the code without probelma but it does exactly the same, it starts the job well but when finished it stays in that state until it is given to restart, the strange thing is that at the end of the gcode I remove M30 and ends the process to continuucacion I send you the example gcode thank you 1.zip

Paciente8159 commented 2 days ago

Ahhh that. That is the M2 or M30 behaviour. When you send a M2 or M30 the machine will enter lock mode preventing further code from running. This is to prevent accidental code execution after a program finnishes.

You do not need to reset the board. An unlock command ($X) will unlock the machine.

Juank23 commented 2 days ago

is there any way to remove that function in the code so that it terminates the process without having to use that command ($x) thanks

Paciente8159 commented 2 days ago

I've added an option in the cnc_config.g file. Check line 327. Patch will be merged in master in a few minutes.

Juank23 commented 2 days ago

I copied all the content but it is still the same C2 C3

Paciente8159 commented 2 days ago

Ok. Will check it tomorrow. Thanks

Juank23 commented 2 days ago

Friend, thank you very much

Paciente8159 commented 1 day ago

I found this

I don't have a board with me now but in a few hours I will flash Gnea/Grbl an check what is the default behavior for M2. I will modify the option to make it compatible. Changes to the default µCNC might also be applied.

Paciente8159 commented 1 day ago

I've tweaked M2/M30 a bit to match LinuxCNC behavior in #786 . I prefer to leave µCNC default behavior to lock the machine, ignoring all code after M2/M30 until an unlock command is issued. You can emulated Grbl command by enabling option DISABLE_ENDPROGRAM_LOCK in the cnc_config.h file

Juank23 commented 1 day ago

good day, I copied all the content of cnc_config.h and unzipped DISABLE_ALL_CONTROLS but it is still the same, I have to modify another file?

Paciente8159 commented 1 day ago

3 Files were modified. Just download the master branch again. It's better that way. Less error prone.

Juank23 commented 1 day ago

Good morning, I just copied the compile files and it is perfect and works very smoothly .... but in drill cycles makes very crazy movements here I pass you the file thank you 2.zip

Paciente8159 commented 16 hours ago

I will take a look and report you back

Paciente8159 commented 9 hours ago

Ok I've detected a problem were the parser was not updating the feed and spindle correctly if modified in the canned cycle block. Here is the fix. Please try the code in this branch and let me know how it goes.

Not that your GCode is also incorrect.

N190 G80
N200 X0. Y-10.639

According to Linux CNC it's an error to program any axis words with G80 active. The correct code should be:

N190 G80
N200 G0 X0. Y-10.639