We are using your AL5A robot arm to do measurement experiments. We want to meausure distance in each position or step of the motions by using output module. But we can not manage it. Can you help us? How can we take the output values, for distance from a sensor, at the end of the each step?? How should connection be to the SSC-32 for output receiving values.
Hi !
We are studying on a thesis for AL5A robot arm with GP2D12 sensor and SSC-32 for 3D scan.
We also can not manage to get “reading values of the sensor” on our export file like "Microsoft Excel (csv) ". Do you know something about this process?
Our purpose is to compare “reading values of the sensor” with the robot positions. So, after each movement of the robot, we need to read the sensor value automatically.
To both of you:
-
What micrcontroller are you using?
-
How do you have the GP2D12 connected to the microcontroller?
The GP2D12 is an analog sensor, so you need to connect it to an analog input pin.
8-Dale
Also what program are you using, or are you writing your own code?
Firstly thanks for reply.
ok I searched it today and for this reason we must use a microcontroller for gp2d12 sensor.
However I want to get an output from any sensor like laser over RIOS. I mean that if I connect the laser to the output, can i get output after export the project. Is it possible without using microcontroller?
Are you simply trying to use RIOS and the GP2D12 sensor to do 3D mapping? It is covered in the manual.
lynxmotion.com/images/data/rios106h.pdf
Please provide more information. RIOS can read analog or digital sensors connected to the ABCD inputs.
Exporting sequences in RIOS does not pass the input part of the code. It only outputs the discrete positions in the sequence.
i tried 3d mapping and it worked very well. but i have to measure some distance by using any laser or sensor and after these measurements will be used to compare real values. some ready projects which are inside the RIOS program have output values like 250,120. i also want to create exporting file. How can we write these output values to export file?
If they aren’t in the export there is nothing that can be done to change this. The export function was intended to be positions only.
then what is the purpose of the output and input sequences???
I’m not sure what you are asking…
ok i am asking again.
i mounted the al5a robot arm and i connected the gp2d12 distance sensor. then i got the picture 3d successfully.
now finally i want to measure distance with any sensor and want to use these measured values. in every sequences, i must know the measured values. for example in first sequence the value is 10 cm, in another secuence is 15 cm. how can i measure it?
You can’t with RIOS. RIOS uses the inputs to direct the action of the arm. RIOS does not provide the values from the sensors to the outside world. There is no way to change this. Sorry…
To use the ssc-32 analog input, you need to have a program on a pc or microcontroller that sends a query such as VA followed by a carrage return, which will result in the ssc-32 returning a single byte that repersents the voltage on the A analog input pin. The voltage range is determined by the arduino reference votage, which is normally 5v (0-255 byte represents 0-5.0v). Below is a piece of code I used testing a foot contact switch, which has the voltage request, and capturing the returned byte.
y$ = "VC" 'used for analog input
Print #comm, y$ 'request analog input value from ssc-32
timer 20, [delay] 'read return delay
wait
[delay]
timer 0
dataRead$ = input$(#comm, lof(#comm))
num = ASC(dataRead$)'used for analog data
if num < 228 then Print #comm, "STOP 0"
if num < 228 then [jump]
if x < 160 then [loop1] 'set for number of samples during move
[jump]
Print #comm, "QP0" 'get last position sent to servo
timer 50, [delay3] 'delay to allow data to be returned
wait
[delay3]
timer 0
dataRead$ = input$(#comm, lof(#comm)) 'get returned data
print "voltage byte is "; num 'print out raw voltage byte
print "position byte is "; dataRead$ 'print out raw servo position
print "servo position is "; ASC(dataRead$)*10 'convert position into ms
timer 500, [delay4] 'delay to allow data to be returned
thanks zoomkat.
i understood that in order to get distance value over ssc-32 , i must use microcontroller. but i have two questions more:
1-) Is bot board 2 (BBII) right microcontroller for our process?
2-) how will we use this code which you sent? I mean that, we use RIOS and we can not write any code to this program. will we write this code to the microcontroller?
Sorry this easy question but i am a mechanical engineering student and i do not have any electronic background…
i understood that in order to get distance value over ssc-32 , i must use microcontroller. but i have two questions more:
1-) Is bot board 2 (BBII) right microcontroller for our process?
2-) how will we use this code which you sent? I mean that, we use RIOS and we can not write any code to this program. will we write this code to the microcontroller?
No, You can use a program on a pc that communicates via the serial port to communicate with the ssc-32 (similar to the free lynxterm program). The code I posted is from a simple pc basic programming language called Justbasic that I use for testing. I find it easier to do the up front testing using a pc. I can’t speak to the board 2 (BBII) as I don’t have one. Using a microcontroller that can communicate with the ssc-32 and the pc serial port at the same time would probably make for the easiest testing.
zoomkat, thank you so much really.
i can understand it slowly. now i want ask that if i use only pc without microcontroller, is it possible? i mean that i will load Justbasic program to pc and after i will use your code with this program. is it enough?
I have done that you said me. Firstly i dowloaded just basic program and opened your code with this. But when i clicked to run, it gave us the error like “Runtime error: Invalid file handle: #comm (see error log for more information)”.
I also tried the option of basic export from the program which controls the SSC-32. I took the folowing code:
; ------------------------------------------------------
; Lynxmotion RIOS SSC-32 ‘Export’ Program
; RIOS SSC-32 project : experiment2
; Date : 23/06/2011 13.14.48
; ------------------------------------------------------
; Format : Basic Atom 24/28 IDE <= V02.2.1.1 or Pro IDE
; Original filename : experiment2.bas
; Arm : L6 or SES + W.R.
; Positions : Byte (less accuracy, less memory used)
; Communication with SSC-32 : BotBoard V1 => Pin 15
; ------------------------------------------------------
Steps Bytetable 150, 155, 153, 103, 153, 95, |
215, 126, 148, 58, 153, 95, |
215, 121, 166, 83, 179, 95, |
215, 121, 166, 83, 179, 208, |
74, 132, 122, 63, 153, 219, |
74, 145, 179, 105, 153, 219, |
74, 146, 177, 103, 153, 119, |
150, 155, 153, 103, 153, 95, |
151, 154, 152, 103, 153, 94, |
153, 116, 151, 80, 152, 101, |
153, 116, 151, 80, 152, 178, |
74, 132, 122, 63, 153, 219, |
74, 145, 179, 105, 153, 219, |
74, 146, 177, 103, 153, 119, |
150, 155, 153, 103, 153, 95, |
151, 154, 152, 103, 153, 94, |
77, 165, 180, 66, 152, 118, |
79, 141, 205, 94, 117, 118, |
79, 141, 205, 94, 117, 184, |
77, 168, 165, 74, 152, 219, |
74, 145, 179, 105, 153, 219, |
74, 146, 177, 103, 153, 119, |
150, 155, 153, 103, 153, 95
TimeAndPause Wordtable 1000, 0, |
1950, 0, |
300, 0, |
180, 0, |
2970, 0, |
570, 0, |
210, 0, |
2220, 0, |
30, 0, |
990, 0, |
120, 0, |
2310, 0, |
570, 0, |
210, 0, |
2220, 0, |
30, 0, |
1860, 0, |
600, 0, |
90, 0, |
1230, 0, |
660, 0, |
210, 0, |
2220, 0
JointNB con 6
SSC32 con p15
StepIndex var Word
pause 500
Main
For StepIndex = 0 to 22
serout SSC32,i38400,"#0P", DEC Steps(StepIndex * JointNB) * 10, |
" #1P", DEC Steps(StepIndex * JointNB + 1) * 10, |
" #2P", DEC Steps(StepIndex * JointNB + 2) * 10, |
" #3P", DEC Steps(StepIndex * JointNB + 3) * 10, |
" #4P", DEC Steps(StepIndex * JointNB + 4) * 10, |
" #5P", DEC Steps(StepIndex * JointNB + 5) * 10, |
" T", DEC TimeAndPause(StepIndex * 2), 13]
Pause TimeAndPause(StepIndex * 2) + TimeAndPause(StepIndex * 2 + 1)
next
goto Main
did you understand anything ? ((
I have done that you said me. Firstly i dowloaded just basic program and opened your code with this. But when i clicked to run, it gave us the error like “Runtime error: Invalid file handle: #comm (see error log for more information)”.
I only posted the part of the code to show you the command I used to get the voltage data. The code below is more complete. also below are links to more just basic stuff.
viewtopic.php?f=28&t=3655
justbasic.conforums.com/
'ssc-32 (SSC32-V2.01XE) servo control using Just Basic.
'6 second timed move, stopped when "VC" analog input is
'grounded and reads less than "228" (foot switch, etc.).
'22k resistor connected between +5v and "C" input
'to keep "C" high at +5v (~"255" value) until grounded.
oncomerror [handleIt]
'set comport value to the one you use
open "Com8:9600,n,8,1,ds0,cs0,rs" for random as #comm
Print #comm, "#0P2200T1000" 'put servo to initial position
y=1 'outside loop counter set to 0
[loop]
print "step ";y
print "starting 2 second start delay"
timer 2000, [delay2] 'iniial delay before timed move
wait
[delay2]
timer 0
x=0 'inside loop counter set to 0
Print #comm, "#0P700T6000" 'start timed servo 0 move to 700
[loop1] 'inside loop
x=x+1
y$ = "VC" 'used for analog input
Print #comm, y$ 'request digital input value from ssc-32
timer 20, [delay] 'read return delay
wait
[delay]
timer 0
dataRead$ = input$(#comm, lof(#comm))
num = ASC(dataRead$)'used for analog data
if num < 228 then Print #comm, "STOP 0"
if num < 228 then [jump]
if x < 160 then [loop1] 'set for number of samples during move
[jump]
Print #comm, "QP0" 'get last position sent to servo
timer 50, [delay3] 'delay to allow data to be returned
wait
[delay3]
timer 0
dataRead$ = input$(#comm, lof(#comm)) 'get returned data
print "voltage byte is "; num 'print out raw servo position
print "position byte is "; dataRead$ 'print out raw servo position
print "servo position is "; ASC(dataRead$)*10 'convert position into ms
timer 500, [delay4] 'delay to allow data to be returned
wait
[delay4]
timer 0
Print #comm, "#0 P2200T1000" 'send servo to start position
print ""
y=y+1
if y < 11 then [loop] 'set for number of loops
print "done"
Close #comm
end
[handleIt]
print "Comport error! Check settings and status."