How to implement this schedule to fire 6 ultrasonic sensors?

Thread Starter

Xavier Pacheco Paulino

Joined Oct 21, 2015
728
Hello,

I have 6 ultrasonic sensors which I want to fire according to the following schedule: [Table attached]
How can I implement it by using timers, interrupts, or tasks in RTOS? It's a method to prevent crosstalk between sensors by firing them in a sequence of time, not simultaneously

They will fire in groups of 2.

First period:
S1 (sensor 1) fires at 24 ms
S2 = 49 ms
S3=24 ms
S4=49 ms
S5=24 ms
S6= 49 ms

Second period:
S1= 37 ms
S2=75 ms
S3= 39 ms
S4=77 ms
S5 = 41 ms
S6 = 79 ms

That's the schedule, I mean, for the first period, first S1 fires at 24 ms, then S2 at 49 ms, so S2-S1 = 25 ms, so when S3 fires, it's been 50 ms.
After first period, S1 fires again but at 37 ms after sensor 6 in first period.
Note that the shortest time difference between firings of any 2 neighboring sensors is 38.0 ms

As you know, to trigger an ultrasonic sensor, a 10 us pulse needs to be sent to the trigger pin . The times above just mean the exact point when they get triggered.
 

Attachments

Last edited:

danadak

Joined Mar 10, 2018
4,057
Pretty much any platform will do.

A table of time ticks, a basic tick rate in a timer of 1mS should do.

How "exact" must the timing be ? How much latency from Timer
transition to next mS is allowed ?A real precise solution would be
to do this in Verilog which would eliminate SW generated delays
and latency.



Regards, Dana.
 
Top