Why you are interested in motor control in Python

"Information for controlling motors with Python on Raspberry Pi" Has already been written.

Here's why I'm interested in motor control in Python. Increase the number of people who can write motor control programs and have fun incorporating them. (In the description below, the author of this article may be misunderstanding because he is not familiar with the C ++ library.)

In Python, libraries that are easy to control serial ports, socket-based networks, threads, etc. can be used in common with Windows and Linux / Unix, and development can be advanced to some extent on a machine that is easy to develop. After that, it is easy to port to the target machine.

Claim: ** Being able to control with a Raspberry Pi, yet Python-based, increases the number of people who can control the motor. ** **

Conventional:

"A person who can write Linux (or TRON or OS-less) programs in C / C ++" And "a person who can write Linux IO device drivers" And "a person who understands the electric system of motor control" And "a person who understands the force acting on the object to be driven and the mechanics such as disturbance" The condition is required.

Current:

You can try running a sample script to imitate people who say, "I don't know C / C ++. I've never compiled it." If you run the script on the interpreter, you can run the script to the extent that it can work normally. It can be developed little by little even in situations where it is not completely completed. You can see the value of the variable in the running scope of the program in Spyder (one of the Python integrated environments) with [Variable explorer]. You can save the results and use Spyder to analyze data and create graphs on a par with MATLAB, regardless of the type of Linux or Windows.


Claim: ** If you write a serial interface program in RaspberryPi or Python, you can develop programming with less difference between windows and Linux. ** **

Traditional C / C ++:

There was no standard way to code in common on Windows and Unix / Linux. Windows 3. Serial communication on Windows [3-5] Linux About serial programming in Linux in general

Python: pyserial 3.0 Article "Python and hardware-Using RS232C with Python-"

Current C ++:

Boost Serial Ports Article Try serial communication with Boost.Asio

Claim: ** If you write a socket program in RaspberryPi or Python, you can develop programming with less difference between Windows and Linux. ** **

Traditional C / C ++:

There was a big difference in the basic libraries between Linux and Windows, and it was difficult to create a program that works in common between Linux and Windows. The Unix and Linux Socket libraries are from the ancient times before IPv6, before the multithreading era, and before unicode, and I understand what the Unix and Linux libraries I'm using are. Not done.

Unix [C language] Create an echo server for inter-socket communication Windows How to communicate by TCP using winsock

Python: Python's socket library is in Python's standard library, so you can write common programs regardless of the OS type. Python's network library is rich enough to write a web server. Python standard library 7.2. Socket — low-level network interface Article I made an echo server with python

There is a library called SocketServer, so I tried using it. Tips 5 for Python beginners to use Scikit-image examples for themselves

For current C ++:

Boost's Asio library can write source code that is highly common to Windows and Linux. Boost.Asio Boost.Asio A collection of simple clients and servers SlideShare Use Asio!


Claim: ** If you write a multi-threaded program in RaspberryPi and Python, you can develop programming with less difference between Windows and Linux. ** **

Traditional C / C ++:

Conventional C / C ++ multithreading has no description method regardless of the type of OS. When writing a program with multiple threads, it is not always easy to check whether the function used in the function is thread-safe.

Python: Python includes multithreading in its standard library.

Python standard library 16.2. threading — high-level threading interface

Article "Multithreading with Python" Article Try loading images in a separate thread (OpenCV-Python)

Current C ++:

In C ++ 11, the multithreaded library is standardized, so it seems that it is easier to write multithreaded programs that do not depend on the OS. Article Try loading images in a separate thread (C ++ version)

Referenced URL 1: Easy asynchronous processing in C ++ (std :: thread, std :: async) http://qiita.com/termoshtt/items/d3cb7fe226cdd498d2ef 2: Introduction to C ++ std :: async http://kaworu.jpn.org/cpp/std::async


Claim: ** Writing a program in Python reduces the use of functions specific to a specific OS, and makes it easier to create a program that works in common on Windows and Linux. ** **


Claim: ** Python works faster than it used to, depending on how it's written. ** **

Traditional Python:

It is slow due to dynamic type checking and checking outside the range of the array.

Extensions to traditional Python:

Japanese translation of standard documentation "Extending Python with C and C ++"

Current Python (Cython):

Article I tried using Cython to speed up Python

See the official documentation for basic Cython usage http://docs.cython.org/ Japanese version http://docscythonja.zouri.jp/

Recommended Posts

Why you are interested in motor control in Python
[ev3dev × Python] Single motor control
Why do you add a main ()-if statement in Python?
[Python version] Why can't you do object-oriented development in Java?
Until you put Python in Docker
Modules and packages in Python are "namespaces"
Exclusive control with lock file in Python
Why can't I install matplotlib in python! !!
Check if the characters are similar in Python
Until you run the changefinder sample in python
Precautions when dealing with control structures in Python 2.6
What are you comparing with Python is and ==?
Multiple graphs are displayed in one window (python)
[python] ERROR: Python headers are missing in /usr/include/python3.X m.
Implement "All You Need Is Kill" in Python
What are you using when testing with Python?
Quadtree in Python --2
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Discord in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
Sqlite in python
StepAIC in Python
Install Python Control
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
Preparing to script control Rhino objects in Grasshopper / Python
% And str.format () in Python. Which one do you use?
Makes you think that Python regular expressions are great
BigQuery-If you get a Reason: responseTooLarge error in Python
Until you insert data into a spreadsheet in Python