Page 1 of 1

Recalculation of impulses

Posted: Wed Jun 09, 2021 8:10 am
by buvaylov
Help me please! I don’t know in which direction to move to solve the problem (the project for clarification in the appendix) of recalculating the number of incoming pulses and issuing to the controller output. Thanks in advance, Alexander

Re: Recalculation of impulses

Posted: Wed Jun 09, 2021 12:13 pm
by Benj
Hi Alexander,

Please can you provide more information which document are you referring to?

Re: Recalculation of impulses

Posted: Tue Jun 15, 2021 11:36 am
by buvaylov
It is necessary to recalculate the pulse repetition rate, for example, for every incoming eight pulses, six are generated in a continuous cycle

Re: Recalculation of impulses

Posted: Tue Jun 15, 2021 11:45 am
by buvaylov
a stepper motor in step-dir mode must receive a certain number of pulses from the pulse counter on the shaft, taking into account the recalculation of their number depending on the wire diameter

Re: Recalculation of impulses

Posted: Thu Jun 17, 2021 10:42 am
by Benj
Hello,

How's this?
convert_8_to_6_ATTiNY13.fcfx
(9.49 KiB) Downloaded 168 times

Re: Recalculation of impulses

Posted: Thu Jun 17, 2021 11:22 pm
by buvaylov
Thank you! I will try to work in this direction

Re: Recalculation of impulses

Posted: Thu Jun 24, 2021 12:01 am
by buvaylov
Hello! in the simulation, I did not see the relationship between the number of pulses at the input and the number of pulses generated. Also, the use of interrupts is not clear. I am attaching two examples, with and without interruption. Please point out my mistakes. Sincerely, Alexander

Re: Recalculation of impulses

Posted: Fri Jun 25, 2021 12:59 pm
by Benj
Hello,

in your code you have point = point + 3/4

point is a byte and 3/4 in integer maths will be 0.

I've changed your example so that it uses a counter and simply doesn't output every fourth pulse.
convert_8_to_6_ATTiNY13.fcfx
(9.93 KiB) Downloaded 182 times

Re: Recalculation of impulses

Posted: Tue Jun 29, 2021 4:29 am
by buvaylov
Thank you very much for your help! My apologies for the incorrect statement of the problem. I made a simple example to understand the algorithm to the solution. I make winding machine. The main shaft turns an ordinary electric motor, adjustable speed. Shaft sensor, outstanding 18 pulses per 1 revolution of the shaft. Shaft stacker with a step of 1 mm. to 1 turn, is driven by a stepper motor with reducer. The use of stepper motor only possible in the step/dir. Depending on the wire diameter for one revolution of the main shaft must produce a certain number of steps stacker, with the factor, why I gave examples of how I tried to make a conversion pulses. Sincerely, Alexander