Page 6 of 8
Re: [Hover] Selecting an ultrasonic sensor and interface
Posted: Tue Jan 20, 2015 9:59 pm
by alex
tobias wrote:I've tested with your code an I think there has been some merge problems. The files i2croutines.c, i2croutines.h and nvic.c where not as they should. I have attached a patch so you can update them. Then the I2C2 bus should work again.
Ok thanks, Tobias. Now I'm sure I messed things up completely. Your patch can't be applied:
i2cfix.patch:11: trailing whitespace.
void i2cInterruptHandlerI2c2(void);
i2cfix.patch:12: trailing whitespace.
void i2cErrorInterruptHandler(I2C_TypeDef* I2Cx);
i2cfix.patch:26: trailing whitespace.
/* Buffer of data to be received by I2C1, I2C2 */
i2cfix.patch:27: trailing whitespace.
uint8_t* Buffer_Rx1;
i2cfix.patch:28: trailing whitespace.
uint8_t* Buffer_Tx1;
error: Anwendung des Patches fehlgeschlagen: drivers/interface/i2croutines.h:132
error: drivers/interface/i2croutines.h: Patch konnte nicht angewendet werden
error: Anwendung des Patches fehlgeschlagen: drivers/src/i2croutines.c:32
error: drivers/src/i2croutines.c: Patch konnte nicht angewendet werden
error: Anwendung des Patches fehlgeschlagen: drivers/src/nvic.c:224
error: drivers/src/nvic.c: Patch konnte nicht angewendet werden
Have to have a closer look at this.
Did this to revert my local master branch to the original state from bitcraze's repo and pushed it to my fork (origin/master):
Code: Select all
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
But it didn't help. Should I clone bitcraze's repo again and do a clean rewrite of my sonar-mb1242 branch? There's a pure git solution for this for sure, where are the git pros?

Re: [Hover] Selecting an ultrasonic sensor and interface
Posted: Fri Jan 23, 2015 9:35 am
by tobias
You probably had additional changes that are not in the github repository yet. Maybe clone it again from github and then try to apply the patch?
Re: [Hover] Selecting an ultrasonic sensor and interface
Posted: Fri Jan 23, 2015 10:10 pm
by alex
Good news: the sensor is working with my CF 1.0 thanks to Tobias' fix for issue #27.
The problem was that I didn't update my
sonar-mb1242 branch correctly due to my lack of experience with git. Accordingly Tobias' I2C2 interrupt fix never reached my CF.
Thanks so much to everyone who contributed to my project over the last months, especially Tobias and Arnaud. I'm so happy right now!
Next steps: improving the sonar code, porting it to CF 2.0 and in the end using the sensor readings as additional input for the hover mode.
So long!
Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Mon Jan 26, 2015 11:39 am
by alex
Besides the programming for reading the sonar sensor I prepared it to fit on the CF 2.0 using the Prototype Expansion Board. This is where the sensor's disadvantageous shape comes up again... Sorry for the bad lighting.
Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Mon Jan 26, 2015 12:00 pm
by dbrgn
Haha, that makes for a difficult landing
I got my voltage converter (I actually got a TI REG71050). Unfortunately I underestimated the tinyness of the SOT23 SMD casing... Therefore it doesn't fit on the prototyping board.
I guess I'll have to start etching my own PCBs to work around that

Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Mon Jan 26, 2015 7:12 pm
by tobias
Good news: the sensor is working with my CF 1.0 thanks to Tobias' fix for issue #27.
Great news! We are very exited to follow your progress!
I which it wasn't so hard to get hold of a mb1242 sensor so I could try it out as well...
Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Mon Jan 26, 2015 7:32 pm
by alex
tobias wrote:Great news! We are very exited to follow your progress!
I which it wasn't so hard to get hold of a mb1242 sensor so I could try it out as well...
Now that we know that there's nothing special about the implementation itself, you could have spent the money for something more useful... maybe a book on git for me or so...

Just joking...
dbrgn wrote:Haha, that makes for a difficult landing
I got my voltage converter (I actually got a TI REG71050). Unfortunately I underestimated the tinyness of the SOT23 SMD casing... Therefore it doesn't fit on the prototyping board.
I guess I'll have to start etching my own PCBs to work around that

Yes, but my CF isn't meant to land but to hover!
I omitted the step-up voltage regulator NCP1402 on the pics above which I initially had for the breadboard circuit connected to the CF 1.0. The expansion port of the CF 2.0 supplies 3.0 V over VCC at 100 mA. That's enough for powering the MB1242. At least I hope that this voltage is regulated and doesn't fall below 3.0 V. Can someone confirm that?
Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Wed Jan 28, 2015 11:41 am
by tobias
At least I hope that this voltage is regulated and doesn't fall below 3.0 V. Can someone confirm that?
At the very end of the flight the voltage can drop below 3.0V but then you should already have landed

Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Fri Mar 13, 2015 8:55 am
by Fucitol
Alex, did you have any luck creating a stable altitude hold using the ultrasonic sensor?
I am a bit concerned about the propellor wash that the manufacturer warns about, have you tested this? For instance, you can fix your CF at 1m with no RPM and see what happens when you apply throttle while keeping the CF at 1m. Does this affect the measurement since the air flowing down can interfere with the
I was planning on maybe using an IR-based distance sensor for autonomic landing since they only work on short distances (below 1m) but accurate until 0.5cm.
(found this nice informative thread in your signature from your reply in my thread)
Re: [SOLVED] Selecting an ultrasonic sensor and interface
Posted: Mon Mar 23, 2015 10:37 pm
by almaz_1c
I tried maxsonar sensor . I did not like it. Firstly it is heavy (5 grams), and secondly a large dead zone (in fact 35 cm), third - too slow updating the data. I found a better solution -
https://www.pololu.com/product/2474
Weighs only 2.5 grams, dead zone - 10 cm and more rapidly data refresh. But the range of only 1.5 meters.
Here is video:
https://cloud.mail.ru/public/b9c3f426a4 ... 011800.mp4