after using servos to sweep the TFmini was no durable solution (I burnt a lot of servos), I now made the TFminis beam rotate in 360°. Other solutions I found on the internet used belts and sliprings and a host of other hardware. I wanted it as simple and compact as possible, so I did it like this:
A stepper motor is turning a mirror made from a harddrive platter angled at 45°. The stepper motor is driven by a Easydriver module. The whole thing is controlled by a STM32 blackpill, which transmits the ranging data via mavlink to the autopilot. Scanning is slower than commercial products, but it is fast enough for a rover.
Sorry, I can not show the lidar in operation right now. The TFmini decided to break. A TFmini-plus is on its way.
Hello sorry im writing here, i didn’t know how to contact you directly. i have read your old thread about getting old data from Tfmini but there wasn’t clean solution for it. Can u explain me how did you solve it? Did you were only openning and closing serial port in loop{}?
The sketch on the controller submits mavlink “distance_sensor” messages. The orient field value gets updated depending on where the mirror is facing at that moment. PRX_TYPE is mavlink (2), rangefinder is not used.
I’m using a similar setup as your with TFmini, but with a 3d printed mini tower, servo and 2 gears (50 grams with everything). I’m a bit confused with the setup: I understand that there are 2 ways of obstacle avoidance, rangefinders & proximity sensors. In your case, you’re going the second way and you use PRX_TYPE=2 (Mavlink), I suppose it’s for using mavlink messages for communicating between the tfmini & the flight controller. My confusion is about the softserial stuff (no idea what it is), Teensy3.2 (do we need a separate Arduino board to communicate in this setup?) and the rest of the parameters needed to setup in order to work. How do we know the position of the TFmini or we just don’t care about it and the copter just uses stop command (not gliding)?
I will be very grateful if you share you knowledge and experience!
For my TFmini setup using a servo, I moved the servo to 3 ( front-left/front/front-right ) or more positions and submitted the “distance_sensor” message for the orientation the servo/TFmini was pointing. Controlling the servo, reading the distances and sending the results via mavlink was first done by a arduino nano and then by a Teensy 3.2. The nano only has one hardware serial port, so I had to use the softserial library to get a second port for the TFmini.
Hi, I’m using a continuous servo mapped to the channel 10 for on/off(turns around 120rpm), so there is no need to really control it. In mavlink analyser, I see well the values for distance_sensor and obstacle_distance. Why do I need to send obstacle_distance message, given that they are already read in the FCU? So in order to send the results, the only way is to use arduino nano/Teensy 3.2(or other board)? The part I don’t understand is how to link the servo position (is it possible for a continuous servo?) with the tfmini reading, so I can know Tfmini’s sensor reading to which direction is related. Do you use a script? Thanks a lot for your quick reply.
To get the position of a continuous rotation servo you will need an external rotation sensor or a servo with an integrated sensor and an output for it. There is no way of doing it with the FC alone, you will need an extra controller like an arduino i.e.
Thanks a lot @count74 for your help and the recommended items! It’s definitely something that could be useful also for other people learning about obstacle avoidance systems.
Hey out there.
Anyone have a 3d file for a TF Mini Plus…STL or perhaps a SKP.
Looking to put the mini in a drone I am working on and want to design the frame to properly support it.