I am looking to adapt pressure sensors to the feet of my CH3-R. As such I would like to be able to instruct a servo to go to a certain position and, if the pressure sensor is activated during the movement, cancel the command. Does anyone know whether this is possible? If so does the firmware loaded on the SSC-32 automatically support this ability or must I write my own firmware?
The SSC does include a command to cancel servo movement. I’ve looked at it but I really doubt it would work fast enough for your application. Once the leg hits the ground you want to stop the movement directly. But the uC needs to process the input. And send the “stopâ€
I just saw you’re other post en think you’re working on a arm
Well if so, I guess you want to put a FSR on the gripper. I think that is possible without a problem. We’re only talking about one servo instead of 18 and there is no feedback needed.
Thanks for the info. I am worried about the delay between detecting the event and issuing the stop command. I will test the functionality ASAP and let you know what I find.
I hadn’t considered the fact that I won’t know where the servo stopped though. My plan so far has been attempt to take a step and then reverse course if an obstacle prevented the action. For this reason I wouldn’t necessarily need that info but I can see the value in it for other things. Do you know of any good reading material on this issue?
once the STOP command is issued you should be able to read the current position the ssc-32 is sending to the servo back out of the ssc-32, if that helps any.
The below post might be of interest. It has a servo start a slow timed move until contact is detected, the servo is stopped, and the servo position obtained. Then the servo is moved back to the starting point and the cycle is repeated. Bottom is the code.
'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."
Thanks for the link Zoomkat I look forward to reading that thread.
As for the code sample I clearly need to read up on basic but I think I get the general gist. At this point I’m wondering whether it would be better to have the SSC-32 handle the touch sensor(s) so that I can say something like ‘#0P700’ and have it abort if the sensors is activated as well as notify the BAP of the problem. Of course this may very well have been covered in the other thread.
The ssc-32 does not do anything on its own. A board or PC needs to constantly query the ssc-32 during the servo movement as to the analog input voltage, and decide weather or not to send the ssc-32 the approprate servo stop command. The ssc-32 will not stop the servo movement on its own when the the input voltage drops low.
That I imagine is a limitation of the current firmware. Given that the board is using an Atmega168 it seems like it’s still doable given enough time/interest. The former being the most crucial for me