Pulse train skip one cycle - Page 1
Forum section: electronics / beginners

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 10:26:47 am
content: HiI 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

author: PA0PBZ
author_rank: Super Contributor
timestamp: March 04, 2024, 10:37:23 am
content: Do you need to retain the pulse width? If not a divide by 2 flipflop will do:

author: shapirus
author_rank: Super Contributor
timestamp: March 04, 2024, 10:38:20 am
content: 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.

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 10:43:02 am
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: March 04, 2024, 11:20:42 am
content: Sounds like a Karnaugh map puzzle to me.

author: shapirus
author_rank: Super Contributor
timestamp: March 04, 2024, 11:49:44 am
content: 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: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_circuitsto 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?

author: shapirus
author_rank: Super Contributor
timestamp: March 04, 2024, 12:13:49 pm
content: Quote from: shapirus on March 04, 2024, 11:49:44 am...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:

author: Terry Bites
author_rank: Super Contributor
timestamp: March 04, 2024, 02:03:27 pm
content: 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?

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 02:34:09 pm
content: 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 thinkthe small micro variations in "and or nand" gates will affect the brushless controller bypassed by this, ....

author: Jason Henry
author_rank: Contributor
timestamp: March 04, 2024, 02:39:46 pm
content: 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.

author: shapirus
author_rank: Super Contributor
timestamp: March 04, 2024, 03:03:47 pm
content: Quote from: marce002 on March 04, 2024, 02:34:09 pmThis 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: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.

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 03:29:07 pm
content: 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

author: PA0PBZ
author_rank: Super Contributor
timestamp: March 04, 2024, 03:44:32 pm
content: 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.

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 04, 2024, 03:59:04 pm
content: Quote from: marce002 on March 04, 2024, 03:29:07 pmThat won't work!

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 05:28:06 pm
content: 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.

author: shapirus
author_rank: Super Contributor
timestamp: March 04, 2024, 05:36:55 pm
content: Quote from: marce002 on March 04, 2024, 05:28:06 pmI 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.

author: langwadt
author_rank: Super Contributor
timestamp: March 04, 2024, 05:45:27 pm
content: Quote from: marce002 on March 04, 2024, 05:28:06 pmthe hall sensors control the commutation of the motor windings

author: marce002
author_rank: Regular Contributor
timestamp: March 04, 2024, 10:38:16 pm
content: 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.

author: marce002
author_rank: Regular Contributor
timestamp: March 18, 2024, 01:59:26 pm
content: :scared:one question. if i maintain the pulse width i keep same torq but if thepulse with is doubled.. im increasing torq right?

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 02:15:06 pm
content: Quote from: marce002 on March 18, 2024, 01:59:26 pmwhat 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

author: marce002
author_rank: Regular Contributor
timestamp: March 18, 2024, 02:55:43 pm
content: 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.

author: PA0PBZ
author_rank: Super Contributor
timestamp: March 18, 2024, 03:03:09 pm
content: 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?

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 03:11:35 pm
content: Quote from: marce002 on March 18, 2024, 02:55:43 pmit is very unlikely that that hall signal are only ued to measure speed, the halls sensors are almost certainly used to commutate the motor

author: marce002
author_rank: Regular Contributor
timestamp: March 18, 2024, 06:55:51 pm
content: 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

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 07:53:07 pm
content: Quote from: marce002 on March 18, 2024, 06:55:51 pmno.. let me repeat, what you are trying to do will not work, messing with the hall sensors will not workwhat are trying is like hoping a car will go faster if you only fire the spark plugs every other time

author: marce002
author_rank: Regular Contributor
timestamp: March 18, 2024, 07:56:00 pm
content: i would like to hear anothers opinions since im not going to interfere with the sensors ... im just telling the controller that speed is half.

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 09:27:11 pm
content: Quote from: marce002 on March 18, 2024, 07:56:00 pmspeed is not the purpose of the sensors, the purpose off the sensors is to tell the controller when and how to drive each coil of the motor that is why there is three of them

author: marce002
author_rank: Regular Contributor
timestamp: March 19, 2024, 11:26:42 am
content: I need to explain that this motor does not have speed sensor nor magnets so the speed computation is with hall sensors.. it is very common... now i just want to div by 2 the freq of the pulses without interfering with phase wires...

author: Ian.M
author_rank: Super Contributor
timestamp: March 19, 2024, 11:44:36 am
content: I agree with Langwadt and DavidAlfa. The controller uses the three hall sensor signals to generate the timing for the phase sequence driving the coil wires. If you halved the pulse rate from each sensor the phase sequence frequency would also be halved, and would no longer be synchronous to the rotor, resulting in rapid deceleration of the motor if its spinning or failure to start if not. Also most controllers would detect a sensor fault and error out.The *ONLY* option that could achieve more speed from your existing controller would be if its firmware can be reconfigured to increase the controller's max. RPM limit and remap its throttle response. Even if you have the controller's configuration utility, this is unlikely to be possible for a factor of two speed increase if the firmware is closed source.

author: langwadt
author_rank: Super Contributor
timestamp: March 19, 2024, 12:30:03 pm
content: Quote from: marce002 on March 19, 2024, 11:26:42 amit doesn't need a speed sensor, it can use the hall sensors that are already there to control the coils. The motor almost certainly have magnets. you can't do anything to the hall signals without messing up how the phase wires are driven

author: marce002
author_rank: Regular Contributor
timestamp: March 19, 2024, 05:01:32 pm
content: PAOPBZ?

author: PA0PBZ
author_rank: Super Contributor
timestamp: March 19, 2024, 10:28:28 pm
content: Quote from: marce002 on March 19, 2024, 05:01:32 pmAll I know is that you asked in your first post: how to halve the frequency of the pulses. You didn't specify where these pulses came from or where they were going to so I showed you how to do a divide by 2. I have no experience with motor controllers so I can't comment on the information that was added later. If more experienced members say that you can't do what you are trying to do I accept that.

author: EPAIII
author_rank: Super Contributor
timestamp: March 20, 2024, 11:17:43 am
content: Any circuit that you put in the path will have some delay: it is just a matter of how much. So, unless you want to deliberately introduce a full, one cycle delay, it will not be "exact".You may want to think a bit more about just what is really needed and formulate your requirements in a more precise manner.Quote from: marce002 on March 04, 2024, 03:29:07 pm

author: EPAIII
author_rank: Super Contributor
timestamp: March 20, 2024, 11:29:19 am
content: Perhaps if you gave us more information about the exact motor and controller board you will be using, then better advise could be had. Designing a motor control scheme can be tricky.Or provide as much info as you can cobble together at this stage in your design process.