顯示具有 Arduino 標籤的文章。 顯示所有文章
顯示具有 Arduino 標籤的文章。 顯示所有文章

2014年7月2日 星期三

Desktop Manipulator

Erick and I cooperated and did it in this semester.
We make it from scratch. Erick deal with mechanism design and manufacturing and Im in charge of control.
Our design procedure is followed this flow chart.


Erick cares so many details. One thing we may encounter is that the linkage is quadratic loop equation. When we solve it, two solution will come out that can cause link crossover situation.

Zoom in and see what assembly in detail.







First time test video



2014年6月18日 星期三

DC Motor Speed PID Control with Arduino

It is a new MechLab for NCKU ME next semester, a PID controller!
Hardware:





Source Code on Github: https://github.com/kvzhao/ME-PIDLab

The crucial part of the PID code is listed below
void loop()
{
    // Run a period to estimate more precise speed
    Motor.Tick();
    // Run for one Second
    delay(SamplingTime);
    Motor.Tock();

    // Read rotation speed from Encoder
    Input = Motor.getSpeedRPS();

    // PID Compute
    PID_Controller.Compute();
    if ((Output-prevOutput) >= oscGap) {
      //Output = prevOutput;
    }
    Motor.setSpeed(Output);
    prevOutput = Output;
    // Show Data
    /*
    Serial.print("Input: ");
    Serial.println(Input);
    Serial.print("Setpoint: "); 
    Serial.println(Setpoint);    
    Serial.print("Error: ");
    Serial.println(error);
    Serial.print("Output: "); 
    Serial.println(Output);*/
    Serial.println(error);
    // wait a little while
    delay(5);
}


My first test result (with KP=98, KI=8, PD=5)
There is almost no steady state error, however overshoot happens.
Next step is to tune the parameters and control the motor smoothly!

Some useful references



2014年2月13日 星期四

Good articles about Arduino and IMU

Kalman filter is the one of the filter, or signal processing technique that lures me.

I wanna make a small system (via Arduino) to implement it and act as the lab material of embedded system tutorial.

Some useful websites and source code listing here :


Besides, here is the Arduino PID lib.

Great article : Faster analogRead()

2014年1月2日 星期四

Syringe Pump v2 : 6 stage step motor set

從去年開始實作了第一版本的Syringe Pump,幫助材料系的Graphene Lab可以從事薄膜等等的實驗。

功能

  • 讀取腳本,批次的控制六顆馬達
  • 手動直接操作

硬體

  • 六個壓克力幫浦臺
  • Seeedurino MCU
  • 6 Steppers 
  • 6 Easy Driver 
軟體
  • Arduino IDE 
  • C# for GUI


  • Stepper
    Easy Driver
    悲劇GUI
  • 設計為自己寫腳本(我們自己定義的語法),讓程式讀取
  • 程式會一行一行解析腳本,然後送出指令
  • 目前支援
    • 控制步伐,轉速,系統待機
    • 支援馬達同步 進行相同指令

整體系統
六個幫浦組


注射針筒

實驗發生的反應槽

利用金箔來測試有沒有振動發生
NOW, We are moving on!

因為這個系統不強健,有很多帶解決的問題(後面詳述)
由於第一版希望學長能盡快開始實驗,很多功能相當簡陋;另外也因為從頭打造,現實會發生的問題沒有考慮到。

將設計第二版 v2 ,這次重點將已系統的可靠度以及汎用性作考量,有以下的修改及加強。

v2 Modification 
  • 電路從麵包版換成自己焊接,留下IC座考慮以後容易更換
  • 設計電源開關,考慮是否需要 Pull-up Resistor
  • 界面首先已Qt4 (or Qt5) 重寫(因為C#檔案已經不見)
  • 界面需要一個LabView版本,考慮外包
    • 讀檔,一行一行parse然後透過UART送出
  • 電路盒子(需屏蔽?)
v2 New Function 
主要在韌體上考慮新功能,讓實驗更容易進行
  • 兩顆馬達同步
  • 待機時不激磁(No holding)
  • 慢進快退,馬達進退速度不同要考慮
  • 設定Home,當實驗結束可以回到固定地點
  • 除了絕對位置以外,提供相對圈數 兩種控制方式