Author Topic: Pulse train skip one cycle  (Read 1452 times)

0 Members and 1 Guest are viewing this topic.

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Pulse train skip one cycle
« on: March 04, 2024, 10:26:47 am »
Hi

I would like to know of a simple circuit to allow me to skip one entire cycle (skip even allow odds) of 3 independant trains 0 - 5v pulses from a 3 different hall sensors.
This will half the "freq" but keep intact the timming occurrance .. i dont want to use a microprocesor because seems to be simpler maybe a flipflop diode controled or something to void "even" cycles in each signal...

 :palm:sorry if it is very easy to achieve that is why posted in beginers.8

« Last Edit: March 04, 2024, 10:40:30 am by marce002 »
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5129
  • Country: nl
Re: Pulse train skip one cycle
« Reply #1 on: March 04, 2024, 10:37:23 am »
Do you need to retain the pulse width? If not a divide by 2 flipflop will do:

Keyboard error: Press F1 to continue.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1368
  • Country: ua
Re: Pulse train skip one cycle
« Reply #2 on: March 04, 2024, 10:38:20 am »
An immediate idea is to use a frequency divider (counter to 2) feeding into one input of a NAND gate, whose other input receives the original input signal. This way we can: a) divide the frequency in 2; b) synchronize the edge of the outgoing pulse with the original pulse, thus effectively skipping every other pulse.
 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #3 on: March 04, 2024, 10:43:02 am »
thanks yes need to.retain pulse width and also would need IC brand/part to check if available and schematic if it not hard to post.
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: Pulse train skip one cycle
« Reply #4 on: March 04, 2024, 11:20:42 am »
Sounds like a Karnaugh map puzzle to me.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1368
  • Country: ua
Re: Pulse train skip one cycle
« Reply #5 on: March 04, 2024, 11:49:44 am »
So for example something like this.

I wasn't able to find a spice model of a binary counter (and didn't care to search beyond a couple of models I readily remembered), so it's not shown, but that part is trivial -- just look in the datasheets. Suitable parts would be for example HEF4520, CD4520 or similar. A decade counter such as CD4017 will also work -- we only need to count to 2.

I also had no success simulating a D flip-flip frequency divider (aka toggle circuit). Probably the model was wrong, would need more time to figure it out. But that can also be an option, as long as it works.

Now, once you have two signals, one the original one, and another with frequency divided by 2, you do the following. You actually need an AND gate, not NAND (as it outputs an inverted signal), or, as shown, NAND followed by inverter:

2051117-0

2051123-1

The RC delay at the input receiving the original signal is required to fix the glitch of the NAND output going briefly low when the original signal is transitioning to high and the divided one to low: you need to hold the original signal low for a bit longer. The RC values are to be determined experimentally.

Since one of the NAND inputs will receive a signal that may not have sufficiently short rise and fall times because of the RC delay, it has to be one that has Schmitt trigger inputs, such as the 74xxxxx132 gates, for example. See e.g. https://en.wikipedia.org/wiki/List_of_7400-series_integrated_circuits to find suitable parts that will be available wherever you'll be sourcing them from.

p.s. this also preserves the original pulse width, save for the small length change caused by the RC delay circuit. What is the frequency of your signal?
« Last Edit: March 04, 2024, 12:09:36 pm by shapirus »
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1368
  • Country: ua
Re: Pulse train skip one cycle
« Reply #6 on: March 04, 2024, 12:13:49 pm »
p.s. this also preserves the original pulse width, save for the small length change caused by the RC delay circuit. What is the frequency of your signal?
...and there's also a bit of a phase delay added. Shown with a big capacitor, in reality it should be on the order of a few microseconds:

2051156-0
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Pulse train skip one cycle
« Reply #7 on: March 04, 2024, 02:03:27 pm »
The attched kills alternate pusles.
You need to add a small delay to prevent gliches. This is best done with a another inverting gate as shown.
A small RC delay is also acceptable. A lone big R will conspire with the gate input capcitance to create delay, its shabby but it works.

How can you tell evens from odds in a continuous pulse train?
How would you intialise the count?


 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #8 on: March 04, 2024, 02:34:09 pm »
thanks shapirus , low freq.. , the signal comes from hall sensors in a bldc motor wheel and the idea is to make adjustable speed switch, i do not think
the small micro variations in "and or nand" gates will affect the brushless controller bypassed by this, ....
 

Offline Jason Henry

  • Contributor
  • !
  • Posts: 13
  • Country: ch
    • None
Re: Pulse train skip one cycle
« Reply #9 on: March 04, 2024, 02:39:46 pm »
You can use a simple D flip-flop with the clock input connected to the even pulse train and the data input connected to the inverted output of the flip-flop. This will effectively skip every other cycle of the pulse train.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1368
  • Country: ua
Re: Pulse train skip one cycle
« Reply #10 on: March 04, 2024, 03:03:47 pm »
thanks shapirus , low freq.. , the signal comes from hall sensors in a bldc motor wheel and the idea is to make adjustable speed switch, i do not think
the small micro variations in "and or nand" gates will affect the brushless controller bypassed by this, ....
This sounds like the problem could perhaps be rephrased like "keep the frequency intact, but limit the maximum output width of every input pulse". If the speed controller is expecting a PWM signal, which is typical, then this may solve what you need to achieve just as well, and with less components.

Example:

2051471-0

2051477-1


Of course the RC values are to be chosen depending on your desired adjustment range (or a fixed value).

The two inverting Schmitt triggers shown can be substituted by a single non-inverting Schmitt trigger buffer, e.g. SN74LVC1G17. You can also use one of the hex inverter ICs such as CD40106/HEF40106, or quad NAND or NOR gate packages (which work as inverters when the two inputs of a single gate are connected together), but again, they must have Schmitt trigger inputs.

Make sure to check the datasheets for the working voltages, max output current, switching times etc.

p.s. depending on the characteristics of the signal source, you may need to buffer and/or level limit its output before feeding into the logic gates or whatever it will be coming into. And/or change the values of the components shown in the schematic above: if the source isn't low impedance, which is likely, then reduce the capacitor to say 1nF or even lower and increase the resistor/potentiometer accordingly. You will basically want to make the capacitor as small as is practically possible, so as not to load the signal source too much, before noise becomes a problem.
« Last Edit: March 04, 2024, 03:15:27 pm by shapirus »
 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #11 on: March 04, 2024, 03:29:07 pm »
but i need to not affect the bldc motor feed to coils, so the timming should be exact. I need to send identical pulses to the controller like the original pulse train, so the motor coils do their job, but only affecting the amount of pulses (sending less pulses) , so the controller will speed up the train because the input is a lower speed wheel
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5129
  • Country: nl
Re: Pulse train skip one cycle
« Reply #12 on: March 04, 2024, 03:44:32 pm »
Are you sure that the pulse width stays the same with varying speed? I would not surprise me if the duty cycle ls always close to 50% - did you measure it?

Also, what frequency range are we talking about? If you start using analog delays and the frequency varies a lot you could run into problems.

Keyboard error: Press F1 to continue.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
Re: Pulse train skip one cycle
« Reply #13 on: March 04, 2024, 03:59:04 pm »
so the controller will speed up the train because the input is a lower speed wheel
That won't work!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Ian.M

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #14 on: March 04, 2024, 05:28:06 pm »
the idea is re-utilize a hub motor and common controller from an old scooter for another project, and i need to make the wheel spin at double speed,  so i wanted a minimal circuit instead to buy another controller/motor . im using 90v max. so, i wanted to put a circuit between the controller and the motor hall sensor wires, to be able to spin faster. i did not measure anything yet this is preliminary, and did not know if i need to deal with a pwm signal, because the wheel rotation speed determines the frequency of the pulses via the hall sensor,,, maybe im wrong at all, ,  if what i was  thinking is incorrect, please forgive me, since i just wanted to trick the controller to make the motor spin faster , with skipping the even 5v pulses from the train.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1368
  • Country: ua
Re: Pulse train skip one cycle
« Reply #15 on: March 04, 2024, 05:36:55 pm »
the idea is re-utilize a hub motor and common controller from an old scooter for another project, and i need to make the wheel spin at double speed,  so i wanted a minimal circuit instead to buy another controller/motor . im using 90v max. so, i wanted to put a circuit between the controller and the motor hall sensor wires, to be able to spin faster.
I see what you mean. Basically reduce the number of pulses coming from the wheel RPM sensor (hall effect or magnet+reed switch, like on bicycle computers, same result) to trick the controller into thinking that the wheel is rotating twice as slow as it is in reality, and adjust the rotation speed to twice the RPM of what it would've been otherwise.

Well, then skipping every other pulse should work fine, but it is very likely, as is a natural thing to expect, that the controller is counting discrete pulses, and thus it is triggering to increment the counter only on the edges (either rise or falling), and in that case you don't need to care about preserving the pulse width at all: all you need to do is to divide frequency, which can be done with a binary counter or a D flip-flop as was proposed earlier.

p.s. whether the controller will be able to spin the wheel to double the RPM is another question, and it is also a question whether the speed sensing actually works like you imagine. It may very well be so -- bicycle computers, for example, work exactly this way, but it may also be different.
« Last Edit: March 04, 2024, 05:38:59 pm by shapirus »
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Pulse train skip one cycle
« Reply #16 on: March 04, 2024, 05:45:27 pm »
the idea is re-utilize a hub motor and common controller from an old scooter for another project, and i need to make the wheel spin at double speed,  so i wanted a minimal circuit instead to buy another controller/motor . im using 90v max. so, i wanted to put a circuit between the controller and the motor hall sensor wires, to be able to spin faster. i did not measure anything yet this is preliminary, and did not know if i need to deal with a pwm signal, because the wheel rotation speed determines the frequency of the pulses via the hall sensor,,, maybe im wrong at all, ,  if what i was  thinking is incorrect, please forgive me, since i just wanted to trick the controller to make the motor spin faster , with skipping the even 5v pulses from the train.

the hall sensors control the commutation of the motor windings
 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #17 on: March 04, 2024, 10:38:16 pm »
yes shapirus, the problem is that the correct timing with this pulses controls the current on the motor coils so it can turn in sequence, if I change any freq or width I think the motor will stop and or make weird noises. i would like to know if someone has increased a bldc motor using this technique / flip flop D circuit becsuse is trivial and did not see any particular uses like for eg speeding up a scooter.
« Last Edit: March 17, 2024, 12:05:35 pm by marce002 »
 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #18 on: March 18, 2024, 01:59:26 pm »
 :scared:one question. if i maintain the pulse width i keep same torq but if thepulse with is doubled.. im increasing torq right?


 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Pulse train skip one cycle
« Reply #19 on: March 18, 2024, 02:15:06 pm »
:scared:one question. if i maintain the pulse width i keep same torq but if thepulse with is doubled.. im increasing torq right?

what pulse width? what are you trying to do? if you are trying to mess with signals between motor and controller, the is pretty much sure to be: that will not work
 

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #20 on: March 18, 2024, 02:55:43 pm »
i did nothing yet  ... im just studying .. when we talked about "retain the pulse width" first msgs I wonder if this would change torque because you will be energizing more time right.
what i would like to do is what i have said before it is sending to the controller half the pulses from de hall sensors to make the controller compute a faster rotation speed.
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5129
  • Country: nl
Re: Pulse train skip one cycle
« Reply #21 on: March 18, 2024, 03:03:09 pm »
It totally depends on what the controller does, I guess it only uses the frequency of the incoming pulses to control the speed, that is why I asked you if you need to retain the pulse width, my guess is still not. Why not build the simple divide by 2 circuit I showed you and find out?
Keyboard error: Press F1 to continue.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Pulse train skip one cycle
« Reply #22 on: March 18, 2024, 03:11:35 pm »
i did nothing yet  ... im just studying .. when we talked about "retain the pulse width" first msgs I wonder if this would change torque because you will be energizing more time right.
what i would like to do is what i have said before it is sending to the controller half the pulses from de hall sensors to make the controller compute a faster rotation speed.

it is very unlikely that that hall signal are only ued to measure speed, the halls sensors are almost certainly used to commutate the motor
 
The following users thanked this post: Ian.M

Offline marce002Topic starter

  • Contributor
  • Posts: 42
  • Country: ar
Re: Pulse train skip one cycle
« Reply #23 on: March 18, 2024, 06:55:51 pm »
ok ... i inderstand i need to do 3..
 one for each sensor... they will be 3 flips and 3 ands or a chip migth have multiple packages? (i ask so do not need to buy 6 chips).. sorry now i realise that can work with only one set right? and last Q would be ... is it a mess to do it but not at 50% rate but only 25% speed increase using maybe arduinonor atinny? thks
« Last Edit: March 18, 2024, 07:33:27 pm by marce002 »
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Pulse train skip one cycle
« Reply #24 on: March 18, 2024, 07:53:07 pm »
ok ... i inderstand i need to do 3..
 one for each sensor... they will be 3 flips and 3 ands or a chip migth have multiple packages? (i ask so do not need to buy 6 chips).. sorry now i realise that can work with only one set right? and last Q would be ... is it a mess to do it but not at 50% rate but only 25% speed increase using maybe arduinonor atinny? thks

no.. let me repeat, what you are trying to do will not work, messing with the hall sensors will not work

what are trying is like hoping a car will go faster if you only fire the spark plugs every other time
 
The following users thanked this post: Ian.M


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf