svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
647 stars 172 forks source link

I cann't upload all firmware hex file to Arduino Mega2560 #362

Closed akkarawat2000 closed 9 months ago

akkarawat2000 commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

I have Arduino Mega2560 I cann't upload all firmware How to fix it ? and I would like to know it's support Arduino Mega2560 ?


Now I use Ramp board version 1.5 it's support with your firmware ? and I would like to know it's can use with Servo motor 5V (Micro Servo MG90S) ?

How to use and control it ? (What's pin I must use for Servo motor ? )

Can you suggest me ?

Thank you

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

svenhb commented 9 months ago

I have Arduino Mega2560 I cann't upload all firmware

-Did you follow this steps? https://grbl-plotter.de/index.php?id=quick-guide -Start XLoader, select correct board (Mega...) and file (only "grbl-Mega-5X..." are possible for Mega and upload...

I would like to know it's support Arduino Mega2560 ?

GRBL-Plotter supports any controller which uses grbl firmware (I think so :-).

Now I use Ramp board version 1.5 it's support with your firmware ? and I would like to know it's can use with Servo motor 5V (Micro Servo MG90S) ?

You better ask here for grbl-Mega-5x and Ramps questions... https://github.com/fra589/grbl-Mega-5X/issues/138 https://github.com/fra589/grbl-Mega-5X/discussions/189

akkarawat2000 commented 9 months ago

-Did you follow this steps? https://grbl-plotter.de/index.php?id=quick-guide -Start XLoader, select correct board (Mega...) and file (only "grbl-Mega-5X..." are possible for Mega and upload...

Yes, I try like you send me all still cann't upload . It's show message Fail . Can you try it ? and for grbl-Mega-5X support Arduino Mega2560 only right ? if yes I use original not hex files it's working fine but I have problem about cann't use with Servo motor 5V . I try to edit config.h and cpumap.h but still have problem

Do you have another idea how to fixed it ?

for hex files upload please test it

Thank you

svenhb commented 9 months ago

It's show message Fail

Can you upload a screenshot? You can just paste a picture into this edit-box.

I have problem about cann't use with Servo motor 5V

What exactly is the problem with the servo? My experience is: you must use a separate voltage source for the servo, because it can draw too much current for a short moment, which influences the controller.

akkarawat2000 commented 9 months ago

you can check my video at here

https://youtu.be/tk8_yHSdpdA

yes , I use external switching 5V with servo see from video i send to you .

svenhb commented 9 months ago

You may try a reset of the board, before starting upload. I thing the Xloader can't get contact...

svenhb commented 9 months ago

Do you have connection at all to your board? Perhaps you need to install a driver first?

akkarawat2000 commented 9 months ago

I try to reset on board ready and try upload again still cann't upload same problem.

What's driver ?

if i use original GRBL source code on Arduino IDE . I can upload nornally working fine . and

I test with a Arduino Builder can upload but work just grbl_v1.1f_Servo.hex only

please check my attach files.

11-1 11-2

svenhb commented 9 months ago

No idea, sorry. But this is file is for Arduino Uno / Nano and will not work with Mega. image

svenhb commented 9 months ago

Did you try this baudrate also in X-Loader? image

akkarawat2000 commented 9 months ago

Did you try this baudrate also in X-Loader? image

Yes , I try this buadrate too with X-Loader but not working too.

you try by your self with Uno or Mega 2560 and write desciption what's files work with Uno or Mega2560 it's better

and test first it's X-Loader have problem or not .

Thank you

svenhb commented 9 months ago

The problem is before uploading any file, you get the error immediately after pressing start...

akkarawat2000 commented 9 months ago

No , I don't have error .

svenhb commented 9 months ago

No , I don't have error .

? image

akkarawat2000 commented 9 months ago

you try with Mega 2560 ?

Can you send X-Loader to me and files .hex for test ?

svenhb commented 9 months ago

Yes, I used one of the ...Mega-5X... files

svenhb commented 9 months ago

With an Adruino DUO - just the board, without any hardware connected. I remember I had to press the reset button on the board very often (I think it was when I tried Marlin with GRBL-Plotter)

svenhb commented 9 months ago

Arduino DUO

svenhb commented 9 months ago

Isn't your lower board an Arduino DUO? Perhaps you remove the upper board and try again?

svenhb commented 9 months ago

BTW: I can't upload HEX via XLoader with an other notebook I have (on Arduino UNo) - no idea what the problem is. But using a programmed board is not a problem. Perhaps you try with an other PC - just the board, just connected via USB - no other power supplies connected.

svenhb commented 9 months ago

I assume it is solved

akkarawat2000 commented 9 months ago

No , I cann't solve this problem but I break project . because I don't know how to fixed this problem. I still stuck Mega -5X issue about

  1. I cann't control servo motor .
  2. I don't know how to connect Digital Input and What's command G code work with it.

If you have solution can explain it. or suggest me . Now I use mega 5x work with Arm Robot. but some feature and document Mega 5X not clear and I don't know how to find solution now.

Thank you

svenhb commented 9 months ago

Ok, I played arround with my mega board..., 1) Can you live with one servo, controlled via spindle pwm? Then you can't control a spindle.... I recompiled grbl with my suggested changes - almost working...

2) after adapting GRBL-Plotter I can also show input states as background color of output buttons. Example 1 - just set D0 to 1 and see changing state in status: image

Example 2 output D25 is connected to input D27 (https://github.com/fra589/grbl-Mega-5X/wiki/grbl-Mega-5X-pinout) After pressing D3, D0 input (background color) changes: image

To enable input, you need to change config.h line 376 - enable #define USE_DIGITAL_INPUT

https://github.com/svenhb/GRBL-Plotter/releases/download/v1.7.0.3/GRBL-Plotter_Setup_1_7_0_3.c.exe

svenhb commented 9 months ago

Note: to control a robot you may want to react on the digital inputs to start sending different GCode - this function is not implemented in GRBL-Plotter (yet). What exactly do you want to achieve?

svenhb commented 9 months ago

For Servo-PWM: after applying the suggested changes (https://github.com/fra589/grbl-Mega-5X/issues/323#issuecomment-1486581884) Change $30=512; $31=0 then the usable range for S is (in my case) from 8 to 36. So you can send M3 S8 and M3 S36 to move from one end to the other.

akkarawat2000 commented 9 months ago

Note: to control a robot you may want to react on the digital inputs to start sending different GCode - this function is not implemented in GRBL-Plotter (yet). What exactly do you want to achieve?

Hi , Now I use grbl Mega 5X firmware and uncomment config.h line 376 - enable #define USE_DIGITAL_INPUT for enable Digital Input ready . but

What's command Gcode for use with Digital Input can you show me how to use ?

Digital input 0 D(27) Digital input 1 D(29) Digital input 2 D(31) Digital input 3 D(33)

akkarawat2000 commented 9 months ago

Ok, I played arround with my mega board...,

  1. Can you live with one servo, controlled via spindle pwm? Then you can't control a spindle.... I recompiled grbl with my suggested changes - almost working...
  2. after adapting GRBL-Plotter I can also show input states as background color of output buttons. Example 1 - just set D0 to 1 and see changing state in status: image

Example 2 output D25 is connected to input D27 (https://github.com/fra589/grbl-Mega-5X/wiki/grbl-Mega-5X-pinout) After pressing D3, D0 input (background color) changes: image

To enable input, you need to change config.h line 376 - enable #define USE_DIGITAL_INPUT

https://github.com/svenhb/GRBL-Plotter/releases/download/v1.7.0.3/GRBL-Plotter_Setup_1_7_0_3.c.exe

Issue Digital output i test today by my code . if i use Gcode this https://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m62-m65 for reference M64 should ON ComPort.WriteLine('M64 P0'); // Digital Output 0 (D16) <<-- Correct

but I must use M65 for ON
ComPort.WriteLine('M65 P1'); // Digital Output 1 (D17) <<- Wrong ComPort.WriteLine('M65 P2'); // Digital Output 2 (D23) <<- Wrong ComPort.WriteLine('M65 P3'); // Digital Output 3 (D25) <<- Wrong

I think you do some thing wrong ?

and M65 shoud OFF

ComPort.WriteLine('M65 P0'); // Digital Output 0 (D16) << --- Correct

but

ComPort.WriteLine('M64 P1'); // Digital Output 1 (D17) <<-- Wrong Should be M65 ComPort.WriteLine('M64 P2'); // Digital Output 2 (D23) <<-- Wrong Should be M65 ComPort.WriteLine('M64 P3'); // Digital Output 3 (D25) <<-- Wrong Should be M65

please check about this issued too.

for servo motor now I don't test it but Now you can use it ready ? I would like to know what's pin you connect to Ramp Board

please tell me I will test it

Thank you

akkarawat2000 commented 9 months ago

I want to test Digital Input State. How should i test it ?

if I have limit switch I connect Pin NO (Normally Open) to Digital Input 0 (D27) and What's Gcode code I should use for check if I press Limit switch ( this code should be in Timer or Thread for wait press limit Switch right ? or simple I put in button and I press by manual ? please suggest me )

and Status on my screen change Digital Input 0 (D27) to ON State ?

please guide me ,

Thank you

akkarawat2000 commented 9 months ago

Note: to control a robot you may want to react on the digital inputs to start sending different GCode - this function is not implemented in GRBL-Plotter (yet). What exactly do you want to achieve?

Now , exactly I develop software by my self not use GRBL-Plotter . My goal want to simulate if have signal input from many sensor or another hardware I will trigger arm robot move to some position and pick and place .

That's why I want use many channel Digital Input function to complete my project . Can you add this feature ?

I hope you understand me.

Thank you

svenhb commented 9 months ago

As you can see in my screenshots, I used M63 P3 to set "1" - just press the button in the gui an check in the COM window the sent command....

That's why I want use many channel Digital Input function to complete my project . Can you add this feature ?

Sorry, better ask the grbl programmer.

svenhb commented 9 months ago

About the output commands, you may read here: https://github.com/fra589/grbl-Mega-5X/issues/304#issuecomment-1285144949

You may enable the invert options for the digital inputs: image

svenhb commented 9 months ago

if I have limit switch I connect Pin NO (Normally Open) to Digital Input 0 (D27) and What's Gcode code I should use for check if I press Limit switch ( this code should be in Timer or Thread for wait press limit Switch right ? or simple I put in button and I press by manual ? please suggest me )

There is no GCode to read pins, you have to check the staus-message, which appears after sending "?": image

akkarawat2000 commented 9 months ago

I will test and tell you again

Thank you very much .

akkarawat2000 commented 9 months ago

Hi , I test Digital Input 4 Channel finish . It's working now

D27 = ON <Idle|MPos:0.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|Ov:100,100,100|A:D00010000>

D29 = ON <Idle|MPos:0.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|Ov:100,100,100|A:D00100000>

D31 = ON <Idle|MPos:0.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|Ov:100,100,100|A:D01000000>

D33 = ON <Idle|MPos:0.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|Ov:100,100,100|A:D10000000>

but I would like to know if I want to add more Digital Input and Digital Output more How to edit source code in grbl-Mega-5X ?

please suggest me

Thank you very much for help me .

svenhb commented 9 months ago

I would check the digital_control files: https://github.com/fra589/grbl-Mega-5X/tree/edge/grbl Also https://github.com/fra589/grbl-Mega-5X/blob/edge/grbl/gcode.c You need to find and adapt MAX_DIGITAL_OUTPUT - same for input - don't know where to find... Better ask Gauthier Briere https://github.com/fra589