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.
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
-
5.2 KB Views: 7
Last edited: