Page 1 of 1

automatic sawing machine

Posted: Mon Mar 26, 2012 10:57 am
by nuwan5213
hi all,
my recent project is automatic sawing machine and i will give some stich count and let machine to start by relay output.aftrer finish that alarm comes and stop the machine.
ok im getting problem with stich counting sensor ,
im using photo inturrupter and get the signal ,with 1000 rpm , machine motor counter is correct but more than that is count is very wrong.
im using 20 mhZ xtal and my program is attached with this.
please check that and give solution.im stucked heare..
(i used mr fotios's program to scroll the display]

thanks,
best regards,
nuwan. :(

Re: automatic sawing machine

Posted: Mon Mar 26, 2012 3:59 pm
by Benj
Hello Nuwan,

Sound like an interesting project. I have had a brief look at the file but hard to know what's doing what at the moment. Could the limitation be something to do with the delays you are using or the time it takes to write to the LCD?

If it were me doing the project I would probably use a INT interrupt pin for the incoming signal so that I could generate a hardware interrupt for every time the signal has a rising edge. This way it should be quite simple to ensure that no pulses are missed even if processing a delay or other "slow" code such as the LCD routines.

Re: automatic sawing machine

Posted: Mon Mar 26, 2012 10:30 pm
by nuwan5213
hi ben.
Could you give me any example flowcode.

Thanks,
Best regards,
Nuwan.
Sent from my mobile device.

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 7:58 am
by saschech@gmx.de
Hello nuwan5213

A long time i build automatic-units for sewing machines.A importent questione: what type of motor you use for your project?

Regards Wolfgang

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 8:26 am
by nuwan5213
hi,
Wolfgang.
im using ac servo mortor calld ho-hsing .im ok with start stopping and varing speed of motor and i cand understand inturrupt principle.
anyway i change my program with rb0 inturrupt.
please check that.
i saw rbo property window shows 15HZ for scaning frequancy.and cannot edit that.
what is that???????????????????.if rbo scan frequancy is that 15hz valeue i think it is impossible to catch the hand wheel photo inturrupter signal again in high revolutions
of the motor.
am i correct.
regards.
nuwan

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 10:30 am
by Benj
Hello Nuwan,

The 15Hz showed in the interrupt property window is greyed out and only applies to timer based interrupts. The I/O based interrupts such as INT or IOC will run as fast as you can process the interrupt and return back to main from your interrupt service routine. Because of this it is normally advised to do as little coding in the interrupt service macro as possible.

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 11:16 am
by saschech@gmx.de
Hi nuwan5213

Normaly,if you work with a dc-mot the count-impuls is giving out "1imp. per turn".For only count stich and stop,I use a prog.counter it is the easyst way
for memory all parameters;eg. Signo721 http://www.hengstler.com/de/products/shop.php

regards wolfgang

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 5:03 pm
by nuwan5213
hi ben,
Did you see the my progrm "test4"
Is anythig wrong with it.
Regards nuwan.
Sent from my mobile device.

Re: automatic sawing machine

Posted: Thu Mar 29, 2012 5:20 pm
by Benj
Hello,

Looks ok to me though i have not checked the actual code itself, basically just check clock and config sections looked ok.