Speed Control with Analog Input

This program demonstrates a typical application using the MDrive analog input. The voltage or current present on Input 5 is converted to a decimal value of 0 to 1023. In this case, the I5 voltage value is manipulated to determine speed, direction and deadband.

'This program allows the user to perform speed control
'using the analog input on the MDI.

S5=9          'sets analog input to accept 0-5Vdc.
S1=0,1        'sets I/O point 1 to general
              'purpose output
A=2000000     'acceleration set to
              '2000000 microsteps/sec/sec
D=2000000     'deceleration set to
              '2000000 microsteps/sec/sec
R4=20         'deadband

PG 1             'initiate program at address 1
   LB SU         'startup label. Program executes on power up
   LB ZZ         'label called ZZ
      R1 = I5    'register 1 set to analog input value
      CL ab	     'computes new velocity by calling
                 'sub at label ab
      SL R3      'slew at the value of register 3
      H 10       'wait 10 milliseconds
      BR ZZ      'branch to the label called ZZ
      E          'end of ZZ routine
   LB ab
      R1 = R1-508    'routine to determine
                     'direction and remove deadband
      R2 = 1         'offset from joystick center plus
      BR a1, R1>=0   'get dir of r1
      R2 = -1        'negative direction minus
      R1 = R1 * R2   'get abs of r1
   LB a1
      BR A2,R1

IMS Logo Wide

370 N. Main St., P.O. Box 457
Marlborough, CT 06447 U.S.A.
Phone: 860 / 295-6102
Fax: 860 / 295-6107
Email: info@imshome.com

Contact

TECHNICAL SUPPORT (U.S.A.)
Phone: 860 / 295-6102
Fax: 860 / 295-6107
E-mail: etech@imshome.com

IMS ASIA PACIFIC OFFICE
30 Raffles Pl., 23-00 Chevron House
Singapore 048622
Phone: +65 / 6233 / 6846
Fax: +65 / 6233 / 5044
E-mail: wllee@imshome.com

IMS EUROPEAN SALES MGT.
4 Quai Des Etroits
69005 Lyon, France
Phone: +33 / 4 7256 5113
Fax: +33 / 4 7838 1537
E-mail: bmartinez@imshome.com

IMS UK Ltd
.
25 Barnes Wallis Road
Segensworth East
Fareham, Hampshire, UK  PO15 5TT
Phone: +44 / 0 1489-889825
Fax:: +44 / 0 1489-889857
E-mail: mcheckley@imshome.com

U.S.A. SALES OFFICES
Eastern Region 

Phone: 973 / 661-1270
Fax: 973 / 661-1275
E-mail: jroake@imshome.com

Central Region
Phone: 260 / 402-6016
Fax: 419 / 858-0375
E-mail: dwaksman@imshome.com

Western Region
Phone: 602 / 578-7201
E-mail: dweisenberger@imshome.com