tiny-g2 project compile on keil mdk arm so it can be compiled with other arm cortex controllers (required developers input for doing it better way )

41 views
Skip to first unread message

shams iqbal

unread,
Jul 25, 2016, 3:04:26 PM7/25/16
to TinyG Development
hi 
             i am trying to build tiny-g2 on keil mdk arm so anyone can build it with any cortex m mcu idea is very simple at the moment tiny-g2 is limmited to atmel sam3x8e running at 84 Mhz clock speed while there are some other mcu available running at 180Mhz clock speed and those have enough horsepower to run a nice big tft lcd module to run tiny-g2 as standalone controller 
              so at this moment i need developers input for few things 
          1)    how to use single cdc usb device for tiny-g2 communication where to fork it for better and error-less code 
          2)   which files should be added for main project setup and which should be left for platform dependent selection 
i am going to use stm32f407 discovery and if its hardware resources is going to lesser then i will use stm32f429i discovery these boards were procured especially for cnc controller design(i have 20 each in my stock )
before asking this here i have been studying tinyg and tiny-g2 code for a month now i thought it will be better idea to ask these question before starting work on tiny-g2 my main focus is to use 5th order motion planning code for cnc controller and add standalone layer operation layer for standalone controller its very simple task just going to add sd card with it and for each gcode file i will be generating motion planning file on sdcard which will be latter executed by reading that file for motion execution sd card are very cheep these days and it didnot took longer time to convert a gcode file to motion planning file and how bigger it will be for years i have been working on cnc machines i have seen 8080 processor running three axis cnc machine with only 16k sram as system memory  so i am quite surprised why people are not able to run closed loop servo control on powerful mcu's arm cortex m4 running at 84 Mhz 32bit processor with hardware divide and multiply support with compare to 8-bit cpu running at few mips and no hardware devide and multiply using poor math co-processor and working like champ  
                i think no one had ever think to generate motion planning file on sd card and later run that file to offload cpu for real run time motion execution sd card sheild 
look at the link what is price for sd card sheild 

its just US $0.74  sheild free shipping 

and for sd card 
 

2 GB for 2.52 US$ free shipping  
4 GB1 for 2.78 US$ free shipping 
8GB for 3.66 US$ free shipping 
these links are for only reference one may find even cheaper
so adding 5 more bucks on cnc project is not a costly thing for minimum of 700 to 800$ diy hardware i build my own cnc machine with anti-backlash ball screws and linear rail guide baring  cost me more than 2000$ for mechanical i had run tiny-g2 on ardiuno due but it does feel very odd no internet you are not able to run tiny-g2 old communication for tinyg is quite stable especially with jcnc software http://www.jtronics.de/avr-projekte/xmega-tinyg-cnc-controller.html but new two port cdc is different so people are forced to use chilly paper it took alot of time to bind json server and run tiny-g2 

professional grade is only the feature which i am going to include my build but other way this is incomplete project  

Rob

unread,
Jul 25, 2016, 4:31:13 PM7/25/16
to devT...@googlegroups.com
Hello,

We are about to push a new version of G2 that will be much more obvious how to port it to other processors.

For now, you can look at the Motate project and watch out progress as well build it out: https://github.com/synthetos/motate

Motate uses the arm-gcc project to supply the compiler, and has the CMSIS  (vendor register libraries for Arm-Based processors) for many more processors than we actually plan on using, in case someone like yourself decides to port to another processor. For example, you mentioned the STM32F4 family, which is here: https://github.com/synthetos/Motate/tree/sam4e-port/MotateProject/motate/cmsis/TARGET_STM/TARGET_STM32F4XX  I don’t recall exactly when those STM libraries were collected, so they may need updated, but in the least the compiler toolchain is already setup and ready to handle all ARM-based (bare metal, M0, M0+, M3, M4, M7) processors.

With the larger processors we have plenty of RAM, and putting files on an SD card would likely even be a bottleneck for the planner. If we need more speed at this point we would likely just A) Use a faster processor (which we’re working on) and B) make the planner queue deeper, using more of the available RAM on the faster processors (sometimes several MB).

Another thing coming in the next push (it might slip to the next one, depending on testing) is that the Stepper object will be broken out to support more complex stepper drivers, and would be the obvious place to put a direct-to-FET stepper driver.

-Rob

--
You received this message because you are subscribed to the Google Groups "TinyG Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devTinyG+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shams iqbal

unread,
Jul 26, 2016, 1:57:15 AM7/26/16
to TinyG Development
hi 
                       thanks for the input well its look like that there are some work is being under-process what i am intended to do to port tiny-g2 on stm32f4 family i have seen the web links you have mentioned well about faster processor how much faster processor you can arrange for motion planner i think you might end up doing whole project in fpga for faster processor option and about more ram option project cost will be increased as for hobbyist grade level peoples project will be more difficult to implement i am still not agreed with these option i have seen tinyg project using atxmega192a3 and i found that it uses more ram then grbl 
                               i have more than 1200 atxmega128a1u in my stock and i have contacted with atmel support team so i could use external sram to compile tinyg project on atxmega128a1u even i was wondering why developer have not used usb version and used native usb interface for pc communication which will give even better data through put where i am sure that non usb version will be lesser available for future tinyg production because atmel sample support program only offers usb version even you ask for non usb atxmega192a3 mcu samples 
                you said that putting planer exec on sdcard would be a bottleneck can you explain how ...............? especially when using 8-bit mcu's which consume more horsepower while computing motion planning with compare to read sdcard file !
        i am still surprised that there is more and more stepper motor support option is being considered but no one is considering close loop servo motor control support on any of open source project isn't a strange thing .............?
        well i have chosen stm32f4 for these main reason 
        1) more i/o's are available 
         2) have better performance with compared to atmel products 
                         how 
            atmel products sucks when ever they have to run in industrial environment many time system hangs on and many time restarts these atmel product are like real bugs 
            3)  have more sram and program memory 
               4) runs on more speed (Mhz ) with compare to atmel products 
                   5) they have more quadrature encoder interfacing option  
                             why this option 
                              because i am going to offload cpu from many thing as opposed to tiny-g2 is running >removal of dda and stepper support >pre-calculated planer exec file from gcode file stored in sd card and support for close loop servo motor control which needs encoder interface all remaining horsepower is going to be utilized for standalone operation with huge graphical lcd interface 
                   
                 i am already running my tiny-g2 with closed-loop servo motor controls drive which i have build on atxmega64a4u mcu chip at the moment what i know that how it can be done to control close loop servo motor control in one chip is very simple 
                 close loop servo control on every professional cnc control is executed no more than 1msec interval very few of them offers 0.5msec positioning control so for me minimum steps counts to be calculated is based on 1/1000 second interval which are going to feed in pid closed loop control loop for servo motors and motion planner execution rate going to be increased as per 1msec interval fixed rate as oposed to 2.5msec default setting when dda is not used it will offload the processor  
                any how it looks like i have to start from zero again first add project to keil mdk as it is then strip off unnecessary files/configuration  and then start to modifying  project
again thanks for info 

shams iqbal

unread,
Aug 15, 2016, 7:08:23 PM8/15/16
to TinyG Development
hi  Rob ,
well after many days of work finally i am able to compile code in keil mdk uVison 5 at the starting i was stuck with "typetrait" file and it was giving me error that it needs gc11++ support etc but now i figured out that how to eliminate this error and now i am going to simplify this motate system with cmsis library(especially for stm32f) used in keil mdk i have decided that this system should be used with keil rtx as cortex m based system are optimized for thread based operation i am going to modify huge portion of code maybe i will rewrite the whole code to make it more readable its very confusing espicially "mr." thing create huge conflict to remember the code 
may be i need to some help for this task 
regards
Shams 

On Tuesday, July 26, 2016 at 1:31:13 AM UTC+5, Rob Giseburt wrote:
Reply all
Reply to author
Forward
0 new messages