Information for controlling the motor with Python on RaspberryPi

This is also an article under investigation.

Everyone's Raspberry Pi Introductory Motor Kit

https://www.switch-science.com/catalog/2217/

Contents DC motor * Soldering required 2 copper wires Dual motor driver (TB6612FNG) * Soldering required Battery box Stepping motor (SPG27-1702) Transistor array (TD62783APG) Mini servo motor Pin header 1x40

Book ["Introduction to Raspberry Pi for Everyone, 2nd Edition [Supported Languages: Python](Rick Telecom's Electronic Work Series)"] [Introduction to Raspberry Pi for Everyone 2nd Edition] (http://www.amazon.co.jp/%E3%81%BF%E3%82%93%E3%81%AA%E3%81%AERaspberry-Pi%E5%85%A5%E9%96%80-%E7%AC%AC%EF%BC%92%E7%89%88-%E5%AF%BE%E5%BF%9C%E8%A8%80%E8%AA%9E-%E3%83%AA%E3%83%83%E3%82%AF%E3%83%86%E3%83%AC%E3%82%B3%E3%83%A0%E3%81%AE%E9%9B%BB%E5%AD%90%E5%B7%A5%E4%BD%9C%E3%82%B7%E3%83%AA%E3%83%BC%E3%82%BA/dp/4897979943)

Since it is a set that includes different types of motors such as DC motors, stepper motors, and mini servo motors, motor beginners will be able to start by knowing what each motor is.

(DC motor: This is usually used for science experiments in elementary and junior high schools. It turns just by connecting it to a power source. (The DC motor has no way to know how much it turns and is in the desired position. .) Stepping motor: A motor that controls the rotation position of the motor in small steps. It is often used in a controlled system without disturbance (it seems).

)

Check the GPIO control method of Raspberry Pi (Circuit assembly part 1)

https://tool-lab.com/2013/12/raspi-gpio-controlling-breadboard-1/

24th Control GPIO of Raspberry Pi (Command Edition)

https://tool-lab.com/make/raspberrypi-startup-24/

26th Control GPIO of Raspberry Pi (Python edition)

https://tool-lab.com/make/raspberrypi-startup-26/ The article by "Tool Lab" politely wrote about GPIO.

Turn SPG20-1332 (Note: stepper motor) on Raspberry Pi

http://eleclog.quitsq.com/2012/12/raspberry-pi-spg20-1332.html

To control the output of GPIO system("echo "7" > /sys/class/gpio/export"); And so on, the value is written by echo to a specific device file of Raspberry Pi.

Control the stepping motor with Raspberry pi and play music

http://yamaguchi-1024.hatenablog.com/entry/2015/12/04/234242

Stepping motor ST-42BYG020 Stepping Motor Driver Kit (part of)

Written in a way that uses GPIO in Python.

Verify the hardware performance and software support of the new Raspberry Pi robotics board!

http://www.rs-online.com/designspark/electronics/jpn/nodes/view/type:blog/slug:an-introduction-to-the-gertbot

Gertbot Robotics Board for Raspberry Pi

5 things you want to try with the cheap Linux board "Raspberry Pi" and the new model "B +"

http://japan.zdnet.com/article/35050936/

Raspberry Pi GPIO input / output sample (Python, C language, shell script)

http://netlog.jpn.org/r271-635/2013/01/raspberry_pi_gpio_test.html First, looking at the shell script, using GPIO as output is /sys/class/gpio/ You can see that the value is written to the following device file.

Looking at the C language hierarchy, in order to use the unique IO function of the chip BCM 2835, You can see that it uses a unique function. GPIO and other IO functions on the Broadcom BCM 2835 chip [C library for Broadcom BCM 2835 as used in Raspberry Pi] (http://www.airspayce.com/mikem/bcm2835/)

Seen from the Python language hierarchy import RPi.GPIO RPi.GPIO However, it hides a lot of troublesome processing that can be seen in C language, and you can see that it is easy to handle. The RPi.GPIO site states the following notes.

Note that this module is unsuitable for real-time or timing critical applications. This is because you can not predict when Python will be busy garbage collecting.

Keep in mind that this module is not suitable for real-time or time-critical applications. You can't predict when Python will be busy with the Garage Collection. BCM2835 SOC and Raspberry Pi It relies heavily on GPIOs on other ARM-based Linux boards and should not work.

Control figures with Raspberry Pi

An example of motor control with Raspberry Pi

[VOLKS INC. And Species Co., Ltd. have developed "Moving Doll: Dollfie (R) Honey", which is an industry standard 60cm doll made by Volks Co., Ltd. that is moved by moving figure technology. ] (http://www.dreamnews.jp/press/0000124132/) [(A) Dollfie(R) Honey: 60cm 28DOF Motional doll equipped with LINUX and MikuMikuDance] (https://www.youtube.com/watch?v=QhfxQWWfnk4&feature=youtu.be) (one of the YouTube images)

had. One of the YouTube links is a video with a structure that allows you to see the contents of the pedestal. It is interesting to see how to control the large number of control axes. If you follow the link of the developer Species Co., Ltd. http://robo-pro.com/MOFI/strategy.html I arrived at. You can see how the wire controls the doll.

Species article 2016/09/01 [Moving "Hatsune Miku" doll, produced by former AIBO developers and unveiled at the event in September](http://www.itmedia.co.jp/news/articles/1609/ 01 / news125.html)

Equipped with a small computer "Raspberry Pi 3", Linux runs. You can also create your own motion with MikuMikuDance (MMD).

And that.

[Operate the drone with Raspberry Pi! ?? Flight controller "NAVIO +"]

(http://www.borg.media/raspberry-pi-navio/)

NAVIO + is programmed in C ++ and Python The source code is available on GitHub here.

The board for motor control is sold by RS Components, the distributor of Raspberry Pi. Use it by connecting to Raspberry Pi. The GPIO voltage of the Raspberry Pi itself is 3.3V, and although there is a limit to the voltage and current supply of the power supply, it can supply a larger voltage.

[Gertbot Robotics Board for Raspberry Pi] (http://jp.rs-online.com/web/p/processor-microcontroller-development-kits/8486806/)

12V power supply

Page on Raspberry Foundation GERTBOT IS HERE!

RTK MOTOR CONTROLLER BOARD KIT FOR RASPBERRY PI https://docs.google.com/document/d/1Rfw2yCGLgT9BpKVBv3TBlHxGVVSL7cA8nhG0zy4hb0A/edit?pli=1#heading=h.urtsts8c9n0t

SMALL REDUCTION STEPPER MOTOR - 5VDC 32-STEP 1/16 GEARING https://www.adafruit.com/products/858

Raspberry Pi 3 Model B


** BeagleBone Black GPIO **

[Play with BeagleBone Black-GPIO] (http://www.sugakoubou.com/doku/bbb)

BeagleBoneBlack [4] – Expansion connector GPIO control –

BeagleBone Black Series: Get Interrupts Through Linux GPIO

Use BeagleBone Black GPIO from python

BeagleBoneBlack Python L Chika


How common is GPIO with other ARM-based Linux boards?

** Armadillo GPIO **

http://manual.atmark-techno.com/armadillo-4x0/armadillo-460_startup_guide_ja-1.0.5/ch08.html#sec-GPIO [armadillo ~]# echo 1 > /sys/devices/virtual/gpio/CON9_2/value It seems that it is common to be able to set the value in such a way.

It seems possible to install Python on Armadillo Armadillo-IoT: Add Python to Userland https://users.atmark-techno.com/blog/53/1349

In this article, I used debian to install Python on Armadillo, put PIP (python-pip) with apt-get, and I'm installing Pyserial using PIP.

Armadillo-X1 Announced in 2016


Zynq(Xilinx)

Find out about Zynq, an ARM device that can use FPGAs. Zynq is also available on Linux. Besides GPIO EMIO(extended multiplexed I/O) and so on.

[Controlling the LED connected to MIO with Linux on Zynq-7000 (ZC702)] (http://marsee101.blog19.fc2.com/blog-entry-2203.html) The source code of C is described.

[Connect a GPIO circuit to ZYNQ and accept interrupts on Linux (Part 2)] http://myokota.hatenablog.jp/entry/2015/08/12/233020

for i in `seq 898 901`; do
echo 1 > /sys/class/gpio/gpio$i/value
done

This is an example of a board using Zynq. ZYBO Zynq-7000 Evaluation Board

Xillybus and ROS on Ubuntu14.04 on Zybo Part 4: Settings on Zybo ~ Installing ROS


Cyclone V SoC(Altera)

"Connecting a DC motor to the Altera SoC evaluation board Helio"

Helio board article "[No. 8] How to create remote PWM control, motor control, and startup script with a network application"

Book "ARM Cortex-A9 × 2! One-chip Linux on FPGA with Zynq" image

Book ["FPGA Magazine No.7 From brushing to stepping! Making the first control circuit Motor & Robot x FPGA "] (http://www.kumikomi.net/fpga/contents/0007.php)

Postscript: It's not just about Raspberry PI or Python, The next book will give you a better understanding of the various parts. Book "Robocon Parts Guidebook" edited by Ohmsha

Unorganized postscript: PWM (Pulse Width Modulation) is used in the servo motor. Therefore, I am investigating an article related to output in PWM.

What is "PWM", an indispensable technology for motor control? (1/3) https://www.switch-science.com/catalog/2181/

Adafruit 16 Channel PWM / Servo HAT for Raspberry Pi https://www.switch-science.com/catalog/2181/

Control two DC motors with Raspberry Pi 2 http://kaiware007.hatenablog.jp/entry/2015/07/15/014119

GPIO on Raspberry Pi http://ag.hatenablog.com/entry/2015/07/31/013013

"Interface" has a special feature. -["Interface May 2016 Human Assist / Robo / EV / Drone Key Technology Experience for the First Time with a 5,000 Yen Kit! Free Torque! Latest Motor Control"](http://www.kumikomi.net/interface /contents/201605.php)


Jetson (Tegra board)

-Control GPIO with Jetson TK1

> sudo python ~/lab/gpio/advanced_blink.py However, I was able to confirm that the LED blinks only while the contact switch is pressed.

-Embedded board "NVIDIA Jetson TX1" that realizes "small artificial intelligence that keeps learning"

Deep learning function of Jetson TX1 development kit

I also tried signboard detection with Jetson TX1



Appendix
In the case of RaspberryPi, just plug in the USB memory and it will be mounted automatically. Moreover, you can easily unmount the USB memory from the GUI. So developing on a Raspberry Pi is easy, especially for python scripts. If you create a script that runs on Windows, copy it to a USB memory, and plug it into the Raspberry Pi, it's very easy to run it on the Raspberry Pi. Most of the missing libraries can be obtained by apt-get, so portability is good. To do this, use spyder on windows to pylint in advance for good portability. Save the script in UTF8. Make sure to use "/" instead of r "" to separate directories. It seems to be good to avoid troubles by not displaying multi-byte code such as Japanese code when executing the program on the console. It may not be the expected behavior due to reasons such as the font of the console display. I think it's safe.

Embedded CPU boards tend to have fewer opportunities to get the board and operate it. Moreover, CPU boards that have sufficient information on the development environment and development examples tend to be limited. RaspberryPi is easy to obtain, has a complete development environment, and there is a lot of information on development cases on the web. Therefore, it is a very easy board to start embedded programming.


Appendix
Let's find out about ROS (Robot Operating System) I wrote.

Why you are interested in motor control in Python http://qiita.com/nonbiri15/items/c911e327faec3d43a0b4 I wrote.

I'm starting to worry about a computer with built-in Wi-Fi and Linux called Omega2

The interface is featured. "Interface May 2016 Issue" Experience the key technology of human assist / robot / EV / drone for the first time with a 5,000 yen kit! Free torque! Latest motor control "

Recommended Posts

Information for controlling the motor with Python on RaspberryPi
Control the motor with a motor driver using python on Raspberry Pi 3!
Map rent information on a map with python
Download files on the web with Python
Use logger with Python for the time being
Introduction to Python with Atom (on the way)
Get information on the 100 most influential tech Twitter users in the world with python.
I tried Python on Mac for the first time.
Run with CentOS7 + Apache2.4 + Python3.6 for the time being
I tried python on heroku for the first time
Make a breakpoint on the c layer with python
PIL with Python on Windows 8 (for Google App Engine)
Extract the band information of raster data with python
Call the API with python3.
Get Alembic information with Python
I was hooked for 2 minutes with the Python debugger pdb
Try to display various information useful for debugging with python
Access the host SQL Server with python27 / pyodbc on the container
Create a Twitter BOT with the GoogleAppEngine SDK for Python
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
Save images on the web to Drive with Python (Colab)
The first artificial intelligence. Tensorflow on CentOS7.0. Built separately for python3.5 series and python2.7 series with virtualenv.
Life game with Python [I made it] (on the terminal & Tkinter)
How is the progress? Let's get on with the boom ?? in Python
Extract the xz file with python
Get started with the Python framework Django on Mac OS X
Get the weather with Python requests
Create a color picker for the color wheel with Python + Qt (PySide)
Get the weather with Python requests 2
Find the Levenshtein Distance with python
The story of making a standard driver for db with python.
Hit the Etherpad-lite API with Python
Install the Python plugin with Netbeans 8.0.2
[python] Read information with Redmine API
I liked the tweet with python. ..
Memorize the Python commentary on YouTube.
Dockerfile with the necessary libraries for natural language processing in python
See python for the first time
Notes on using rstrip with python.
Install confluent-kafka for Python on Ubuntu
What is the python underscore (_) for?
Master the type with Python [Python 3.9 compatible]
Getting started with Python 3.8 on Windows
Sakura Use Python on the Internet
Getting Started with Python for PHPer-Functions
Get weather information with Python & scraping
[Memo] Tweet on twitter with python
Command for the current directory Python
PhytoMine-I tried to get the genetic information of plants with Python
Get the width of the div on the server side with Selenium + PhantomJS + Python
[Python] I tried to visualize the night on the Galactic Railroad with WordCloud!
Put Cabocha 0.68 on Windows and try to analyze the dependency with Python
I tried to refer to the fun rock-paper-scissors poi for beginners with Python
[Introduction to Udemy Python3 + Application] 47. Process the dictionary with a for statement
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
Add 95% confidence intervals on both sides to the diagram with Python / Matplotlib
Use python on Raspberry Pi 3 to light the LED with switch control!
Put MeCab binding for Python with pip on Windows, mac and Linux
Install the python module with pip on a server without root privileges
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
[Python, ObsPy] I drew a beach ball on the map with Cartopy + ObsPy.