注释
|
要为配置值而不是坐标参数实现它,因为有一个单独的补丁。此修改的工作方式如下:如果您只想更改 ram 配置,则将 1000 添加到配置编号示例 $1=255(将其存储到 eeprom)$1001=255(这是 ram only 修改)您应该有一种加载 eeprom 的方法存储值,将 read_global_settings() 添加到 mc_reset() 或为此添加系统命令。将它添加到 mc_reset() 会重置 M2 或任何“~”发送后的更改。在 settings.c 中,函数 settings_store_global_settings 将参数从 uint8_t 更改为 uint8_16 然后将此行添加为第一行。uint8_t 存储=1;如果(参数>=1000){ 参数-=1000;商店=0;} 并在此函数的末尾添加 if(store) 到 write_global_settings(); 更新设置。h 函数原型的文件。在 system.c 中更改 return(settings_store_global_setting((uint8_t)parameter, value)); 返回(settings_store_global_setting((uint16_t)参数,值));BR Chris 2018-08-27 9:37 GMT+02:00,含氧 <notifications@github.com>:
|
|
谢谢你快速的回复!我想将所有这些参数与 EEPROM 分开,EEPROM 也可以通过命令 $$ 列出。
我认为对于我的特殊情况,删除对 write_global_settings() 的调用就足够了,因为我的应用程序可以确保始终在开始时设置参数。 |
|
@oxygenic出于好奇,为什么您需要不断更改 $ 设置。您是否在不同机器上使用相同的控制器? |
|
我需要更改电机启用或自动关闭以及加速度设置,其中 f 值保持不变。该应用程序是喷漆。
|
|
@chamnit没人说 RGBL 有 1000 美元以上的设置!?无论如何,这个问题已经解决了@cri-s希望这也是 GRBL 稳定性问题的解决方法。 @mayhem2408我尝试这样做是因为 EEPROM 访问似乎有问题,并且可能会导致串行通信出现问题 – 当它们按照 wiki 中的描述在握手中完成时也是如此。不幸的是,这个问题很少发生,所以我只能尝试不同的东西,然后等待很长时间。(重新)配置这些设置取决于用户,所以我不能确定他从不修改它们。 |
|
@mayhem2408抱歉,不,我不知道这种可能性——下次 EEPROM 补丁不起作用时我会尝试。 它肯定与过高的加速度值或类似的东西无关,我正在接近默认值工作并且我不会在 G 代码序列期间更改这些值。 我什至不确定我的问题是否真的与 $ 命令有关,正如我所说的,我很少看到这些通信问题,只是试图排除可能的原因。 |
|
你在使用arduino克隆吗?ch340 串行芯片存在已知问题,这些克隆中的大多数都使用它。不知道这是否可能是这些问题之一,或者您是否已经调查过了。No dia quarta-feira, 29 de agosto de 2018, oxygenic < notifications@github.com> escreveu:
|
|
@oxygenic简单明了的 $ 命令不应放在 Gcode 文件中。这不是它的设计方式。您是否可能运行高每毫米和高进给率。这可能会导致不稳定,因为 GRBL 以每秒约 30000 步的速度最大化。你能发布你的 $ 设置吗? |
|
@mayhem2408请参考我最初的错误报告:我没有在两者之间发送 $-commands,当我使用它们时,我严格按照手册的规定进行握手。我还使用带有原始 USB 芯片的原始 Arduino。 我看到的最新效果是这样的响应,其中两个状态消息相互重叠:
|
|
@oxygenic我询问您的 $ 设置的原因是检查您是否在 GRBL 的限制范围内运行。如果您没有即时更新 $ 值并且遇到稳定性问题,那么 EEPROM 不是您的稳定性问题。如果每毫米运行非常高的步数并且高进给率将导致稳定性问题。在某些情况下,我遇到过 EEPROM 损坏。我有一个激光装置,每毫米运行 160 步,最大进给速度为 30,000 毫米/分钟。这对 GRBL 来说太高了。原来我以大约 11,000 毫米/分钟的速度最大化 GRBL。关于您最初的帖子,我没有看到 GRBL 在以正确的方式完成时因更新 $ 值而变得不稳定。 |
|
@109JB我不使用 CH340,只使用原始的 Arduinos。当我放下 USB 芯片并直接通过串行接口通信时,问题变得更加严重。 |
|
@oxygenic如果您已将 USB 排除为问题,那么它一定是您的配置。您可以与我们分享您的 $ 设置吗? |
|
@mayhem2408 “错误”的设置真的会导致串行通信出现问题吗?这就是我所说的错误。 这些是我当前的轴相关设置: $ 0 = 10 限制为 5000(指定为 GRBL 最大值的一半),因为控制应用程序确保不超过实际限制。所有其他值都接近其默认值。也许我应该提到我不使用规划器,我发送一个运动命令并等待它完成,然后我发送下一个命令等等。 |
|
状态报告几乎不可能重叠,因为它是在 1 个函数内打印的(tx 队列溢出除外)。 因此,可能是您的应用程序存在多线程问题等,并且混淆了接收到的消息。 使用经过验证的应用程序来测试行为。如果仍然出现,请在出现错误的地方发布您的程序,以便重现。 |
|
@Schildkroet它是另一个 MCU 上的单线程应用程序,它肯定没有线程问题,并且接收函数是从一个不在 ISR 中的位置调用的。无论如何,感谢您提供反馈,但我原来的问题已经得到解答。 |
|
@oxygenic与其说是错误的设置,不如说是错误。它的设置超出了 GRBL 的限制。例如,您的每毫米步数 300 意味着您可以安全运行的最大进给是 6000。您的最大进给设置远低于该值,所以这不是问题。 |
|
您可以使用不阻止中断的此功能,因此不会丢弃串行字符。#include <avr/io.h> void EEPROM_write(unsigned int uiAddress, unsigned char ucData) { for(;;) { unsigned char ocData; 如果((ocData=EEPROM_read(uiAddress))==ucData)中断;EEAR = ui地址;EEDR = ucData; 如果(ucData==0xff)EECR|= 1 << EEPM1;else if(!((ocData^ucData)&~ocData)) EECR|= _BV(EEPM1) + _BV(EEPM0); EECR |= 1 << EEMPE; EECR |= 1 << EEPE; 如果(sys_rt_exec_state & EXEC_RESET)中断;} } unsigned char EEPROM_read(unsigned int uiAddress) { while (EECR & (1 << EEPE)); EEAR = ui地址;EECR |= (1 << EERE); 返回 EEDR;} 2018-08-31 13:31 GMT+02:00,约翰 <notifications@github.com>:
|
|
And for the eeprom.h void EEPROM_write(unsigned int uiAddress, unsigned char ucData) ; unsigned char EEPROM_read(unsigned int uiAddress) ; #define eeprom_get_char EEPROM_read #define eeprom_put_char EEPROM_write BR Chris 2018-08-31 14:25 GMT+02:00, Cri S <phone.cri@gmail.com>:
|
|
@cri-s : The EEPROM write function in Grbl was taken directly from Atmel’s software framework from what I recall. I don’t see much reason to change it just for non-standard use cases, when they might create more risk in causing other EEPROM issues by turning them off. |
|
The issue with the standard grbl eeprom is that it it need to write 114 byte of settings for the case of N_AXIS is 3 and grbl 0.9 . Assume that a float value and checksum need to be written. This are 5 times over 3400 uS that interrupts are blocked. 3.4ms is the minimum time, typical time is stated as 3.6ms and worst case is 5ms. During 3,4 ms 35 transmitted serial bytes are lost on 115200 speed. This code basically comes from 328 datasheet with some addition that was omitted for simplicity, but explained on datasheet., If you want correct you’r code, remove current cli/sei and place it as follow: The reason for cli/sei is that EEPE must be set inside 2 instruction clocks after setting EEMPE. It is only attributable to programmer laziness or if it don’t matter for application that cli/sei is set globally inside the function call. This includes waiting for write completion that in this case is the evil code that inhibit receiving of serial characters. Instead on 9600 bps it is just 2 characters as worst case that are dropped. if( diff_mask & new_value ) { // Now we know that _some_ bits need to be erased to ‘1’. // Check if any bits in the new value are ‘0’. if( new_value != 0xff ) { // Now we know that some bits need to be programmed to ‘0’ also. cli(); EEDR = new_value; // Set EEPROM data register. EECR = (1<<EEMPE) | // Set Master Write Enable bit… (0<<EEPM1) | (0<<EEPM0); // …and Erase+Write mode. EECR |= (1<<EEPE); // Start Erase+Write operation. sei(); } else { // Now we know that all bits should be erased. cli(); EECR = (1<<EEMPE) | // Set Master Write Enable bit… (1<<EEPM0); // …and Erase-only mode. EECR |= (1<<EEPE); // Start Erase-only operation. sei(); } } else { // Now we know that _no_ bits need to be erased to ‘1’. // Check if any bits are changed from ‘1’ in the old value. if( diff_mask ) { // Now we know that _some_ bits need to the programmed to ‘0’. cli(); EEDR = new_value; // Set EEPROM data register. EECR = (1<<EEMPE) | // Set Master Write Enable bit… (1<<EEPM1); // …and Write-only mode. EECR |= (1<<EEPE); // Start Write-only operation. sei(); } } BR. Chris 2018-08-31 14:34 GMT+02:00, Sonny Jeon <notifications@github.com>:
|


在我看来,每当某些 EEPROM 访问/设置时,GRBL 就会变得不稳定−�一种�一种米电子吨电子�秒一世秒一世���升�电子�−一种升秒�一世��一种秒电子��秒吨�一世�吨�一种��秒�一种�电子,米电子一种�秒��电子���升是��电子– 命令被发送,然后应用程序等待相关响应到达。
对于我的应用程序,在启动时发送所有 $ 参数没有问题,所以我的问题/功能请求:是否有一个(编译时)选项来禁用所有 EEPROM 内容并将这些参数仅保留在 RAM 中?
或者任何提示在哪里实施这样的事情?