gearing of axis for stitch regulation

cnc-club.ru for English speaking users
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

badger писал(а): Is the A axis not needed to drive the stepper to do rotation?
You do not need to use it as an separate axis. If you define A axis, LinuxCNC will control it, including give commands and check for the feed-back to check Following Error.

If you do not define this axis inside ini, LinuxCNC will not know anything about it.

stepgen - the component that controls steppers works separately from LinuxCNC motion (main motion control component). Basically it takes (this defined in hal)
axis.N.postion-cmd and gives back a Feedback to axis.N.postion-fb.

You can give commands to stepgen yourself. In fact you are already doing it :).
badger писал(а):If atan2 can rotate the needle without it being "A axis"
yes it can.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Well this is something to ponder. I will first test the current setting on the actual machine and then try removing A axis and such. Many different roads to the same place but some may be better routes. Are there any obvious advantages to controlling the stepgen directly rather than having it be an axis?
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

badger писал(а):Are there any obvious advantages to controlling the stepgen directly rather than having it be an axis?
No "following errors".
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I have a small issue with atan2 as it works on my machine. It seems that when the path goes from 10 degrees to 350 degrees, instead of rotating 20 degrees to the left,CCW, it rotates 340 degrees right, or CW. It continues in the correct dirrection but the extra rotation can wrap the yarn around the needle. Depending on where the needle is in its stroke it may or may not create a problem. Is there any way to control rotation to the shortest movement? Other than this issue, and some mechanical issues, I almost have an operational machine.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

mmm... I have not got it clearly.
Do you want aka "infinite" axis or axis fixed inside [0..360]?
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I am guessing that infinite is the way is probably the way to go. With atan2 I don't want to think about it, I just want LinuxCNC to do the work. My machine works much smoother already than it did with the A axis written into the gcode. With my current workflow most of the paths are some sort of spiral so I frequently go past 0 degrees and have a problem. I am not at the machine now to check but I think its only a problem then it needs to go past 0 degrees in one direction and not the other, not sure which one but will check tonight and let you know. Thanks for all of your help.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I just ran a test of 2 spirals, one clockwise and one counter clockwise. In both cases the rotation did not go past 360/0 dergees but rather reversed dirrection to get to "the other side". I've seen something about "wrapped rotary" but I'm not sure if it has any application with this issue.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

wrapped rotary affects motion planner which is not used in this particular task...
we should rewrite atan2 somehow...
let me think of it a bit...
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

Here's a new component
continious_atan2

it has additional pin in - float you should connect it's output to this pin (or current axis position).
I have not tested it - so can be some bugs...
Вложения
continious_atan2.comp.tar.gz
(419 байт) 1650 скачиваний
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I have been away from the workshop for a few weeks and when I tried to install continious_atan2.comp I had the following message:

badger@rugbot:~$ sudo comp --install continious_atan2.comp
make KBUILD_EXTRA_SYMBOLS=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc/Module.symvers -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-122-rtai'
CC [M] /tmp/tmpcrqB79/continious_atan2.o
continious_atan2.comp:9:24: warning: extra tokens at end of #include directive
continious_atan2.comp: In function '_':
continious_atan2.comp:17: error: invalid operands to binary % (have 'real_t' and 'double')
continious_atan2.comp:24: error: expected ';' before 'else'
continious_atan2.comp:29: error: expected ';' before 'else'
make[2]: *** [/tmp/tmpcrqB79/continious_atan2.o] Error 1
make[1]: *** [_module_/tmp/tmpcrqB79] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-122-rtai'
make: *** [modules] Error 2
badger@rugbot:~$

Any clues as how to proceed? Thanks for your incredible help on this.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Nick -

I have been trying to debug your latest wonder "continious_atan2.comp". I have gotten all of the syntax issues taken care of but still having issues with line 17 error of invalid operands to binary % (have 'real_t' and 'double'). My programing knowledge was non-exsistant and now only slightly better. I think that I have determined that there are 2 different data types in one equation, and figured out that the last 360. is the 'double' part of the error but I am not sure which part is the "real_t'. I think my main research problem is that I am not sure which programming language is being used and what I need to learn more about. I'm thinking it is C++ but maybe Python? Could you give me a hint as to which so I can continue in a somewhat useful direction?

On a related note, the conversation on the "tangent knife" discussion is quite helpful and the ever so simple regex to change the gcode to G00 for all separate "A" moves is a great solution that helps with my task. I think that having atan2.comp and continious_atan2.comp work as you designed will make my machine work smoother using LinuxCNC to rotate the axis independent of the gcode.

Thanks for everyone's help, this forum is great.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

Sorry for the delay with answer.

It says:
continious_atan2.comp:17: error: invalid operands to binary % (have 'real_t' and 'double')
hmmm... it is related to:
a%360.
try to change it to fmod(a,360.)

and
continious_atan2.comp:24: error: expected ';' before 'else'
just add ; in those lines....


See new version in the attachment.

PS the language is C.
PSS I hate C! :twisted:
Вложения
continious_atan2.comp.tar.gz
(426 байт) 1576 скачиваний
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Nick -

Thanks again for all of your ongoing help with my project. Last time I checked this is a recreational / voluntary group and you are under no obligation to answer at any time, let alone quickly. I got a little excited and anxious about my progress.

With that being said, the latest version of continious_atan2 would not load, coming up with the error on line 17 error: implicit declaration of function 'fmod'. In the mean time I have concluded that for my project trying to get LinuxCNC to do the heavy lifting of my needs is not the best approach.

For everyone's benefit let me recap my project. I am trying to make a small scale carpet / rug making machine. The basic machine is a gantry type of arrangement approximately 8 x 10 feet, made of wood and mounted on the wall. In place of the usual spindle is a needle mechanism that punches the yarn through a loosely woven linen fabric, forming a loop on the other side. For the punch needle to work correctly it needs to face the direction of travel similar to a "Tangent Knife". I make my design in Inkscape and then generate the gcode with the most excellent extension GcodeTools. The generated gcode includes "A" axis rotations in arc moves followed by a single line of "A" move as G01. In the trial set up of my machine I am using a travel speed of 400 mm per minute (F400) which also means that when the "A" axis is making a G01 move it is rotating at 400 degrees per minute, which is quite slow. Oddly, when incorporated in a G02 or G03 move the "A" axis easily keeps up with any arc and is clearly rotating at a speed greater than 400 degrees per minute. In effort to overcome the slow rotation of G01 "A" axis moves I explored the atan2 component in LinuxCNC which smoothed out the motion quite a bit except for the quirky behavior of reversing direction when it tried to rotate past zero degrees. Sometimes too smooth can be a bad thing. With smooth curves, using atan2, everything worked well but when there are sharp angular direction changes the forward movement continues while the needle is still rotating to the correct position, which can end up jamming the yarn in the needle.

In the thread “Tangent Knife” Migoupil came up with the elegantly simple solution of 'regex("G01 A","G00 A");' which changes all of the G01 “A” axis moves to rapid G00 moves. This speeds up the machine incredibly. In a simple test with out the regex I had a run time of 5 minutes, with the regex it was 3 minutes. This will vary with the program but its fabulous! Thanks go out to Migoupil.

In many cases the value of the G01 “A” line is exactly the same as the ending value of “A” in the proceeding G02 or G03 arc move. Even with changing G01 to G00 there is a slight slow down in movement even though no rotation is taking place. I edited out the “duplicate” lines in hopes it would yield continuous movement and it did not make a difference. Changing G64 P Q settings also did not seem to make any difference, which OK. My machine is still many magnitudes faster than working by hand so I am very happy with Inkscape, GcodeTools, LinuxCNC, cnc-club.ru and Nick.

A few more mechanical tweaks and I will post photos and possible a video of the Rugbot working.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

When you go from Feed (G01) to rappid move (G00) linuxcnc will always make a stop. It will behave this two lines like it was Exact path.
So probably you can just increase speed of A axis to get more speed...
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Nick -
Due to "mechanical" issues my current strategy is to make each stitch from a stationary position so I didn't notice coming to a full stop as a result of switching 'A axis" moves to G00. Makes sense though. I'm planning on switching some parts designs and making stitches while moving so this is an important consideration. Say that I'm using millimeters as units, with a feed of 960 millimeters per minute doesn't that limit the "A axis" rotation to 960 degrees per minute regardless of any faster settings in the "ini." file?
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

Probably it can influence A speed - because the speed for the feed is calculated directly (i.e. 1 degree=1mm)...
But you can always add scale to A axis making it 36 degree for the full turn and scale all coordinates along A axis by 0.1
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I enjoy tricking the machine to do my will. Is there any way to the way trick tangent knife in gcodetools to generate the correct angle? I will try to change the scale in the tangent knife by a scale of 10, and the scale of the A axis in Linuxcnc by a scale of 10 and see what caos results.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

spiralbase.svg
(11.55 КБ) 1192 скачивания
This is probably getting boring for most of the world but.....

I just ran the Rugbot in the air with a simple program of spirals. I ran the pattern with and without the "A axis" running. The pattern consists of a 12 layer CCW spiral connected to a 12 layer CW spiral. When I ran the Rugbot without the A axis the total time was 4:39 minutes, with the A axis running the total time was 4:50 minutes. This implies that in blended moves the A axis will run at speeds greater that the designated F960 if 1mm = 1 degree. If the A axis was actually running at a feed rate of 960 degrees per minute in the blended moves the program should have taken about 9 minutes to complete. Part of the time diffence is because the A axis needed to rotate 180 degrees at the start, which it sounded like it did at a rate of 960 degrees per minute.

So what practical matter does this make? When using the "Tangent Knife" tool in Gcodetool it inserts a G01 line of code for the A axis between every line of G01 gode for the X,Y,Z,I,J,A. With smooth curves or straight lines the value of "A" on the single line is usually the same as the value for "A" included in the previous line and you get nice continous movement. No problems here. If you have a sharp corner, from a corner node in iInkscape, the "A" axis will only rotate at the designated feed rate which is usually relative slow when comparing degrees to millimeters. ( I would think it would be even worse if using inches?). When I edited all of the "G01 A" lines of code to "G00 A" code using "search and replace" in Gedit I still had smooth continuous movement with out any starting and stopping between lines of G02 G00 G03 etc and had a run time of 4:41 minutes which is practically the same as when I ran the test without the A axis in use.

So, in one practical test, sort of, many of my problems seem to be solvable by doning a search and replace of the gcode file in a text editor to replace all of the "G01 A" with rapid "G00 A" with little consiquences. (I have an regex in the "additional post pprocessor" field of the preferences box in Gcodetools so I can't easiely do it when generating "Path to Gcode".)
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

The rugbot lives! Many thanks to this forum and gcodetools. When I started my project I had no experience with CNC and it seemed like the commercial software couldn't be easily modified to do what I needed. With help from Nick, this forum and the folks over at LinuxCNC I was able to make a device that works for what I needed. Thanks. Enjoy the video.
https://youtu.be/KcHUKqY422M
Аватара пользователя
al_us
Почётный участник
Почётный участник
Сообщения: 553
Зарегистрирован: 24 июн 2015, 09:27
Репутация: 115
Настоящее имя: Алексей
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение al_us »

badger писал(а):The rugbot lives! Many thanks to this forum and gcodetools. When I started my project I had no experience with CNC and it seemed like the commercial software couldn't be easily modified to do what I needed. With help from Nick, this forum and the folks over at LinuxCNC I was able to make a device that works for what I needed. Thanks. Enjoy the video.
https://youtu.be/KcHUKqY422M
good job :good:
Ответить

Вернуться в «English forum»