ServoPal connection to 3 pin header
garyg
Posts: 420
I recently purchased a ServoPal.
I'm attempting to get the ServoPal to operate my servo.
I'm using a BS1 module on a test board that I built.
The ServoPal has a double row header designed to plug into a Parallax BoeBot.
I only have one 3pin header on my test board.
I am unable to get any response out of the ServoPal.
I've attempted to make my setup and initialization of the ServoPal compatible with the BS1 controller.
However, I get no response to my servo.
I've attempted below to paste the logic I'm attempting to use into this message.
A few questions:
1 - Do I need to power both sides of the female pins on the ServoPal in some manner?
2- Does it appear that my program logic is moving in the correct direction?
3- Will a BS1 module be capable of driving the ServoPal?
Thanks for any advice/suggestions
Garyg
SYMBOL PalI = PIN1 'Define ServoPal control signal pin.
INPUT 2 'Pushbutton
'INPUT PalI should watch the signal pin of the ServoPal until it is properly powered up.
INPUT PalI 'Make sure ServoPal is not being driven.
IF PalI = 1 THEN ClearServoPal 'Wait for ServoPal to power up.
'ClearServoPal should initialize the servopal to not drive anything for now.
ClearServoPal:
LOW PalI 'Set PalI pin1 to an output and hold it low
PAUSE 1000 'Wait for 1 second
HIGH PalI 'Raise pin1 to high so it's ready to send servo driving info.
'to the ServoPal.
'The above thing starting with INPUT PalI should make the ServoPal ready to use.
Main:
IF PIN2=0 THEN TURNONLED
GOTO Main
TURNONLED:
HIGH 5
setthepotvalue:
FOR position = 1 TO 1000 'drive the servo for 20 seconds - 50=1sec.
POT PotPin, Scale, Level 'The Pot Pin is PO which is pin 7 on the BS1 module.
'The scale is rescaled from original POT TEST,
'B2 is the memory location of the Pot level value,
levelstorage=B2 'levelstorage is memory location W2
IF W2<114 THEN Minimum 'Minimum servo position = 114 when Finger is DOWN
IF W2>190 THEN Maximum 'Maximum servo position = 190 when Finger is UP
GOTO Driveservo
Minimum:
levelstorage = 114 'Minimum servo position (Finger DOWN), can't be done in If Then statement.
GOTO Driveservo
Maximum:
levelstorage = 190 'Maximum servo position (Finger UP) 190, can't be done in If Then statement.
GOTO Driveservo
Driveservo:
'start of servo drive logic.
PULSOUT PalI, levelstorage ' position servo anyplace within the 180 degree range.
'PULSOUT 1, levelstorage 'try to turn on the other servo driver.
PAUSE 30 ' 30ms pause
'Pause for at least one or two cycles of the ServoPal before updating again.
NEXT
PULSOUT PalI, 500 ' turnoff the servoPal output 0
TOGGLE 5
'end of servo drive logic.
GOTO main
I'm attempting to get the ServoPal to operate my servo.
I'm using a BS1 module on a test board that I built.
The ServoPal has a double row header designed to plug into a Parallax BoeBot.
I only have one 3pin header on my test board.
I am unable to get any response out of the ServoPal.
I've attempted to make my setup and initialization of the ServoPal compatible with the BS1 controller.
However, I get no response to my servo.
I've attempted below to paste the logic I'm attempting to use into this message.
A few questions:
1 - Do I need to power both sides of the female pins on the ServoPal in some manner?
2- Does it appear that my program logic is moving in the correct direction?
3- Will a BS1 module be capable of driving the ServoPal?
Thanks for any advice/suggestions
Garyg
SYMBOL PalI = PIN1 'Define ServoPal control signal pin.
INPUT 2 'Pushbutton
'INPUT PalI should watch the signal pin of the ServoPal until it is properly powered up.
INPUT PalI 'Make sure ServoPal is not being driven.
IF PalI = 1 THEN ClearServoPal 'Wait for ServoPal to power up.
'ClearServoPal should initialize the servopal to not drive anything for now.
ClearServoPal:
LOW PalI 'Set PalI pin1 to an output and hold it low
PAUSE 1000 'Wait for 1 second
HIGH PalI 'Raise pin1 to high so it's ready to send servo driving info.
'to the ServoPal.
'The above thing starting with INPUT PalI should make the ServoPal ready to use.
Main:
IF PIN2=0 THEN TURNONLED
GOTO Main
TURNONLED:
HIGH 5
setthepotvalue:
FOR position = 1 TO 1000 'drive the servo for 20 seconds - 50=1sec.
POT PotPin, Scale, Level 'The Pot Pin is PO which is pin 7 on the BS1 module.
'The scale is rescaled from original POT TEST,
'B2 is the memory location of the Pot level value,
levelstorage=B2 'levelstorage is memory location W2
IF W2<114 THEN Minimum 'Minimum servo position = 114 when Finger is DOWN
IF W2>190 THEN Maximum 'Maximum servo position = 190 when Finger is UP
GOTO Driveservo
Minimum:
levelstorage = 114 'Minimum servo position (Finger DOWN), can't be done in If Then statement.
GOTO Driveservo
Maximum:
levelstorage = 190 'Maximum servo position (Finger UP) 190, can't be done in If Then statement.
GOTO Driveservo
Driveservo:
'start of servo drive logic.
PULSOUT PalI, levelstorage ' position servo anyplace within the 180 degree range.
'PULSOUT 1, levelstorage 'try to turn on the other servo driver.
PAUSE 30 ' 30ms pause
'Pause for at least one or two cycles of the ServoPal before updating again.
NEXT
PULSOUT PalI, 500 ' turnoff the servoPal output 0
TOGGLE 5
'end of servo drive logic.
GOTO main
Comments
BS1 is 10us units.
I've looked very closely at the ServoPAL documentation.
According to the documentation the ServoPAL can be used on the BOE.
I looked up the schematic and it does show that the VSS / VDD connectios exist in parallel on the board of education.
My plan will be:
1- Write a minimal program with no frills.
2- Convert the pulsout timing so that it is consistant with the BS1
3- WireWrap short circuit the RED pins and BLACK pins.
4- Load the program and check the results with O-Scope.
I'll post the results on this thread.
Thanks
garyg
I would hold off on messing with the Red and Black pins. First see if it works.
I followed my simple program plan and
attempted to get the ServoPAL to work using only 3 pins.
I tried both sides of the ServoPal
1st I plugged in the Servo1, vdd, Gnd side without success
Then
I plugged in the Servo0, vdd, Gnd side without success.
With the O-Scope probe connected to the Servo0 side, I could see the signal appearing to be transferred through
the ServoPAL but the ServoPAL would not output a signal.
After a few hours of trying different values in the signal timing without success, I thought I would try
Shorting the female side of the ServoPal at the GND and Vdd points on both sides of the ServoPAL.
EVERYTHING STARTED WORKING!
I tried uploading the Code that I used for testing the ServoPAL on my BS1
I would like to try the alarm function but am wondering;
Is the ServoPAL capable of driving an LED, or do I need to use one of my BS1 inputs to take the Alarm signal
and drive an LED?
I feel confident that I can now use the ServoPal in my upcomming projects.
garyg