Encoder and motor - PID control - with Arduino or MakeBlock Orion


#1

Hello,

for my project I need PID control of speed / rpm of small DC motor.

I have these parts:

  1. MakeBlock Orion based on Arduino Uno - http://learn.makeblock.cc/orion/ and http://learn.makeblock.cc/learn/images/Makeblock_Orion_Pin.png . Or I can use Arduino, it is good solution for me, too. But I prefer MakeBlack Orion as its red ports support 12V.

  2. Motor with encoder - http://www.makeblock.cc/optical-encoder-motor-25-6v-185rpm/

  3. Encoder driver - http://www.makeblock.cc/me-encoder-motor-driver/ - it connects to red port of MakeBlock Orion, then it is possible to use this API for motor control - http://learn.makeblock.cc/api-documentation-of-me-encoder-motor/ - but I would like to make my own PID control, for example using this library http://playground.arduino.cc/Code/PIDLibrary . Maybe this encoder drive will not be needed.

Here is general library for MakeBlock - https://github.com/Makeblock-official/Makeblock-Library

So I need to read/detect rpm of the motor for feedback to provide appropriate output of controller. I would like to as how to start. Now I do not know to which pin should I supply PWM signal and how to read rpm of motor from encoder (this can be made using API for Me encoder motor which I mentioned).

Thank you for your help.


#2

The back of the Orion board has numbers and letters which can be used as a sort of guide. On port 3 for exampe are pin 12 and pin 13 in the Arduino gergo. Find out which pin does the PWM in the Arduino UNO world and search for its equivalent on the back of the Orion board.


#3