Maker Pro
Maker Pro

Project Kickoff - Variable Frequency Generator WITH interrupts (gaps)

Hello Folks,

I have a very interesting project to start, but already struggling with the appropriate platform to use. The project is fairly simple code which I already have in my head, however I expect to reach some physical limits on the computing (time) and need some advice.

The project: I need to generate a variable 0 to 1.5kHz Frequency (to simulate a rotating device) with defined gaps in the rectangular shape of the frequency (for angle positioning).

Some background for further clarification: - The speed of a rotating device is measured via speed pickups on a gearwheel, in order not to only calculate the speed of the rotating element, the gearwheel has some gaps to determine the exact angle of the device at any time.

I would like to simulate this signal.

I am very familiar with industrial PLC controllers. However with a PLC cycle time of 10ms for even modern PLC´s I wont be able to exceed 50Hz. - So any common PLC controller is out of question.

If I want to succeed in my project, I need to get rid of "cycle times". To be most flexible with my frequency output I need a flexible cycle time with up to 300ux.

First, I wanted to use a regular frequency generator and using TTL logic (counters mostly) to inhibit certain pulses on the output of my circuit. Due to the high amount of 8 defined gaps in the frequency, before all counters need to reset, I ended up with over 60 TTL components and lots of challenges on the PCB design.

Its long time ago that I worked with PIC microcontrollers or Raspberry Pi (Gen 1) in my early studies and I'm looking now to find the most reasonable platform for this project.

Any recommendation which hardware platform to choose?

Thanks in advance for your input and all have a pleasant day, :)

Bgrds Mike
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
I was going to replay that I completely fail to understand what you need.

Then I decided that my response wouldn't be helpful so I deleted it.

Then I decided to post something so that you know that if you don't get any useful replies there may be a reason.
 
Thanks Steve for your feedback,

what I need are just some ideas or recommendation on what platform I could realize this project the most easiest way. Everything I have discovered so far is limited in terms of either fixed cycle times or too long cycle times in general. Especially industrial PLC's.

I would prefer a software solution compared to building a mechanical gear wheel with missing teeth or avoid building an analogue circuit with 60 TTL chips.

First I really thought that will be an easy projects, but as further I go, the more challenges I discover.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
I think the answer I'd give to that is to use a microcontroller. Starting out by prototyping something using an arduino would be a way to see how viable it is.
 

hevans1944

Hop - AC8NS
I fail to understand the "missing teeth" aspect of the problem. How many teeth are on the gear? How many teeth are missing? What is the pattern (if any) of missing teeth? Every third tooth? Every fifth and sixth tooth? Every other tooth with sometimes more than one tooth missing? A binary arrangement of tooth gaps? How do the "missing teeth" tell you the angle of the gear? Or is there just one missing tooth to serve as an "index" mark and you just count up teeth from there? Please tell us what you are trying to DO.

As for generating a 0 to 1.5 kHz pulse train with "missing" pulses, the easiest way to do that is to load a look-up table that specifies where pulses occur or don't occur and cycle through the table addresses at whatever speed produces the frequency you want. If the table consists of 8-bit bytes, you can copy each entry into a shift register and shift them out to an output port to create your pulse train, incrementing the table address and re-loading the shift register after every eight shifts. Less often than that if your look-up table has larger than one-byte data entries and you can use a longer shift register. Piece of cake for even the smallest PIC if your cycle time from the start of the sequence to its beginning again is short enough, which will depend on the number of gear teeth, missing or not.
 
Thanks guys, I feel the same way. Just wasn't sure if the frequency is going to be "manageable" for the micro controller I plan to use. I have bunch of PIC16 and PIC18Fxxx at home. I guess I just need to keep my instruction set as simple as possible. Then I should be good with 8 to 10MHz of base clock.

Thanks again.

@ Hevans1944,

Yes, the gaps are just indexes for certain position. However, the gear wheel has around 240 teeth, (yeah! Just enough for 8bit) :) ... with 8 missing teeth at certain locations. This is just that the electronics know the position (angle) of this wheel WITHOUT having to run an entire revolution. The amount of teeth between each gap is different and between 30 and 70 teeth.

The rotating element can't rotate in its actual state, so I want to simulate this frequency pattern to the pickup sensors in order to simulate the speed and angle without get electronics getting suspicious.

Thanks again.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
For a 1.5kHz signal, you create an interrupt at twice this frequency. At each interrupt you tougher the output state except when you calculate you're at the missing tooth. At this point you just ignore 2 interrupts.

By changing the interrupt frequency you will be able to alter the stimulated shouted of rotation.

This does not require an especially high clock speed.
 
Top