[펌] C28x Floating Point Unit fastRTS library

Dsp/28335 | 2009/03/18 13:11 | Posted by 유종원
1. 소개

  TMS230C28x Floating Point Unit Fast RTS 라이브러리는 컨트롤을 위한 최적화된 floating Point 수학 함수가 포함하고 있습니다. 기존 RTS에서 관련 함수만 교체되기 때문에, 별도의 코드작업은 필요 없습니다.

● FPU FastRTS 함수들
atan, isqrt, atan2, sin, cos, sqrt, division

sprc664.zip

FastRTS 설치 파일



2. 설치 방법

1) Fast RTS(C28x_FPU_FastRTS_beta1.lib)와 standard RTS(rts2800_fpu32.lib)를 기존 프로젝트에 추가합니다.

사용자 삽입 이미지


2) Project->Build Options를 엽니다.

사용자 삽입 이미지


3) Linker->Advanced Tab에서 "Resolve Symbols to First Library"를 선택합니다.

사용자 삽입 이미지


4) Link Order 탭을 선택하고  2개의 라이브러리를 링커 순서에 추가합니다. 반드시, FastRTS 라이브러리가 맨 처음으로 배치되도록 하십시오. 먼저 배치된 라이브러리가 먼저 실행해야 합니다.

사용자 삽입 이미지


5) Linker->Libraries에서 Fast RTS 라이브러리의 경로를 추가해 주십시오. 박스에는 비워 둡니다.

사용자 삽입 이미지


끝.

펌 : 싱크웍스

이올린에 북마크하기(0) 이올린에 추천하기(0)
TAG 28335, DSP, RTS

XDX510 USB 에뮬레이터 설치 및 셋팅

Dsp/강좌 | 2009/03/17 23:36 | Posted by 유종원

XDS510 USB 에뮬레이터를 설치하기 전에 선행되어야 할 과정이 있습니다.

 

CCS 3.3(Code Composer Studio Ver. 3.3)이 설치 되어 있어야하며, CCS 3.3를 설치하기 위해서는 AcitvePerl State가 설치되어 있어야합니다.

ActivePerl State는 http://www.activestate.com/downloads/index.mhtml 에서 Free Trial로 다운 받으실수 있으며,

난 Free Trial버전은 용납할수 없다... 이러신 분들은 알고 계시는 암흑의 경로를 찾아보셔도 상관 없습니다.

 

자 그럼 XDS510 USB 에뮬레이터의 드라이버를 다운받아야 합니다.

드라이버는 http://support.spectrumdigital.com/ccs33/ 사이트에서 다운로드 하시면 됩니다.

위의 페이지에서 설치하는 방법이 나와 있지만, 영어 울렁증이 있는 저와 같은 분들이라면 아래의 글을 쭉 따라해 보셔도 됩니다.

 

일단 제가 다운로드 받은 파일의 이름은 setupCCSPlatinum_v30329입니다.

보다 높은 버전이 있다면 그걸로 다운 받으셔도 상관 없습니다.

설치 시 별다른 건 없고 아래와 같은 화면이 나옵니다.

 

TMS320LF2407A이외에도 다른 제품군도 사용하실꺼라면 전부 채크하시면 좋습니다.

설치가 완료되면 아래의 그림처럼 2개의 파일이 생성됩니다.

 

자 이제 드라이버를 설정해줘야겠죠? XDS510 USB를 컴퓨터와 연결하면 새 하드웨어를 검색하게 됩니다.

그럼 2개의 라디도 박스가 있습니다.

"소프트웨어 자동으로 설치(권장)(I)" 와 "목록 또는 특정 위치에서 설치(고급)(S)"가 있습니다. 당연히 드라이버를 설치했기 때문에

후자를 설치 해야겠죠? 벌써 우린 윈도우즈의 고급을 사용하는 유저가 된것입니다. ^^

 

드라이버를 설치하실때 디폴트의 경로를 사용해 설치하셨다면 다음과 같은 경로의 드라이버 설치 파일을 찍어주시면 됩니다.

 

특이 사항 하나 알려드리죠. XDS560 에뮬레이터도 위의 경로로 선택하셔야한다는 점...DM6446을 만져보면서 알수 있었던 사실입니다.

자 이제 드라이버 설치가 완료되었습니다. 그럼 이게 재대로 설치가 되었는지 확인해 봐야겠죠?

위의 두 파일 SdConfig 3.3와 SdConfigEx 3.3가 있습니다. 어느 파일을 실행 시켜도 상관없지만 SdConfigEx3.3을 실행해보시면

다음과 같은 화면을 볼수 있습니다.

 

자 이제 에뮬레이터를 연결된 상태에서

  를 클릭해 보시기 바랍니다. 프로그램의 아래 창에 아래의 그림과 같이 시스템 설정 내용이 나온다면 재대로 셋팅된겁니다.

 

 

만약 위의 그림처럼 나오지 않는 다면 USB를 뽑았다가 다시 연결해 주시면 정상적으로 연결이 된것을 확인해 보실수 있으실 겁니다.


이올린에 북마크하기(0) 이올린에 추천하기(0)

>>Pitch,Roll,Yaw

공학 | 2009/03/03 23:49 | Posted by 유종원

>>>개요

비행기는 3 차원 운동을 합니다. 그 3 차원 운동에 대한 축에 대한 구성이 Pitch, Roll, Yaw 입니다. 비행기의 조종은 바로 이 3 가지 성분의 조합으로 이루어 집니다.

1. Pitch

Pitch는 비행기의 기수가 상하 운동을 하는 것을 말합니다.

2. Roll

Roll은 비행기를 동체를 축으로할때 동체를 중심으로 날개를 좌,우로
기울이는것을 말합니다.

3. Yaw

Yaw는 비행기의 날개를 수평으로 유지한 채로 비행기 기수를 좌, 우로 움직이는 것을 말합니다.

이올린에 북마크하기(0) 이올린에 추천하기(0)

Ben - Michael Jackson

Movie ~ | 2009/03/03 20:21 | Posted by 유종원



펌 : 유투브
이올린에 북마크하기(0) 이올린에 추천하기(0)

Michael Jackson Dangerous

Movie ~ | 2009/03/02 17:59 | Posted by 유종원



펌 : You Tube
이올린에 북마크하기(0) 이올린에 추천하기(0)

OPEN-LOOP CONTROL SYSTEM

Motor Control | 2009/02/27 11:08 | Posted by 유종원


As we stated previously, an open-loop control system is controlled directly, and only, by an input signal. The basic units of this type consist only of an amplifier and a motor. The amplifier receives a low- level input signal and amplifies it enough to drive the motor to perform the desired job. The open-loop control system is shown in basic block diagram form in figure 2-1. With this system, the input is a signal that is fed to the amplifier. The output of the amplifier is proportional to the amplitude of the input signal. The phase (ac system) and polarity (dc system) of the input signal determines the direction that the motor shaft will turn. After amplification, the input signal is fed to the motor, which moves the output shaft (load) in the direction that corresponds with the input signal. The motor will not stop driving the output shaft until the input signal is reduced to zero or removed. This system usually requires an operator who controls speed and direction of movement of the output by varying the input. The operator could be controlling the input by either a mechanical or an electrical linkage. 

Figure 2-1.—Open-loop control system basic block diagram.

출처 : http://www.tpub.com/content/neets/14187/css/14187_92.htm

이올린에 북마크하기(0) 이올린에 추천하기(0)

P vs PID control 비교 동영상

Motor Control | 2009/02/26 16:44 | Posted by 유종원

이올린에 북마크하기(0) 이올린에 추천하기(0)

AVR Motor Controller

Motor Control | 2009/02/23 19:53 | Posted by 유종원


 


AVR Motor Controller

Written by Pascal Stang | Updated: Sunday February 05, 2006

Overview:

The AVR Motor Controller is a dual-axis motor controller and driver system. The controller uses PID motor control, and can calculate and execute trapezoidal-profile motion control. The controller accepts motor commands and quadrature encoder inputs, runs a PID and motion control algorithms, and drives motors at up to 50V and 3A per motor. The controller can operate two motors simulaneously, with seperate or synchronized trajectories.


AVR Motor Controller

Hardware Features:

  • AVR Motor Controller
    • ATmega168 processor @ 22.11MHz
    • RS-232 serial control interface (115200,8,N,1 - useable from terminal)
    • I2C serial control interface (coming soon)
    • Dual-axis motor control
      • 2 Quadrature Encoder Counters
        (counters detect 2-edges per encoder count, up to ~400K counts/sec)
      • 2 PWM Motor Drive outputs (up to 50V 3A per output channel)
    • Power input via DC jack or from motor driver section.
    • 2 Status LEDs and a Power LED.
    • 3.0" x 4.1" size (1.5" height, approx.)
  • Operating requirements/limits
    • Controller supply voltage: 20VDC
    • Motor driver supply voltage: 10VDC min to 50VDC max.
    • Motor driver output current: 3A max continuous, 6A max peak

Software/Firmware Features:

  • Independent PID motor control for two motors
    • Position control mode
    • Velocity control mode
    • PID control loop closed at 1KHz
    • User-set PID coefficients
  • Independent trapezoidal motion control for two motors
    • Automatic acceleration and velocity control when given a target position
    • User-set acceleration and velocity maximums
  • PID and system tuning tools
    • Step-response test function
    • Record and analyize actual motor/system response to any control input
  • Encoder and Motor test functions

Hardware Connection Information:

Connection reference for AVR Motor Controller
(Encoder1 and Motor1 are associated, same for Encoder/Motor2)

Typical motor connection diagram

Motor Command Information:

These commands can be entered interactively or by script via the controller serial port. To communicate interactively with the controller, use a standard serial terminal program such as HyperTerminal or TeraTerm under windows, or minicom under Linux.

  • Serial port settings:
    • 115200 Baud
    • 8 bits data
    • No parity
    • 1 stop bit

All commands are a single command letter with up to two integer numeric arguments seperated by spaces. Commands are case-sensitive (ie. 'G' is not the same as 'g'). Here is an example command session showing the meaning of each command and various syntax:

cmd>s 1         <-- Select motor1
cmd>p 1000      <-- Set Kp to 1000 for motor1
cmd>i 0         <-- Set Ki to zero for motor1
cmd>d 0         <-- Set Kd to zero for motor1
cmd>g 1000      <-- Drive motor to position 1000 (1000 encoder ticks) using PID
cmd>g 0         <-- Drive motor to position 0 (back to initial position)
cmd>g -1000     <-- Drive motor to position -1000 (same amount, opposite direction)

cmd>s 2         <-- Select motor2
cmd>p 1000      <-- Set Kp to 1000 for motor2
cmd>i 0         <-- Set Ki to zero for motor2
cmd>d 0         <-- Set Kd to zero for motor2
cmd>G 2000 2000 <-- Drive both motor1 and 2 to position 2000 (simultaneous)
cmd>G 0 0       <-- Drive both motors back to zero
cmd>w           <-- Write this configuration to EEPROM

cmd>s 1         <-- Select motor1 again
cmd>t 10000     <-- Drive motor to position 10000 using PID with trapezoidal profile

AVR Motor Controller Commands

Notes

General Commands

 

Description

Cmd

Arg0

Arg1
 
Help
'?'
.
.

Displays on-line help for available commands

Select Motor
's'
motor#
.
Select motor to control (1 or 2)
Motor Control Mode
'm'
mode
.

mode=0: Control off (motors disabled)
mode=1: Position control
mode=2: Velocity control (use 'v' command to set velocity)
mode=3: Cross-linked control

Goto Position (PID)
'g'
position [tics]
.
Drives selected motor to requested position under direct PID control.
Goto Position (PID)
'G'
pos1 [tics]
pos2 [tics]
Drives both motors simulanteously to requested positions under direct PID control (NOTE: pos1 need not equal pos2).
Goto Position (Prof)
't'
position [tics]
.
Drives selected motor to requested position under PID+PROFILE control. Uses trapezoidal motion profile.
Goto Position (Prof)
'T'
pos1 [tics]
pos2 [tics]
Drives both motors simulanteously to requested positions under PID+PROFILE control. Uses trapezoidal motion profile.
Reset Encoders
'z'
pos1 [tics]
pos2 [tics]
Resets the encoder counters. Allows reassigning the current physical position to user-selected encoder values. If no arguments are specified then encoders reset to zero.
Read Motor Current
'c'
.
.
Returns motor current in mA (if current sensing is connected)

Configuration Print/Read/Write

 
Config Print
'L'
.
.
Prints settings and coefficients that are currently active.
Config Write
'w'
.
.
Stores all current settings and coefficients into EEPROM. The settings are automatically loaded at power-on.
Config Load
'l'
.
.
Load settings and coefficients from EEPROM. Restores all settings to those last saved with 'w' command.

PID Tuning Assistance

 
Record Response
'r'
.
.
Sets currently selected motor for response recording. Response recording records the actual motor trajectory for the first 200points after the next 'g' command.
Upload Response
'R'
.
.
Returns the recorded motor trajectory data from 'r' command. Each data point is the motor position (encoder value) as it approached the target position requested by the 'g' command.
Step Response Test
'f'
.
.
Runs automatic motor step-response test.

Trapezoidal-Profile Controller Settings

 
Set Max Velocity
'v'
vel
.
Sets the maximum velocity to be used under trapezoidal profile control. Also used in velocity control mode to set desired velocity.
Set Max Acceleration
'a'
accel
.
Sets the acceleration to be used under trapezoidal profile control

PID Controller Settings

 
Set Prop. Gain
'P'
Kp
.
Sets the Proportional gain for currently selected motor [units TBD]
Set Integral Gain
'I'
Ki
.
Sets the Integral gain for currently selected motor [units TBD]
Set Derivative Gain
'D'
Kd
.
Sets the Derivative gain for currently selected motor [units TBD]
Set Windup Max
'W'
wm
.
Sets the maximum value for integral error (clamping value)
Set Output Max
'M'
om
.
Sets the maximum motor drive level [PWM units, out of 1200]
Set Deadzone
'Z'
dz
.
Sets the minimum motor drive level [PWM units, out of 1200]
Below this level, the motor power will be clamped to zero.

System Test Commands

 
Encoder Test
'e'
.
.
Prints encoder count value for both motors. Press any key to exit.
Motor Driver Test
'q'
.
.
Runs motors in ramp test pattern in both directions. Press RESET to exit.
This command list current as of firmware V1.6g, but is subject to change.

PID Control Loop Tuning:

Manual "by feel" Tuning

You can do a reasonable job of tuning a PID controller just by feel and observation. In general, you want to follow these basic steps:

  1. Set Kd and Ki to zero
  2. Pick a low starting Kp
  3. Command the motor to move under PID control (a good amount of motion might be 1 shaft turn)
  4. If the motor moves slugishly, increase Kp and repeat step 3.
  5. If the motor 'runs away' then use negative Kp or switch the polarity of the leads to the motor
  6. Keep increasing Kp until either:
    • the motor moves fast but overshoots the target position
    • the motor begins to oscillate
  7. Now begin increasing Kd until the overshoot is damped and/or the oscillation stops.
  8. You now have a basic PID loop tuning.
  9. If needed, you can repeat the tuning process but starting with the values you have now. Return to step 3.
  10. Finally if you have appreciable steady-state loads on the motor, you may want to set a non-zero Ki.
  11. Increase Ki just enough to reduce steady-state error (too much Ki will cause sluggish settling times)

Tuning hints:

  • A reasonable initial Kp is about 1000
  • Typical 'tuned' values of Kd are 0.5Kp to 3Kp
  • Typical values for Ki are 0,1,2,3, maybe as high as 10 or 20 in special applications.
  • Tuning is dependent on ALL of the following:
    • the PID coefficients
    • the voltage supplied to the motor driver
    • the motor's electromechanical properties (Ke, Kt and rotor inertia)
    • the mechanical load on the motor
  • If the motor 'runs away', then the you must use negative coefficients or switch the polarity of the motor leads.

Matlab Step-Response Tuning Tool

This Matlab GUI tool allows interactive graphical tuning of the PID controller. The tool requires Matlab V6.0 or later, and the Instrument Control Toolbox (used for serial port access). Here's how to use it:

  1. Download the tool here: step.zip
  2. Unzip 'step.zip' into a temporary directory
  3. Open Matlab and change directory to the location of 'step.m' (from step2)
  4. Connect the AVR Motor Controller to COM1
  5. Run 'step' in matlab. A GUI window should open.
  6. Pick some PID coefficients or use the defaults.
  7. Click the 'STEP' button to run a step-response test.
  8. The motor will execute the test
  9. The desired and actual response of the motor will be ploted.
  10. Examine the response and adjust the PID coefficients
  11. Goto Step 7.
  12. When satisfied with the tuning, you may save the coefficients you chose to EEPROM by clicking 'Store Coeff'.

About Trapezoidal-Profile Control:

Most applications in robotics require motors to make smooth movements from point A to point B. A PID control loop uses position feedback from a shaft encoder to drive a DC motor to precise positions. Unfortunately, the PID algorithm does not give us easy control over exactly how the motor moves from point A to point B. Rather, the PID controller is usually tuned for fastest possible motion while avoiding natural oscillations. So while PID is good at getting a motor to a certain position quickly, to get a smooth movement, we need some additional control.

Trapezoidal profiles can be used to command PID to create the smooth movement we want. A trapezoidal profile is a three-step movement process to go from point A to point B. This three-step process is exmplained and shown graphically below. Within each step, the profile controller constantly updates the desired PID position to make the motor follow the profile. PID still handles the lowest level of control.

  • Motor is stopped at point A, but is commanded to go to point B.
  • Step 1: Accelerate from stop to maximum velocity
  • Step 2: Maintain maximum velocity until motor gets close to point B
  • Step 3: Decelerate from max velocity to a stop
  • Motor is now at point B

The profile controller in the AVR Motor Controller allows the user to choose the acceleration and maximum velocity. When a target position is entered, the profile controller automatically calculates the required profile and executes.

NOTE: Using the profile controller requires a reasonably tuned PID control loop since the profile controller uses PID control to move the motor precisely.


펌 ::  Written by Pascal Stang | Updated: Sunday February 05, 2006
이올린에 북마크하기(0) 이올린에 추천하기(0)

태연 라이브 니가참좋아!!

Movie ~ | 2009/02/16 22:31 | Posted by 유종원

 


펌: 싸이월드.
이올린에 북마크하기(0) 이올린에 추천하기(0)

DC motor speed controller

Motor Control/DC motor | 2009/02/16 14:49 | Posted by 유종원

 



PIC Circuits Gallery
DC motor speed controller

I will introduce the constant speed controller for DC motor.
It detects and controls the rotational speed of the motor. When lower than the specification speed, it increases a control electric current. When higher than the specification speed, it reduces a control electric current. It is possible to use when wanting to keep constant speed even if the load to the motor changes.
With the circuit this time, I used a motor for the speed detection apart from the main unit motor. The speed can be detected in the other way, too. LEDs are lit up to confirm the control situation of the motor.
A circuit like "Light controller" is used for the control unit of this circuit.



Hardware Software
Circuit drawing
Pattern drawing
Circuit explanation
Parts explanation
Flow chart
List
Processing explanation
Assembly
Adjustment

이올린에 북마크하기(0) 이올린에 추천하기(0)