584,866 active members*
4,793 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2018
    Posts
    13

    ASAP - cnc from scratch

    Hi, im trying my skills and will try to make G-code interpreter and G-code sender from scratch.


    G-code sender : PC
    |
    UART
    |
    G-Code interpreter and controller: STM32H7
    |
    SPI
    |
    TMC5160

    Attached Thumbnails Attached Thumbnails IMG_20240110_113927.jpg   IMG_20240117_043736.jpg   SDS00001.jpg  
    Last edited by do-man; 01-18-2024 at 03:19 PM.

  2. #2
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Can't edit first post.

    What are my goals with this project:
    -RESPONSIVENESS of the multiplatform GUI g-code sender, writed in python - and using only native modules, with low CPU usage
    -SPEED of interpreter and controller that uses hardware accelerations and with real time kernel
    -ACCURACY while calculating things on the fly with hardware accelerators and using dsp
    -SAFETY last, but sure will have to consider it at some middle point of project

    Wish me luck
    Last edited by do-man; 01-19-2024 at 09:48 AM.

  3. #3
    Join Date
    Jan 2016
    Posts
    100

    Re: ASAP - cnc from scratch

    Rather than starting from scratch, why not just fork bcnc? It's already a great sender, and would be alot easier to modify rather than having to write everything from scratch.

  4. #4
    Join Date
    Jul 2018
    Posts
    6254

    Re: ASAP - cnc from scratch

    Hi do-man - Starting something from scratch is admirable but I don't think you know what your up for! There are many many open projects that need help and that are 10,000's of hours plus into development. Contribute something to those and your skills will be tested and appreciated. Peter

  5. #5
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Quote Originally Posted by peteeng View Post
    Hi do-man - Starting something from scratch is admirable but I don't think you know what your up for! There are many many open projects that need help and that are 10,000's of hours plus into development. Contribute something to those and your skills will be tested and appreciated. Peter
    Hi ! I'm using and contributing to open source projects. And they all are mostly software based. This makes them more portable to different hardware bases. But ... It makes them so slooow. My goal is software mostly hardware based (made only for one MCU family using as many hardware futures as possible). This makes it not so portable but FAST. These projects wouldn't accept this kind of approach. And contributions would not be merged at all (waste of time).

    And also there is no FULL SPI control software for this driver as well. This also would not be accepted in these projects. Because whole motion control parts had to be changed etc. Whole projects had to change to follow this approach (waste of time).

    So its even at this point kind of unique.

    Thanks for taking interest in my project and for commenting this thread.

  6. #6
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Quote Originally Posted by jaguar36 View Post
    Rather than starting from scratch, why not just fork bcnc? It's already a great sender, and would be alot easier to modify rather than having to write everything from scratch.
    I'm sorry, but from my personal experience bcnc was terrible to use (tried it not so long ago). And also it has many issues on arch based distros (and other too).

    Sender is simple software, its like a weekend project. Harder part is managing control over machine.

    Thanks for interest and commenting this thread also.

  7. #7
    Join Date
    Jul 2018
    Posts
    6254

    Re: ASAP - cnc from scratch

    Hi D-M - you say Gcode interpreter and gcode sender. Could you expand what you mean by these? Are you talking about a machine controller? ie the device accepts gcode from a cam system and this is then velocity and motion planned and sent to the motors? Peter

  8. #8
    Join Date
    Jan 2016
    Posts
    100

    Re: ASAP - cnc from scratch

    Quote Originally Posted by do-man View Post
    I'm sorry, but from my personal experience bcnc was terrible to use (tried it not so long ago). And also it has many issues on arch based distros (and other too).

    Sender is simple software, its like a weekend project. Harder part is managing control over machine.

    Thanks for interest and commenting this thread also.
    If you think you can make a better sender than bCNC, I think the community would be excited to see it. In my opinion bCNC is the best sender out there right now, and its certainly far from perfect.

    On the interpreter/machine control, there are a bunch of mature projects for a bunch of different micro controllers. I don't think you'd find much enthusiasm for yet another one, on yet another platform without having some pretty enticing features. It sounds like you may be overestimating the need for speed in a machine controller. Keep in mind that professional CNCs for the 90s worked better than most current hobby level machines on ridiculously slow controllers. I've been running GRBL on piddly ATmega328P for awhile now and it is plenty fast enough.

  9. #9
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Quote Originally Posted by peteeng View Post
    Hi D-M - you say Gcode interpreter and gcode sender. Could you expand what you mean by these? Are you talking about a machine controller? ie the device accepts gcode from a cam system and this is then velocity and motion planned and sent to the motors? Peter
    Hi ! PC runs g-code sender - this programs monitors and established USB connection with microcontroller, and sends sends strings of g-code to it. It isnt computing g-code just sending. When microcontroller does it it will be easy to implement other input of g-code like USB stick or SD card. It sends data in no real time fashion.

    Microcontroller will to this job in real time fashion, then it will send with only SPI commands (no step/dir) to motor controllers (in this case tmc5160). Standard in other solutions is to configure them by spi but then use step/dir to controll motors.

  10. #10
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Quote Originally Posted by jaguar36 View Post
    If you think you can make a better sender than bCNC, I think the community would be excited to see it. In my opinion bCNC is the best sender out there right now, and its certainly far from perfect.

    On the interpreter/machine control, there are a bunch of mature projects for a bunch of different micro controllers. I don't think you'd find much enthusiasm for yet another one, on yet another platform without having some pretty enticing features. It sounds like you may be overestimating the need for speed in a machine controller. Keep in mind that professional CNCs for the 90s worked better than most current hobby level machines on ridiculously slow controllers. I've been running GRBL on piddly ATmega328P for awhile now and it is plenty fast enough.
    Hi ! I didnt want to brag aboit it. I see that many people just love it! I was talking about my personal experience - and also I tried bunch of senders and control software for microcontrollers.

    I will elaborate for rest of Your post later on.

    Thank You.

  11. #11
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    I think I won't find much enthusiasm in this project by majority also !

    But I don't think I overestimate speed (and when I mean speed I don't talk about just motor speed) it is important in many reasons.
    This is a must when it comes to overall "responsiveness" of complete system.

    I agree that there are many exciting projects out there like LinuxCNC (that I'm currently using), fluidNC, Marlin etc. And I won't discourage anyone from using it.

    But still they don't provide this "great" experience that I'm looking for.
    -they don't use full spi control over trinamic motor drivers (MODE 1), they use (MODE 2) instead, that only allow to control current and chopper of this motor driver.
    -this approach would force them to rethink and rewrite motion calculations and control (most likely they won't do this).

    Have a nice day !

  12. #12
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    First run in FULL SPI MODE 1, with standard setrings, not matched Rsens (0.022 R), 17SH4401 (1.5 A). Ideal Rsens for this engine : 0.15 R.



    https://youtube.com/watch?v=QWSh9MGNZPo
    Attached Thumbnails Attached Thumbnails First run.jpg  

  13. #13
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    Second try. Full SPI MODE 1.
    -power supply 1A 24V C.V.
    -tmc5160 spread cycle, stealt chop, 0,5A max
    -Rsens 0.022 R

    Click image for larger version. 

Name:	TMC spi.jpg 
Views:	0 
Size:	17.5 KB 
ID:	500981

    https://youtube.com/watch?feature=shared&v=JR1u7YA7CyE

  14. #14
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch


  15. #15
    Join Date
    May 2018
    Posts
    13

    Re: ASAP - cnc from scratch

    https://www.youtube.com/watch?v=zk7zDUOad8M

    Feedrate test. mm/min. For screw 5mm pitch. Exact stop mode, spread cycle.

  16. #16
    Join Date
    Mar 2016
    Posts
    322

    Re: ASAP - cnc from scratch

    I follow Your works here and in cncinfo. It's quite interesting to have other option to control motors than only step-dir pulses, which are indeed very simple in aplication, but also quite slow and not fully noise resistant.

  17. #17
    Join Date
    May 2018
    Posts
    13
    Quote Originally Posted by steryd View Post
    I follow Your works here and in cncinfo. It's quite interesting to have other option to control motors than only step-dir pulses, which are indeed very simple in aplication, but also quite slow and not fully noise resistant.
    Hi!

    This project is an experiment. To learn its limitations, pros and cons. It have some great benefits and some down sides as well.

    It certainly changed the way I think about motion controll.


    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •