Hypha-ROS / hypharos_racecar

Low-cost, high speed (600USD, 3 m/s) 1/10 Autonomous ROS RaceCar (with tutorial for beginner)
https://hypharosworkshop.wordpress.com/
GNU Lesser General Public License v3.0
261 stars 112 forks source link

RPLidar Connection #9

Closed subodh-malgonde closed 6 years ago

subodh-malgonde commented 6 years ago

Hi,

I am using RPLidar A1. Your tutorial recommends using a separate power supply for the motor. The motor supply has 3 pins - GND, VMOTO and MOTOCTL. VMOTO is DC voltage between 5-10 V. MOTOCTL is the PWM control signal for the motor. Here is a screenshot from the datasheet.

screen shot 2018-07-30 at 12 41 01 pm

The PWM signal is generated by the circuit board provided by Slamtec (manufacturer of RPLidar). img_3191

However I noticed from your tutorial that you are using only 2 pins (RX/TX) from the board. See this:

screen shot 2018-07-30 at 5 00 37 pm

Your block diagram also suggests 2 pins. screen shot 2018-07-30 at 5 10 16 pm

Initially I thought that if I don't connect the MOTOCTL pin then maybe the motor will run at its default speed. However when I tried this the motor did not start. How are you generating the MOTOCTL PWM?

haochihlin commented 6 years ago

Hi @subodh-malgonde

About the connection of lidar, the order of pins defines as the first figure you post above: GND: 5V BEC (-) TX: to FTDI (USB) RX: to FTDI (USB) V5: 5V BEC (+)

GND: Dc2Dc (-) DTR: Dc2Dc (+) V5: Dc2Dc (+) In this case, the motor speed is actually controlled by Dc2Dc voltage instead of pwm DTR and V5 are in the same voltage means that DTR is in 100% duty cycle pwm, which is equal to max V5 voltage. So, you can change the voltage of V5 to modify the motor speed!

subodh-malgonde commented 6 years ago

Thank you so much @jim1993! 👍 It is clear now. If I want to vary the duty cycle then I can use a potentiometer to reduce the voltage.

subodh-malgonde commented 6 years ago

One last question about the lidar connection - why did you choose to use a BEC for the lidar's motor? The data sheet says the motor can accept 5 - 10 V, so if you have a 7.4V LiPo battery then you don't need to use a BEC. Am I right?

haochihlin commented 6 years ago

Hi As you said, you can connect battery to motor pins. The reason for using dc2dc module is that we could modify the rotation speed of lidar (Hz) by changing the input voltage.

subodh-malgonde commented 6 years ago

The frequency is controlled by DTR voltage, right? If DTR and V5 are same then the frequency will be maximum. What am I missing?

haochihlin commented 6 years ago

Yes, If DTR and V5 are same then the frequency will be maximum. However, the max freq depends on V5 voltage. If the input volt is 5V, then max freq is around 5Hz. For higher freq, it needs higher input voltage (max tolerance is 9V)

leizhao3 commented 3 years ago

Hi @haochihlin , thank you so much for your team's hard work! I would like to reach out that is there any special reason you team also power the core separately (from the USB)? What's the trade off if use the FTDI to power the core (instead of separate power source)?