Society of Robots - Robot Forum

Software => Software => Topic started by: luckydog on July 18, 2007, 10:09:32 AM

Title: first post. pls help! my robot doesn't work. thx!
Post by: luckydog on July 18, 2007, 10:09:32 AM
hello everyone. this is a desperate man struggling with his college project. i'm not good at robotics but need to use a robotic machine to do mechanical property testing. and unfortunately the robot is not working and wasted me one month already.

about the robot: 10 years old, using a rotary encoder to drive and a linear encoder to read displacement. a load cell is also included. to control it, an old MINT language is used to generate program files and configuration files. these files together with application file are loaded with the workbench to control the robot.

the problem: when linear encoder is disabled, system works fine. when linear encoder is disconnected, it gives normal reading. but when it is connected and enabled, it works fine only in the range of 1.6mm. this still happens even when the program file is not loaded, i.e. only configuration file is used.

i believe something is wrong with the configuration file (written by someone ten years ago), but i just cannot tell what the problem is. can anybody give me some tips about it? thx thx thx thx!
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: luckydog on July 18, 2007, 10:19:09 AM
// rem is for comment
cancel
softlimit = 0 //software limit
dislimit[1]
define tensile = 0 // rotary encoder
define mobgrip = 1 // grips are ignored already
define stagrip = 2
define linenc  = 3 // linear encoder

config[3,4,5,6,7] = _off
enlimit[tensile]
rem   |define input pins                   |
rem   |for hardware axis                   |

activeinlevel = 0xfffff0
activeoutlevel = 0xfff
revlimitin[tensile] = 0
fwlimitin[tensile] = 1
dislimit[mobgrip]
dislimit[stagrip]
rem   crash stop for hardware limits:
hwlimit[tensile] = 1
revsoftlimit[tensile] = -0.5
fwsoftlimit[tensile] = 29

rem set control parameters for tensile axis:

scale[tensile] = 2564.34
rem scale to mm
rem scale[tensile] = 100
gain[tensile] = 10
kvelff[tensile] = 40
kvel[tensile] = 40
kintrange[tensile] = 25
kint[tensile] = 0.1
currlimit[tensile] = 100
speed[tensile] = 0.5
accel[tensile] = 100
stopmode[tensile] = 2

scale[stagrip] = 2000
gain[stagrip] = 100
kvelff[stagrip] = 300
kvel[stagrip] = 300
kintrange[stagrip] = 50
kint[stagrip] = 10
currlimit[stagrip] = 100
speed[stagrip] = 0.1
accel[stagrip] = 1
stopmode[stagrip] = 2
mfolerr[stagrip] = 2

scale[mobgrip] = 2000
gain[mobgrip] = 100
kvelff[mobgrip] = 300
kvel[mobgrip] = 300
kintrange[mobgrip] = 50
kint[mobgrip] = 10
currlimit[mobgrip] = 100
speed[mobgrip] = 0.1
accel[mobgrip] = 1
stopmode[mobgrip] = 2
mfolerr[mobgrip] = 2
scale[linenc] = 10000

rem set analogue input modes
adcmode[tensile] = 2
adcmode[mobgrip] = 2
adcmode[stagrip] = 2
adcmode[3]       = 2
rem turn other inputs off to reduce update time
adcmode[4,5,6,7] = 4
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: Admin on July 22, 2007, 08:57:03 AM
Quote
the problem: when linear encoder is disabled, system works fine. when linear encoder is disconnected, it gives normal reading. but when it is connected and enabled, it works fine only in the range of 1.6mm.
What do you mean? The way you say this makes it sound like your robot works perfectly fine with the encoder disabled . . .
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: luckydog on July 24, 2007, 04:42:05 PM
it was designed with two encoders: one linear encoder for reading and a rotary one for driving. the problem is with the reading one. if it is enabled, system faces error.

of course rotary encoder can also be used for recording, but is less accurate. thats what i meant with 'fine'. for the tests when high accuracy and resolution is required, it cannot work. 
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: Admin on August 03, 2007, 09:51:02 AM
Can your system output any data to your computer (such as the encoder value)?

Attach the encoder up to an oscope then move the arm around. See if the voltage is a square wave or not.

And lastly, are you sure the robot and code worked before you got it and wasnt altered incorrectly?
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: luckydog on August 27, 2007, 12:03:25 PM
the hardware is checked to be fine.

activeinlevel = 0xfffff0
activeoutlevel = 0xfff

can you tell me what these two sentences mean please?
I suspect these two values are the error source at the counting of 16000.
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: Admin on August 29, 2007, 04:30:51 PM
no idea . . . probably a reference to a hardware location . . .
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: luckydog on September 01, 2007, 06:59:54 PM
hi, according to the manual, activeinlevel sets the active level on the digital inputs

e.g.

activeinlevel = 0*FFF000 will set inputs 0 to 11 to be active low, and inputs 12 to 23 to be active high

i don't understand how it is set (F stands for 1 or what?) but i suspect it is the error source. thanks for ur help!
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: HDL_CinC_Dragon on September 01, 2007, 08:00:34 PM
F stands for 16 actually...
that 'x' in "0x******" tells you that the following number is in hexadecimal where one digit can actually represent 2 digits. A-F is equal to 10-16.
The easiest to control is binary because you can easily see each pins level. "0xFFF000" in binary is "0b111111111111000000000000"
Code: 0b1   1   1  1   1   1  1   1   1   1  1   1   0   0  0 0 0 0 0 0 0 0 0 0
Pins:      23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
so pins 0 through 11 inclusive will be low and pins 12 through 23 inclusive will be high.
See how that works?
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: cybcode on September 02, 2007, 04:06:28 AM
Isn't 0xF 15?
A B C D E F
10 11 12 13 14 15
Title: Re: first post. pls help! my robot doesn't work. thx!
Post by: HDL_CinC_Dragon on September 02, 2007, 10:17:06 AM
Isn't 0xF 15?
A B C D E F
10 11 12 13 14 15

... crap

Thanks for catching that :)