Rover wheel quick numbers

$_57

I’m making quick numbers for a slow rover but I want to know if the motors I’ve choosen will be good enough.

A wheel has 95mm diameter, so its perimeter is 2 pi * 95/2 mm so in one revolution it advances pi * 95 mm = 298.45mm . Aproximately the long side of a A4 paper.

I will probably use JGA25-371 DC 25 rpm motors. 25 rpm = 25 revolutions per minute so in one minute it advances 25*298.45= 7461mm = 7.4 meters (two cars) and in 1 second it advances 124.4 mm, the diameter of a DVD aproximately.

For the 41 rpm one it would be 41*298.45= 12236.45mm = 12 meters (three cars) and in 1 second it advances 203mm, the short side of an A4 paper.

Wheel:

http://www.ebay.es/itm/4pcs-12mm-Hub-Wheel-Rim-Tires-for-1-10-Off-Road-RC-Rock-Crawler-Buggy-Truck/281829885771?

RC 1: 10 Rock Crawler
OD: 95mm/3.74″
ID: 45mm/1.77″
Hexagon coupling: 12mm/0.47″
Tires wide: 36mm/1.46″

Motor:

https://www.openimpulse.com/blog/products-page/25d-gearmotors/jga25-371-dc-gearmotor-encoder-25-rpm-12-v-2/

http://es.aliexpress.com/item/2pcs-JGA25-371-DC-Gearmotor-with-Encoder-41-RPM-at-12-V/32289338412.html

Model:JGA25-371 Parameter
Voltage No Load Load Torque Stall Reducer Weight
Workable Rated Speed current speed current Torque Output Torque Current  Ratio Size Unit
Range Volt.V rpm ma rpm ma kg.cm W kg.cm A 1:00 mm g
 6-24V 12 41 46 32 150 2.5 1.25 12.5 1 103 23 89
6-24V 12 25 46 20 150 4.2 1.25 21 1 171 25 91

quickly test a Logitech C920 H264 cam under Linux.

hd-pro-webcam-c920-feature-image
How to quickly test a Logitech C920 H264 camera under Linux.


sudo apt-get install v4l-utils vlc
v4l2-ctl --list-formats --device /dev/video1
v4l2-ctl --set-ctrl=power_line_frequency=1

number two is for 60hz


v4l2-ctl --device /dev/video1 –set-fmt-video=width=1920,height=1080,pixelformat=H264
v4l2-ctl --get-fmt-video
vlc v4l2:///dev/video1:width=1920:height=1080:chroma=h264

Locating Counterfeit FTDI chips and CH340 using udev

Upd

FTDI chips:

http://zeptobars.ru/en/read/FTDI-FT232RL-real-vs-fake-supereal

ftdi-ft232rl-real-vs-fake

The original FTDI chips have the text engraved and the clones have the text printed.

FTDI used malicious windows drivers to brick the counterfeit chips (changing their Product ID to zero). The clones were quite good and the original FTDI tool can be used to revert the changes. The tool also has another open source implementation here.

Online shops couldn’t sell the arduinos and they began cheating, they blocked the FTDI chip so that windows drivers can not write to them (corrupting the eeprom). The problem lies in that they all have the same serial number now.

This tool can be used to recover the serial number (but should not be used later on windows).

        print "Deliberately corrupting the checksum of your device\'s EEPROM will"
        print "protect it from being bricked by the malicious FTDI Windows driver,"
        print "while still functioning with said driver. However, if you do this,"
        print "ALL SETTINGS WILL REVERT TO DEFAULTS AND THE DEVICE SERIAL NUMBER"
        print "WILL NO LONGER BE VISIBLE.

Then my previous post can be used to locate them.

CH340 chips:

They don’t have a serial number but if they’re plugged allways in the same place other udev tricks could be used (the kernel parameter). I’ve to test it yet and then I’ll update this post.

Update:
udevadm info -n /dev/ttyUSB0 -a|grep KERNEL|grep :|grep –
KERNELS==”1-4:1.0″

iker@L450:/etc/udev/rules.d$ cat prueba.rules
SUBSYSTEM==”tty”, KERNELS==”1-4:1.0″, SYMLINK+=”rueda6″

udevadm trigger

Locate different arduinos in /dev

Problem:

A rover has several arduinos controlling several motors and everything is controlled from a Linux computer.
The Linux computer needs to know which motor belongs to which Arduino nano.
The /dev/ttyUSBX names are random and a udev rule has to be created to create proper symlinks.

this is an example for the motor_left_wheel_2

iker@x220:~$ dmesg |tail
[132279.252955] ftdi_sio 3-1.2:1.0: device disconnected
[132280.729756] usb 3-1.2: new full-speed USB device number 16 using ehci-pci
[132280.829889] usb 3-1.2: New USB device found, idVendor=0403, idProduct=6001
[132280.829899] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[132280.829905] usb 3-1.2: Product: FT232R USB UART
[132280.829910] usb 3-1.2: Manufacturer: FTDI
[132280.829914] usb 3-1.2: SerialNumber: A4001IE3
[132280.832971] ftdi_sio 3-1.2:1.0: FTDI USB Serial Device converter detected
[132280.833049] usb 3-1.2: Detected FT232RL
[132280.833866] usb 3-1.2: FTDI USB Serial Device converter now attached to ttyUSB0

All FTDI chips have the same idVendor=0403, idProduct=6001 but the SerialNumber is different. (if it is not different is a counterfeit chip)

The serial number and udev attribute for a ttyUSB0 device can be seen like this:


iker@x220:~$ udevadm info --attribute-walk -n /dev/ttyUSB0 | grep '{serial}' | head -n1
ATTRS{serial}=="A4001IE3"

iker@x220:~$ cat /etc/udev/rules.d/42-robot.rules

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A4001IE3", SYMLINK+="motor_left_wheel_2"

iker@x220:~$ sudo udevadm control --reload-rules

this will create a /dev/motor_left_wheel_2 each time an arduino with that serial number is connected.


iker@x220:$ ls -l /dev/motor_left_wheel_2
lrwxrwxrwx 1 root root 7 ene 16 22:23 /dev/motor_left_wheel_2 -> ttyUSB0

 

Extract each page inside a PDF file


#!/bin/bash
#
################################################################
#
# uso: ./extraer-pdf nominas.pdf
#
# Iker De Echaniz
#
# Requirements:
#
# bash, you already have it.
# sudo apt-get install ghostscript
#
#################################################################

#how many pages does it have
paginas=`gs -q -dNODISPLAY -c "($1) (r) file runpdfbegin pdfpagecount = quit"`
echo the PDF $1 has $paginas pages

# Save pages one by one
for (( i=1; i<=paginas; i++ )) do
 echo "Extracting pag $i "

 gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER\
 -dFirstPage=$i -dLastPage=$i -sOutputFile=${1%.pdf}_p$i.pdf ${1} >/dev/null 2>&1

done

echo Finished.