Asked
— Edited
Hello,
i have one ( i hope easy) question.
i have a pressure sensor.
Work fine on the ADC!
Now i have one problem.
If the value for the ADC port is under 180 the servo must stop ( hold his position)
my idea of a script :
:loop
$CurrVoltage = GetADC(ADC0)
if ($CurrVoltage <= 180)
servo (d0, "stop")
sleep(300)
endif
goto (loop)
But the command servo (d0, "stop") dont exist
So with command i can take what tells the servo he must stop and HOLD his position.
Thanx a lot for helping
AND FOR ALL A HAPPY NEW YEAR!
AND BIGGER ROBOTS NEXT YEAR!
Hello Alan
i made a complete new project and copy the script into this and now it works with the 50ms. Ahhhhhhh Something was wrong!
@Richard yes not only for burning servo, also for holding eggs and not break it!
It works slowly almoust like my idea was, but now the next problem to put the presssure sensors to good positions to the finger where they can get a good pressure! and at which value the servo stops. to weak it stops to early to strong it not stops.
If i have a good result i will inform you.
But first happy new year to all!
As well as the pressure sensors, you might want to add a little foam so there is some "give" in the grip as well as a little texture to hold onto things.
Alan
Only getadc() one time, otherwise it's needless queries to the ez-b. Also, the IF statement is redundant because it will always be below 175.
My initial example was the best so far. Simply change the REPEAT to have the max and min values of the gripper.
DJ, he is looking at the value of two different ADC ports, and if either value is true he wants the script to halt. I think the script is correct. Am I missing something that you see, or did you miss that it is two different adc ports with two different thresholds?
Alan
@DJ it works fine with two ADC ports
@Alan You are right!
Boris
Hello Boris;
I get what is trying to be done, but I'm not sure I understand the programming part of the problem correctly, so I'll ask some questions.
Are there two separate scripts running? That is, one script which is making the servo move however it should, and a second script that is monitoring the pressure sensors voltage? Then, when the voltage drops below 180 (or whatever) the second, "stop" script, stops the servo and the servo then holds the position it has at the moment it is stopped?
Also, is the stopping script supposed to stop the servo even if it is currently moving due to being sent a servo() command (or whatever) to make it move? In other words, let's say the command Servo(D4, 155) is sent, and the servo is slowly moving to the 155 degree position, is the stop script supposed to stop it dead before it gets to 155?
Hello WBS00001!
HAPPY NEW YEAR TO YOU!
Long time not hearing from you! I am happy to see you again!
To you question.
Yes it will be the best if i will have a monitoring script to check out which value the ADC ports have and when the value reach his point the script will stop the servo.
To understand here is a photo from my Inmoov Palm with the first finger who has 2 pressure sensors.
DJ Script works, but first problem the move is not smooth, because the servo moves now in 15 steps every 50ms and this is not smooth! And the second problem, its better to have a monitoring script, now i must copy the DJ Script in every moving script for the fingers what i have.
I hope this explains what i want to do.
Boris
Hey Boris... try slowing the servo down instead of "stepping" it...
EDIT.... On second thought never mind my idea won't work