emergency help needed with the propeller serial servo controller..
FireHopper
Posts: 180
I am trying to use it with my animatronic costume. but its not ramping. I need help asap. please tell me what you need to see. (I am using my own custom firmware hacked from the standard firmware. I only edited the main firmware, but when I use setservoposition it zooms right away to the position. it dont slowly move, which is what I need.. please help asap!!
Comments
Jim
Try increasing your Ramp value... right now you have it set to 3. Doing it this way uses the Lookup table with pre-set, pre-calculated values that are meant to be compatible with the original servo controller.
You can also try setting the Ramp directly using the 'SetRamp' command from within the 'Servo32v7.spin' file.
Since you already have an OBject aliased to it as 'SERVO', you code might look something like this...
SERVO.SetRamp(Pin,Width,Delay)
Where:
Pin is the Servo Pin
Width is the Pulse Width you want to move to
Delay is how quickly you want to get there.
Note: The resolution of Delay is about 38.75us or 3100 clocks at 80 MHz
Keep in Mind:
The SERVO.Set command moves the servo immediately to a defined position
The SERVO.SetRamp command moves the servo to a defined position with a specific delay
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
The numbers 0 to 63 represent a preset value in a lookup table designed to maintain compatability with the previous Servo Controller that we Discontinued.
Take a look at the Servo32v7_RampDemo from the OBEX ... obex.parallax.com/objects/51/
Now take a look at your code right after you set the Ramp value to 3 ... you are combining objects in a way that effectively uses the 'SetRamp' command from 'Servo32v7' which overrides any value your setting within 'Ramp'.
If instead you used the 'SERVO.SetRamp' command instead of just the 'SERVO.Set' command with the appropriate ramp delay your code would probably be ok.
For approximate Ramp values, 100 = 1 sec 6000 = 1 min
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
It should have something like this:
Should be 5 second ramp, (delay), to bring all servos to center position.
Jim
It's a Propeller archive zip file. Not Stamp Software.
Extracts fine here.
Jim
Post Edited (hover1) : 6/21/2010 1:58:27 AM GMT
I'm not exactly sure why your trying to wrap around the PSC Propeller Firmware when you have essentially made your own. Have you tried the Servo32v7 demo from the OBEX? That's all the PSC Propeller Firmware is doing, is to interpret a serial stream of commands and use the Servo32v7 object. The PSC Propeller Firmware was mainly designed for compatibility with an existing Servo Controller (<-Read before Propeller was introduced) where a Basic Stamp pulse width resolution of 2us was the smallest number you could send. I say this because the resolution of the Servo32v7 object is 1us. For reference, the line you have that reads ... SERVO.SetRamp(Servo_0,400,300) 'left wingtip starting point ... attempts to set the pulse width of the servo to 400us, when I think you meant for it to be set to 800us. The PSC Propeller Firmware would normally take the value you sent it of 400 and double it to 800 for compatibility with what the BS2 would have given it. Since you are bypassing this portion of the PSC Propeller Firmware it is attempting to send a width of 400 instead. I say attempting, because there are limits set within the Servo32v7 object designed to protect the servo from mechanical damage if you send a pulse width that is considered 'out of bounds'. Consequently it uses this 'out of bounds' as a software switch to disable a servo channel once it has been enabled. If the specified servo width is 'out of bounds', then the I/O assigned to that servo is made into an INPUT effectively disabling the servo. This default range is set within the Servo32v7 object to be between 500 and 2500. So if you are sending a pulse width of 400, then you end up disabling the servo.
I encourage you to take a look at the Servo32v7 object in the OBEX and take a look at the demo that has been provided with that object ... obex.parallax.com/objects/51/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 6/21/2010 2:37:32 PM GMT
that solved it thanks. now to figure out why the wings spaz when the prop first starts. I have to examine the code around the Start Pub.
another method to avoid that would be to power the prop first, let it get settled then power the servos. which is fairly easy to do [noparse]:)[/noparse] now I just need to figure out my i2c issues with it.. I have the second i2c bus on pins 8 and 9, but I am not getting any response from the leds.. I have wires running from those pins to a small bit of pcb where the pullups are located. then I have wires leading from that to two BlinkM's, 2 on each side, 4 total. I am wondering if I need to put more pullups on. or put some 4.7K resistors in the line like I had to for the servos.
I dont have access to a 'scope so I cant show any waveforms or anything.. or do I need to insert some delays in the i2c driver..
anyone have a propeller servo controller and some i2c devices and can get them to work together?
Post Edited (FireHopper) : 6/24/2010 1:28:12 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
What is the distance from the servo headers to the first board that has the pullups? And what is the distance to the board with the BlinkM's? There is a maximum bus capacitance of 400pf. Are you running Standard; 100kbps [noparse][[/noparse]Bits per Second], Fast mode; 400kbps, or High speed mode 3.4Mbps?
Jim
unknown what speed the buss is going at, as I didnt write the i2c driver I am using for the blinkm's
I am guessing as fast as it can go. dont know for sure..