lamplc / backlash-compensation-grbl-feature

Code implementation for working backlash compensation in grbl
0 stars 0 forks source link

How to do that? #1

Open lamplc opened 7 years ago

lamplc commented 7 years ago

I have searched on the internet but could' t find a solution for backlash compensation for grbl. I have access to a 3 axis machine with ball srew axis but without the ability to adjust the nuts to tighten them so i have backlash of 0.05 to 0.08mm. The machine has got servo drives instead of steppers and originally has digital handwheels. I can switch between the orginal hand wheels and my own produced cnc adapter pcb with an arduino mega as cnc driver. I have tightened the belt from the servo drive to the spindel , tightened the pulley on the axis and on the servo drive and eliminated the gap between the too big pulley keyhole and the key on driven/drive axle. So from my opinion the backlash can now only come from the ball screw and its nut and i can' t change anything on that or replace the nut with two spring loaded nuts as anti backlash nut because the machine is owned by our University. All changes i did so far on the machine where adjustments or could be undone if the University wants that. The only possible way is to do it with software. I have seen a post of quangvi that he has done that, does anyone have that grbl 1.0 code he can share or will you quangvi share that working code?

lamplc commented 7 years ago

@quangvi message_content , @quangvi ping

quangvi commented 7 years ago

Thank you for your interest I have rewritten the GRBL source code using stm32f4discovery, with backlash configuration and accelerated for this, along with high speed up to 200Khz,

quangvi commented 7 years ago

I'm writing more about usb cdc but the performance did not reach 200khz, so later I had to use FT232RL to uart chip for my project.

lamplc commented 7 years ago

Wow that was a fast first reply. I know you have an stm32,i could buy one too if it is necessary. Also an ft232rl uart is no problem for me, have them in here. Could you upload that code and maybe an compiled hex?

quangvi commented 7 years ago

Please send me pictures of your machine, I will review and send you an opensource version with my project, i use STM32F4discovery , because Project is Company property, Please promise me that you will not share it with anyone except my consent

lamplc commented 7 years ago

At the moment i haven't got pictures of the whole machine just from the manufacturer: http://www.knuth.de/servomillr-1000.html?___store=de_en&___from_store=de_de It has maxsine ep100 servo amplifiers and it has two input lines for direction and step but at the moment originally configured as step line for left and step line for right movment. My pcb has an logically and on it to convert step and direction to step right/step left so for the future i could change the cnc interface and do not have to change the code.

quangvi commented 7 years ago

The project in my Company, Please send me email address, tomorrow i will send you, Please promise me that you will not share it with anyone except my consent, ?, promise me?

lamplc commented 7 years ago

And i cannot use the glass scale for cnc at the moment. That's my wish for future converting, read the value of the scale and then compensate in software. Maybe with two mikro controllers, one only handles compensations and glass scale read and interface over spi or harware interrupt with the normal cnc controller. And yes the price is that high without cnc interface and you cannot buy it as an upgrade from them, never would buy that machine on my own.

lamplc commented 7 years ago

My email is <> Of course i promise you i will not share anything and if anyone wants the project he has to deal with you direct.

quangvi commented 7 years ago

@lamplc ,ok, tomorrow i will sent you my project, good night (my country 8:30 PM), If I forget you please take note of me here, my email will be alerted

lamplc commented 7 years ago

Thank you and good night.

lamplc commented 7 years ago

Have you already sent it to me?

quangvi commented 7 years ago

hello @lamplc , i don't see your email

lamplc commented 7 years ago

Hey, it is in the notification email from github, it was mail

quangvi commented 7 years ago

i has send file to your email, check email. download file and change .txt -> .rar and extract it,

quangvi commented 7 years ago

i had write STM32F407 discovery with Cubemx and Systerm workbench for stm32

quangvi commented 7 years ago

in my file has file *.bin, you can write to flash Stm32 with stlink ultility

quangvi commented 7 years ago

in the Grbl panel setting you can see $140 141 142 150 151 152 this is backlash in mm for 3 Axis and accelerator for backlash, try and fun, my source had 4Axis and has digital handwheels, but Project is Company property, i can't share it, this is version had simple like Grbl arduino UNO add backlash and accelerator for backlash if you had issues , you should feedback me, max feedrate for 3 Axis is 6000mm/min and 1000step/mm --<=100khz step out ,( Fcpu160mhz) , if you overclock CPU(200Mhz) , you can speed up 200khz step out and CPU =250Mhz speed up is 250khz step out, but ST Microcontroler not recomment , Flash , Ram, Peripheral wil broken

lamplc commented 7 years ago

Yeah thank you very much. I have ordered an Stm now and then I will set it up on machine and try it out. The max. output rate of below 100kHz shouldn't be a problem for now.

quangvi commented 7 years ago

ok, notthing for you , if you had issues , you should feedback me, i will change source code and solve problem

lamplc commented 7 years ago

Do you think if I change the code a little bit (timers, etc) so to port it pack to arduino style, it will work also or does it really need the performance of (Flash,etc) of Stm?

quangvi commented 7 years ago

Actually, stm is needed because high speed machines need to reach 250khz step out, and suppost digital handwheels(STM32 had timer like encoder counter) but in home machine , arduino Uno is ok, in my code had keep all source code GRBL , you can see with #ifdefine USER_STM32, you can compare it

quangvi commented 7 years ago

i has not time for post backlash to arduino UNO, if you want , you can see my code and post is to your board arduino UNO

quangvi commented 7 years ago

if you work complete, you can send me your source code , i will save it , but you can't post to arduino UNO, should watting for me about 2 week , i will change my source to Arduino UNO , and you not need to buy a stm32f4 discovery

lamplc commented 7 years ago

actually I am reading your code. I have an arduino mega at the moment. I try to do it on my own, but i think your code and port would be better so i will definitely try ours out.

quangvi commented 7 years ago

ok, good luck to you, bye bye

lamplc commented 7 years ago

So i have tested it on my mega2560 and first it did not work. I have forgot to clear eeprom and set all to default because of the new variables for backlash in the eeprom. After checking all the code line by line with serial print outs , i realised the fault with the eeprom. So on my prototyping board backlash compensation works like a charm. I have included your files in the standard mega 1.1f grbl and uploaded it with arduino ide. If you want i can sent you the code. Are you going to make it public?

quangvi commented 7 years ago

Can you send me via mail, when it's perfectly fine(complete) i will give out open source in my name and you,

quangvi commented 7 years ago

If you don't want, only me and you know , not make it public, so if its complete , its is good for share

lamplc commented 7 years ago

You do not have to mention me. I haven't done coding , just put the files with backlash compensation relative changes in my folder and created an ino and loaded it up.

quangvi commented 7 years ago

Ok, i work in our company, i will see this source to night, thank you

quangvi commented 7 years ago

i'm busy now, so it's have a long time, about Next 3 months

philippe-nuaa commented 7 years ago

@quangvi @lamplc hello,guys. I'm interested in Grbl either. I have tried porting Grbl On STM32F429. Now I've Met the backlash problem. Have you already finished the backlash compensation? Could you send me a copy, it will be very helpful ,Thankyou !

quangvi commented 7 years ago

@philippe-nuaa , you can communicate @lamplc for get a source code on stm32f407vgt6