久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 15169|回復(fù): 21
收起左側(cè)

基于STM32平臺(tái)GRBL V1.1F源代碼IAR工程文件

  [復(fù)制鏈接]
ID:96552 發(fā)表于 2018-7-26 20:02 | 顯示全部樓層 |閱讀模式
基于STM32平臺(tái)GRBL V1.1F源代碼IAR工程文件,效果非常棒,比AVR328和2560效果好多了,用機(jī)器實(shí)際測(cè)試過(guò),可以直接使用。
0.png

單片機(jī)源程序如下:
  1. /*
  2.   main.c - An embedded CNC Controller with rs274/ngc (g-code) support
  3.   Part of Grbl

  4.   Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
  5.   Copyright (c) 2009-2011 Simen Svale Skogsrud

  6.   Grbl is free software: you can redistribute it and/or modify
  7.   it under the terms of the GNU General Public License as published by
  8.   the Free Software Foundation, either version 3 of the License, or
  9.   (at your option) any later version.

  10.   Grbl is distributed in the hope that it will be useful,
  11.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.   GNU General Public License for more details.

  14.   You should have received a copy of the GNU General Public License
  15.   along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*
  18.   之前在github上看到了grbl-0.9j在stm32上的移植,于是照貓畫老虎,移植了grbl1.1f-20170131,
  19. 增加了USB虛擬串口,不再需要外接轉(zhuǎn)換芯片,但其他功能都沒有調(diào)試,存在嚴(yán)重問題。此次移植了
  20. grbl1.1f-20170801,同時(shí)進(jìn)行了少許調(diào)試,目前通訊正常,步進(jìn)電機(jī)接口、冷卻和主軸正常,同時(shí)
  21. 加入了四相五線步進(jìn)接口(x和y),這些在cpu_map.h中有相應(yīng)定義。但手頭沒有機(jī)器,尚未實(shí)機(jī)測(cè)
  22. 試,慎用!
  23.   如有重大問題,請(qǐng)聯(lián)系 tuoqiang@outlook.com
  24. */

  25. #include "grbl.h"

  26. // Declare system global variable structure
  27. system_t sys;
  28. int32_t sys_position[N_AXIS];      // Real-time machine (aka home) position vector in steps.
  29. int32_t sys_probe_position[N_AXIS]; // Last probe position in machine coordinates and steps.
  30. volatile uint8_t sys_probe_state;   // Probing state value.  Used to coordinate the probing cycle with stepper ISR.
  31. volatile uint8_t sys_rt_exec_state;   // Global realtime executor bitflag variable for state management. See EXEC bitmasks.
  32. volatile uint8_t sys_rt_exec_alarm;   // Global realtime executor bitflag variable for setting various alarms.
  33. volatile uint8_t sys_rt_exec_motion_override; // Global realtime executor bitflag variable for motion-based overrides.
  34. volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bitflag variable for spindle/coolant overrides.
  35. #ifdef DEBUG
  36.   volatile uint8_t sys_rt_exec_debug;
  37. #endif


  38. int main(void)
  39. {
  40.   //USB init
  41.   //Delay Init
  42.   //GPIO CLK init
  43.   Hardware_Init();
  44.   
  45.   // Initialize system upon power-up.
  46.   serial_init();   // Setup serial baud rate and interrupts
  47.   settings_init(); // Load Grbl settings from EEPROM
  48.   stepper_init();  // Configure stepper pins and interrupt timers
  49.   system_init();   // Configure pinout pins and pin-change interrupt

  50.   memset(sys_position,0,sizeof(sys_position)); // Clear machine position.
  51.   asm("cpsie i"); // Enable interrupts

  52.   // Initialize system state.
  53.   #ifdef FORCE_INITIALIZATION_ALARM
  54.     // Force Grbl into an ALARM state upon a power-cycle or hard reset.
  55.     sys.state = STATE_ALARM;
  56.   #endif
  57.   
  58.   // Check for power-up and set system alarm if homing is enabled to force homing cycle
  59.   // by setting Grbl's alarm state. Alarm locks out all g-code commands, including the
  60.   // startup scripts, but allows access to settings and internal commands. Only a homing
  61.   // cycle '$H' or kill alarm locks '$X' will disable the alarm.
  62.   // NOTE: The startup script will run after successful completion of the homing cycle, but
  63.   // not after disabling the alarm locks. Prevents motion startup blocks from crashing into
  64.   // things uncontrollably. Very bad.
  65.   #ifdef HOMING_INIT_LOCK
  66.     if (bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
  67.   #endif

  68.   // Grbl initialization loop upon power-up or a system abort. For the latter, all processes
  69.   // will return to this loop to be cleanly re-initialized.
  70.   for(;;) {

  71.     // Reset system variables.
  72.     uint8_t prior_state = sys.state;
  73.     memset(&sys, 0, sizeof(system_t)); // Clear system struct variable.
  74.     sys.state = prior_state;
  75.     sys.f_override = DEFAULT_FEED_OVERRIDE;  // Set to 100%
  76.     sys.r_override = DEFAULT_RAPID_OVERRIDE; // Set to 100%
  77.     sys.spindle_speed_ovr = DEFAULT_SPINDLE_SPEED_OVERRIDE; // Set to 100%
  78.                 memset(sys_probe_position,0,sizeof(sys_probe_position)); // Clear probe position.
  79.     sys_probe_state = 0;
  80.     sys_rt_exec_state = 0;
  81.     sys_rt_exec_alarm = 0;
  82.     sys_rt_exec_motion_override = 0;
  83.     sys_rt_exec_accessory_override = 0;

  84.     // Reset Grbl primary systems.
  85.     serial_reset_read_buffer(); // Clear serial read buffer
  86.     gc_init(); // Set g-code parser to default state
  87.     spindle_init();
  88.     coolant_init();
  89.     limits_init();
  90.     probe_init();
  91.     plan_reset(); // Clear block buffer and planner variables
  92.     st_reset(); // Clear stepper subsystem variables.

  93.     // Sync cleared gcode and planner positions to current system position.
  94.     plan_sync_position();
  95.     gc_sync_position();

  96.     // Print welcome message. Indicates an initialization has occured at power-up or with a reset.
  97.     report_init_message();

  98.     // Start Grbl main loop. Processes program inputs and executes them.
  99.     protocol_main_loop();

  100.   }
  101.   //return 0;   /* Never reached */
  102. }
復(fù)制代碼

所有資料51hei提供下載:
grbl1.1f-stm32f103c8-master.zip (471.01 KB, 下載次數(shù): 399)
回復(fù)

使用道具 舉報(bào)

ID:197515 發(fā)表于 2018-9-2 11:37 | 顯示全部樓層
非常感謝分享,可以移植提速了。
回復(fù)

使用道具 舉報(bào)

ID:401723 發(fā)表于 2018-9-24 08:44 | 顯示全部樓層
學(xué)習(xí)下
回復(fù)

使用道具 舉報(bào)

ID:185057 發(fā)表于 2018-10-23 11:04 | 顯示全部樓層
正好需要
回復(fù)

使用道具 舉報(bào)

ID:244434 發(fā)表于 2018-11-8 19:05 | 顯示全部樓層
也在學(xué)習(xí)感謝樓主,正好要做個(gè)機(jī)器一起來(lái)交流下可好.
回復(fù)

使用道具 舉報(bào)

ID:451498 發(fā)表于 2018-12-21 15:13 | 顯示全部樓層
1 、沒有工程文件   2 、 編譯不通過(guò)
回復(fù)

使用道具 舉報(bào)

ID:403087 發(fā)表于 2018-12-30 21:49 | 顯示全部樓層
學(xué)習(xí)一下這個(gè)東西。
回復(fù)

使用道具 舉報(bào)

ID:472523 發(fā)表于 2019-1-24 15:37 | 顯示全部樓層
感謝分享
回復(fù)

使用道具 舉報(bào)

ID:418685 發(fā)表于 2019-6-6 16:38 | 顯示全部樓層
正在學(xué)習(xí)中,感謝分享
回復(fù)

使用道具 舉報(bào)

ID:582289 發(fā)表于 2019-7-11 14:11 | 顯示全部樓層
學(xué)習(xí)下
回復(fù)

使用道具 舉報(bào)

ID:591790 發(fā)表于 2019-7-28 22:44 | 顯示全部樓層
謝謝分享
回復(fù)

使用道具 舉報(bào)

ID:138247 發(fā)表于 2019-7-30 09:52 | 顯示全部樓層

感謝樓主分享。。。
回復(fù)

使用道具 舉報(bào)

ID:435052 發(fā)表于 2019-7-30 15:18 | 顯示全部樓層
非常感謝分享,可以移植提速了。
回復(fù)

使用道具 舉報(bào)

ID:634342 發(fā)表于 2019-11-2 14:16 | 顯示全部樓層
學(xué)習(xí)下
回復(fù)

使用道具 舉報(bào)

ID:96926 發(fā)表于 2019-11-7 13:51 | 顯示全部樓層

學(xué)習(xí)下
回復(fù)

使用道具 舉報(bào)

ID:568567 發(fā)表于 2019-11-8 16:54 | 顯示全部樓層
下載來(lái)度度,不知道能不能用,謝謝了
回復(fù)

使用道具 舉報(bào)

ID:605127 發(fā)表于 2019-11-21 16:36 | 顯示全部樓層
0.9j版本正在調(diào)試中,搞好了再來(lái)玩玩這個(gè)
回復(fù)

使用道具 舉報(bào)

ID:692686 發(fā)表于 2020-2-13 10:19 | 顯示全部樓層
有硬件接線圖嗎
回復(fù)

使用道具 舉報(bào)

ID:91165 發(fā)表于 2020-2-13 10:48 | 顯示全部樓層
謝謝樓主分享   
回復(fù)

使用道具 舉報(bào)

ID:852609 發(fā)表于 2024-8-2 22:49 | 顯示全部樓層
探針,限位都有問題
回復(fù)

使用道具 舉報(bào)

ID:852609 發(fā)表于 2024-8-2 22:51 | 顯示全部樓層
探針,限位都不能用
回復(fù)

使用道具 舉報(bào)

ID:517951 發(fā)表于 2024-8-29 07:30 | 顯示全部樓層
下載學(xué)習(xí)一下.
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 精品国产伦一区二区三区观看方式 | 国产美女永久免费无遮挡 | 高清国产一区二区 | 国产线视频精品免费观看视频 | 美日韩免费视频 | 欧美一区在线视频 | 国产高清在线精品 | 国产一区二区三区在线视频 | 国产精品久久久久av | 国产精品一区二区三 | 成人精品一区 | 亚洲国产中文字幕 | 久久国产精品网 | 99九九视频 | 在线观看日韩精品视频 | 国内精品视频在线 | 欧美日韩精品一区 | 国产 欧美 日韩 一区 | 毛片站 | 国产成人精品久久二区二区91 | 黑人巨大精品欧美黑白配亚洲 | 精品网站999www | 日韩福利片 | 亚洲资源站 | 免费av手机在线观看 | 91久久精品一区二区二区 | 99久久久久久99国产精品免 | 色橹橹欧美在线观看视频高清 | 精品视频一区二区在线观看 | 成人免费网站在线 | 亚洲人成人一区二区在线观看 | 欧美日韩一二三区 | 久久成人精品 | 亚洲精品视频在线看 | 久草视频网站 | 亚洲天天干 | 一级黄色毛片免费 | 日韩欧美一级片 | 一区二区在线 | 中文字幕a√ | 91精品国产一区 |