Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 https://github.com/pololu/vl53l0x-arduino - biblioteka z kanalu Robojax. Odleglość na razie testuje do 100cm. Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 No ale tam masz ustawienia, dokładność, szybkość, maksymalna odległość o ile pamiętam (long/short). Cytuj Link do komentarza Share on other sites More sharing options...
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 Wlasnie studiuje plik *cpp i szukam. Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 Nie prościej .h? Poza tym popatrz na przykłady - o ile pamiętam masz tam single. Cytuj Link do komentarza Share on other sites More sharing options...
Polecacz 101 Zarejestruj się lub zaloguj, aby ukryć tę reklamę. Zarejestruj się lub zaloguj, aby ukryć tę reklamę. Produkcja i montaż PCB - wybierz sprawdzone PCBWay! • Darmowe płytki dla studentów i projektów non-profit • Tylko 5$ za 10 prototypów PCB w 24 godziny • Usługa projektowania PCB na zlecenie • Montaż PCB od 30$ + bezpłatna dostawa i szablony • Darmowe narzędzie do podglądu plików Gerber Zobacz również » Film z fabryki PCBWay
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 No ja wlasnie wgrywam przyklad single i patrze co na uart wyrzuca. to w mm pokazuje, a palca mam prawie przy czujniku Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 O ile pamiętam to minimalna odległość to coś koło 3 cm. A głupie pytanie (chociaż wcale nie głupie bo sam się zorientowałem trochę późno) - zdjąłeś folię z czujnika? Cytuj Link do komentarza Share on other sites More sharing options...
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 heh az zaczalem skrobac paznokciem czujnik 😄 nie, nie ma folii. Jedyne funkcje które coś mówią o jakieś kalibracji to \ bool setMeasurementTimingBudget(uint32_t budget_us); uint32_t getMeasurementTimingBudget(void); bool VL53L0X::setMeasurementTimingBudget(uint32_t budget_us) { SequenceStepEnables enables; SequenceStepTimeouts timeouts; uint16_t const StartOverhead = 1600; // note that this is different than the value in get_ uint16_t const EndOverhead = 960; uint16_t const MsrcOverhead = 660; uint16_t const TccOverhead = 590; uint16_t const DssOverhead = 690; uint16_t const PreRangeOverhead = 660; uint16_t const FinalRangeOverhead = 550; uint32_t const MinTimingBudget = 20000; if (budget_us < MinTimingBudget) { return false; } uint32_t used_budget_us = StartOverhead + EndOverhead; getSequenceStepEnables(&enables); getSequenceStepTimeouts(&enables, &timeouts); if (enables.tcc) { used_budget_us += (timeouts.msrc_dss_tcc_us + TccOverhead); } if (enables.dss) { used_budget_us += 2 * (timeouts.msrc_dss_tcc_us + DssOverhead); } else if (enables.msrc) { used_budget_us += (timeouts.msrc_dss_tcc_us + MsrcOverhead); } if (enables.pre_range) { used_budget_us += (timeouts.pre_range_us + PreRangeOverhead); } if (enables.final_range) { used_budget_us += FinalRangeOverhead; // "Note that the final range timeout is determined by the timing // budget and the sum of all other timeouts within the sequence. // If there is no room for the final range timeout, then an error // will be set. Otherwise the remaining time will be applied to // the final range." if (used_budget_us > budget_us) { // "Requested timeout too big." return false; } uint32_t final_range_timeout_us = budget_us - used_budget_us; // set_sequence_step_timeout() begin // (SequenceStepId == VL53L0X_SEQUENCESTEP_FINAL_RANGE) // "For the final range timeout, the pre-range timeout // must be added. To do this both final and pre-range // timeouts must be expressed in macro periods MClks // because they have different vcsel periods." uint16_t final_range_timeout_mclks = timeoutMicrosecondsToMclks(final_range_timeout_us, timeouts.final_range_vcsel_period_pclks); if (enables.pre_range) { final_range_timeout_mclks += timeouts.pre_range_mclks; } writeReg16Bit(FINAL_RANGE_CONFIG_TIMEOUT_MACROP_HI, encodeTimeout(final_range_timeout_mclks)); // set_sequence_step_timeout() end measurement_timing_budget_us = budget_us; // store for internal reuse } return true; } i druga uint32_t VL53L0X::getMeasurementTimingBudget(void) { SequenceStepEnables enables; SequenceStepTimeouts timeouts; uint16_t const StartOverhead = 1910; // note that this is different than the value in set_ uint16_t const EndOverhead = 960; uint16_t const MsrcOverhead = 660; uint16_t const TccOverhead = 590; uint16_t const DssOverhead = 690; uint16_t const PreRangeOverhead = 660; uint16_t const FinalRangeOverhead = 550; // "Start and end overhead times always present" uint32_t budget_us = StartOverhead + EndOverhead; getSequenceStepEnables(&enables); getSequenceStepTimeouts(&enables, &timeouts); if (enables.tcc) { budget_us += (timeouts.msrc_dss_tcc_us + TccOverhead); } if (enables.dss) { budget_us += 2 * (timeouts.msrc_dss_tcc_us + DssOverhead); } else if (enables.msrc) { budget_us += (timeouts.msrc_dss_tcc_us + MsrcOverhead); } if (enables.pre_range) { budget_us += (timeouts.pre_range_us + PreRangeOverhead); } if (enables.final_range) { budget_us += (timeouts.final_range_us + FinalRangeOverhead); } measurement_timing_budget_us = budget_us; // store for internal reuse return budget_us; } Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 Popatrz na przykład, tam masz takie dwie propozycje ustawień. Zmień timingBudget z domyślnych 50 msec na 500 na przykład (minimalny jest coś ponad 30, ale mniej niż 50 lepiej nie używać). A, oczywiście podajesz w mikrosekundach. Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 No i pamiętaj na jakiej zasadzie ten czujnik działa. Dioda SPAD reaguje na pojedynczy foton, cały pic polega na określeniu który to jest ten właściwy. Cytuj Link do komentarza Share on other sites More sharing options...
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 Nic te moje zmiany nie wnoszą, jakiej bym biblioteki nie wgrał to mam niedokładność 5cm Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 Cóż... nie chcę nic sugerować, ale ta płytka to jakaś chińska podróbka, a oryginalny czujnik to STM - przy czym kontroler który tam siedzi w środku to jakaś ichniejsza konstrukcja chroniona fafnastoma patentami. Przyznam się, że dotychczas korzystałem wyłącznie z oryginałów, być może to coś co kupiłeś ma swoje problemy? Jeśli wyniki są powtarzalne - olej to i skalibruj po swojemu. Cytuj Link do komentarza Share on other sites More sharing options...
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 Tak zrobie i przetestuje dzialanie przy mikrofali, a swoja drogą,z jakiego źródła zakupić orginalny ? Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 Ja kupowałem w Botlandzie, ale na allegro też są. Kup plytkę z Pololu albo Adafruit. Tylko nie od jakiegoś kajtka tylko w normalnym sklepie/hurtowni. Cytuj Link do komentarza Share on other sites More sharing options...
Krawi92 Luty 5, 2022 Autor tematu Udostępnij Luty 5, 2022 Sprobuje kupic ten l1x, kalibracja tez tak sobie dziala. Do moich celów się sprawdzi, zastosowalem cyfrowe usrednianie wyników, ale gdybym chcial nim odleglosc mierzyć to coś cienko. Juz dokladniejszy jest hc sr-04 😄 Cytuj Link do komentarza Share on other sites More sharing options...
ethanak Luty 5, 2022 Udostępnij Luty 5, 2022 Powiem tak: oryginalny L1X działa bardzo ładnie - vide mój temat o pziomicy z dalmierzem dla niewidomych. 1 Cytuj Link do komentarza Share on other sites More sharing options...
Pomocna odpowiedź
Dołącz do dyskusji, napisz odpowiedź!
Jeśli masz już konto to zaloguj się teraz, aby opublikować wiadomość jako Ty. Możesz też napisać teraz i zarejestrować się później.
Uwaga: wgrywanie zdjęć i załączników dostępne jest po zalogowaniu!