# EML 6805 Robot Design Robotics Laboratory Florida International University Department of Mechanical Engineering SV203 Servo Motor Controller Board Basics.

## Presentation on theme: "EML 6805 Robot Design Robotics Laboratory Florida International University Department of Mechanical Engineering SV203 Servo Motor Controller Board Basics."— Presentation transcript:

EML 6805 Robot Design Robotics Laboratory Florida International University Department of Mechanical Engineering SV203 Servo Motor Controller Board Basics By Andre Senior 02/24/2005

Introduction This presentation is geared at demonstrating basic control principles that can be used on a Pontech SV203 board using MS Visual BASIC. Warning: Use the information presented at your own risk, the author has made every effort to make the presented information accurate as best as possible, it is however the audience responsibility to assume any damages that may incur.

Servo Principles For Rotation, a pulse current has to be applied to the servo, typically to the white lead. This pulse determines the speed and direction of the servo’s horn.

Mathematically Example Specification: Model:FP-S148 Control System: + pulse,1.52ms neutral Op Angle: neutral180degree (full rotation) Supply Volt: 4.8 - 6.0 Current: 8mA Torque: 42.0 Op Speed: 0.22 sec/60 degrees Meaning…………. For continuous rotating servos If we apply the first equation, we can determine the rotational angle moved within one pulse. Say 30 degrees will require a time of 0.11 sec. If we apply the last equation, we can determine the angular displacement of the servo’s horn. Say the horn is 2 cm in radius, with the same 30 degrees, the angular displacement will be 1.05 cm

Absolute Position Control The range of the position is between 1 and 255. On Servos with Potentiometers, not modified for continuous rotation, the maximum mechanical movement is about 180 degrees. The 1 to 255 position ranges gives a precision of a little under one degree (approximately 0.8 degrees). The figure below shows what position the servo will be given the value of positions 128, 1 and 255. The software can call the board to drive to the user desired positions.

Software Basics We need to associate three modules from Pontech to control the board within Visual Basic, or you could do it by directly sending Com port ASCII data through the chosen computer serial port. 1.PontechComm.bas 2.SV203.bas 3.Utility_Time.bas Next we need to associate MS Windows Communication protocol MSComm. Then lastly we need to write our own code in ‘ABC’ language Note: ABC is not a computer language, I really meant keep it simple and easy.

Example Software Code ‘Associate MS Windows Communication protocol MSComm with PontechComm. -------------------------------------------------------------------------------------------------- Private Sub MSComm1_OnComm() PontechComm.OnComm End Sub -------------------------------------------------------------------------------------------------- Private Sub Form_Load() 'Pontech Board opens a communication port MSComm1.CommPort = CInt(CommPort.Text) ‘Choose Comm Port MSComm1.PortOpen = True Call PontechComm.DeclarePort(MSComm1) OpenComm.Enabled = True End Sub -------------------------------------------------------------------------------------------------- Note: The software code above has not been tested, but the elements required to associate MSWin Com and Pontech SV203 Board are there.

Example Software Code 2 Simple Servo Control ----------------------------------------------------------------------------------------- Call SV203.ServoMove(servonum, positionnum) ----------------------------------------------------------------------------------------- Servonum is the pin set on the board that the servo is connected to. Positionnum is the bit value assigned to the chosen servo, meaning……… for continuous rotating servos Set to 127 or 0 the servo stops, decrements or increments with 1 bit turns the servo with increasing speed in either direction. The bit range is 0 to 255. Otherwise the absolute position will occur for servos with potentiometers.

Example Software Code 3 Simple Sensor Control ----------------------------------------------------------------------------------------- Sensor_Value_for Sensor_1 = CStr(SV203.ReadADC(1)) ----------------------------------------------------------------------------------------- ReadADC(Chosen Sensor) reads the value of the sensor pin (1) that is chosen.

Complete Control Read all Sensors on the SV203 Board Private Sub Read_Sensors() Dim I As Integer For I = 1 To 5 ADC_Value(I).Caption = CStr(SV203.ReadADC(I)) Next I Exit Sub

Complete Control ‘Move all servos with respect to time and position Private Sub Move_All_Servos_WRT() Dim i As Integer for i = 1 to 8 Servo_Position_Value(i).Caption = CInt(positionnum_value(i).text) next i times = 1 Do Until times = Val(time) ‘Control of continuous rotating servos times = times + 1 for i = 1 to 8 Call SV203.ServoMove(i, positionnum) next i Loop for i = 1 to 8 Call SV203.ServoMove(i, 0) Next i End Sub

The End If you have any questions, please email mail@andresenior.info

Download ppt "EML 6805 Robot Design Robotics Laboratory Florida International University Department of Mechanical Engineering SV203 Servo Motor Controller Board Basics."

Similar presentations