gearing of axis for stitch regulation

cnc-club.ru for English speaking users
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

gearing of axis for stitch regulation

Сообщение badger »

What I am trying to do is make rugs/carpet on a CNC machine. Previous discussion has been in the English forum under “custom tool definition” in which Nick was extremely helpful in writing a regex for me that solved the problem there when I was using an air cylinder to move the needle. After running this on various controllers in simulation mode I have become greedy for faster and smoother movement. Now I need to find out if it is possible to to synchronize or “gear” the needle/spindle movement to the movement along the path of the combined XY moves. This may also be beneficial to others working on CNC quilting or embroidery projects. What I need to do is have regular stitch length along the path regardless of actual velocity. Needle movement will probably be one stitch per revolution of a stepper motor with an effective length around 4 mm.

I have searched scripts, strings, macros, HAL and other methods with no success with my limited experience. There are separate devices for quilting referred to typically as “stitch regulators” that control a sewing machine by using two encoders to measure XY velocity and via a propriety controller adjust the speed of the sewing machine to match the movement. This is one possible route but I would prefer a more integrated approach if possible. The best reference I have found is:

http://www.galilmc.com/learning/motionc ... itcher.pdf

but I was hoping do come up with a more home brew solution with gcodetools if possible.

A video if the commercial inspiration is at:

http://www.youtube.com/watch?feature=pl ... S0Vkz2R3qU

So far I have not started construction of the actual machine in hopes of getting it right the first time. Any suggestions or help would be greatly appreciated.

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

Re: gearing of axis for stitch regulation

Сообщение Nick »

If you use LinuxCNC you can try to connect your needle to pin

motion.current-vel OUT FLOAT
Current cartesian velocity

So you'll be able to activate needle punch at current speed.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Nick -

Excellent! Answer and puzzle all in one. Move needle with pin, very Zen. I will take a couple of weeks to try to figure out HAL and what not and then get back to you.

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

Re: gearing of axis for stitch regulation

Сообщение Nick »

How your punch signal looks like? Just activate one pin?
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I haven't gotten that far yet. It looks looks like I will try to get LinuxCNX running on an old computer and play with it tonight. I was thinking of using a stepper motor on a crankshaft to basically make one stitch per revolution and just adjust the steps per movement to make it work. (Adjusting more or less steps of the needle motor to work with the steps of the XY mechanisms) I haven't purchased hardware yet pending figuring out all of the software and design workflow details. My work flow has changed slightly from what you helped me with before with the swell regex to move the needle with an air cylinder with XY stopped. Instead of only moving 4mm +/-, stopping and making a stitch, I am now thinking of making stitches on the fly, yet synced with the movement. It makes sense in my head anyway.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

badger писал(а):I am now thinking of making stitches on the fly, yet synced with the movement. It makes sense in my head anyway.
The bad thing that can came up using this way is that you will probably miss base lines. So one row can be "skewed" from anoter...

What "punch per second" rate are you planning to achieve?
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I was thinking of using some restraint and keeping the speed to 240 stitches per minute or 4 per second. If stitch length is around 3 mm then we get 720 mm per minute which now seems kind of fast. My machine idea is to have it be mounted on the wall and made largely of wood and driven by 23 size steppers with belt drive. No torque from a spindle so I have some confidence in my plans.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

Hmmm... probably it can be made with ClassicLadder.

But first of all we have to define the criteria of the Punch. Will it be distance from previous punch or exact position or ((exact position) mod (pinch rate))...
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Position is relative. Originally with air power punch/ needle I was using absolute position which required 3 lines of code for each stitch and required the machine to stop to make stitch. Now I am thinking more like the commercial machine in the video where the stitch is made by one revolution of a motor while the gantry is in motion. The fabric backing is relatively loose and the length of time the needle is in the fabric is relatively short so it should work well. I am working my way through all of the linuxcnc documentation and it is staring to make sense, sort of. Thanks for all of your help.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

It will be easier if you have working mechanics on which we would be able to test our configs...

There are several ways to solve your problem and I do not know which is the best...

We can contorl the punch by additional component - that will punch every XX traveled mm.
We can controll the punch as sepparate axis - then it will be syncronied with other axis.
Or ...

hmmm... probably the second way can be the best...
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I agree that I need to make the machine. After a lot of research into various systems it seams that Linuxcnc is the hands down winner. I will put together a computer and probably get Mesa 5i25 / 7i76 boards and the stepper and mechanical components. Of course the workflow will be Inkscape and gcodetools because they too are the best. Thanks for all of your help Nick.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

You are welcome! Just do not forget to write when you machine will be ready for the tests :)!
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

I have put together a computer and a couple of drivers and it looks like "motion.current-vel" will work. I did a basic stepconf and added axis 6 to control the needle as a linear axis. Right now I just have 2 motors on the table top with the "needle" motor triggering a counter so that I can confirm the stitch count as I ran some tests. Running around a square pattern and a straight diagonal line it seems to work well with the number of stitches and the travel time being what I wanted. I had to change the MAX_LIMIT and MIN_FERROR TO 999999.0 to avoid following errors but it seems to work good. Next up is to purchase more parts and build the machine, I will update you that when there is something more to tell.

Thanks for your help Nick, I may be able to pull this off.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

The machine is nearing completion, hopefully. I tried "motion.current-vel" to sync the needle motor with the movement of the gantry and it worked well, mostly. It caused the needle to move with changes in the Z axis and also rotation of the A axis since I am using Tangent Knife tool to keep the needle pointing in the correct direction. I switched to using "hypot" to just use the X/Y axis velocities and it works even better.

I have two enhancements that I need help with. When using "tangent knife" it generates "A axis" moves in the same line as XYZ in G02 and G03 lines, which is excellent but then follows up with a G01 line for just an A axis move. Most of the time this is virtually the same as the ending position of "A" anyway but causes XY motion to stop for the "A" move. It works fine but slows the machine down. When I manually edit out most of the "A" only G01 lines the machine works fine. The question is, is there a way to post-edit or prevent G01 lines for "A" only moves if they are within a certain range, like 5 degrees? There are some cases, such as sharp 90 degree tuns where having a separate G01 A axis line is critical so I can't just use a simple REGEX to edit them all out. Leaving them out with "smooth" nodes but including them with "corner" nodes may work if that is an option.

My other problem is more of a LinuxCNC issue that mainly applies to Tangent Knife use. LinuxCNC seems to treat all units the same when calculating feed rates, such as 100 degrees is treated the same as 100mm or 100 inches. I am running my machine at F960, using mm, which is quick enough and gives my 240 stitches per minute which is fine. But this also means that the A axis is only moving at 960 degrees per minute which is really slow. It slows the X/Y movement down in tight turns which works but is just slow. One idea I have is to use REGEX to add F960 to every G02, G03 XYZA line and then add F21600 to all of the G01 lines which are just "A" moves. If there is some other option I am open for suggestions.

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

Re: gearing of axis for stitch regulation

Сообщение Nick »

Possibly you can try to config "native tangent knife using linuxCNC components"
You'll gona need atan2 component and just connect some pins:

Код: Выделить всё

loadrt atan2 
net atan2x => atan2.0.x <= axis.0.joint-vel-cmd 
net atan2y => atan2.0.y <= axis.1.joint-vel-cmd 
net atan2a <= atan2.0.a => [command to A axis] 
Atan2 can be found here:
Re: Станок канатной резки камня с ЧПУ #124
But it's in Russian.
Ok here's atan comp:
atan2.comp.rar
(375 байт) 772 скачивания
After this axis A will be automatically rotated on any towards any movement.

Using this way you will probably able to solve all your problems :)... But possibly it'll cause new problems :freak:.
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Progress is being made. "atan2" works as it should to create automatic tangent knife function. It causes "ferror" but I just adjusted the settings in the ini. file to unrealistic high numbers and it works fine in simulation. The new issues is that both the "atan2" component and the "hypot" component need pin "axis.0.joint-vel-cmd" to work. In the attached hal file if I comment out the key parts of axis.3 which rotates the needle with atan2, axis.6 works fine to control the needle movement. The opposite works fine also where I comment out axis.6 then atan2 works, but I can't use them at the same time. The goal is to generate regular gcode for the path and then have linuxcnc automatically control both the rotation of the needle and the stitches at the same time. Attached should be the hal and ini files along with a photo of mechanism. Is there a way to attach one pin "axis.0.joint-vel-cmd" to two different components? My terminology may not be quite correct. :thinking:
Вложения
my-mill.hal
(4.11 КБ) 1459 скачиваний
my-mill.ini
(2.15 КБ) 1432 скачивания
rugbot.jpg (12843 просмотра) <a class='original' href='./download/file.php?id=29904&sid=afaeabd9168527327f9acefcaac476c5&mode=view' target=_blank>Загрузить оригинал (71.11 КБ)</a>
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Day 3, charts, graphs and arrows, trial and error, it works. :D

net xjoint <= axis.0.joint-vel-cmd
net yjoint <= axis.1.joint-vel-cmd

net xjoint => atan2.0.x
net yjoint => atan2.0.y

net xjoint hypot.0.in0
net yjoint hypot.0.in1

Now both atan2 automatically controls rotation of needle to follow path, and hypot automatically control the needle to match the velocity of movement. LINUXCNC and cnc-club.ru rock!!!!

Many thanks to Nick. Now to make some tweaks to the machine and I will post progress.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

badger писал(а):It causes "ferror"
You can just remove A axis from your config.


Interesting machine you have :good:! Will wait for more photos and videos :)
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение Nick »

PS Why do you use hypot instead of pin motion.current-vel?
Аватара пользователя
badger
Новичок
Сообщения: 38
Зарегистрирован: 30 дек 2012, 00:32
Репутация: 3
Контактная информация:

Re: gearing of axis for stitch regulation

Сообщение badger »

Remove A axis? I need to be able to point needle in dirrection of travel for the yarn to feed correctly. Is the A axis not needed to drive the stepper to do rotation? (in photo the motor on the left drives the large black pulley to rotate the needle.)

Originally when I used motion-current-vel to control axis.6 to move the needle in coordination with the movement and it worked fine for the X/Y movement. I was also using tangent-knife in gcodetools to rotate the needle and motion-current-vel would also register the A axis movement (with no forward movement) the same as forward movement and move the needle leading to irregular stitch length.

If atan2 can rotate the needle without it being "A axis" then motion-current-vel may work just as well.
Ответить

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