Help With Accelerometer Servo Control
RubrChicken
Posts: 39
I'm working on getting my Memsic2125 accelerometer to control servos. I have it all soldered onto a proto board, and I'm wondering if it will work with 3.3V because this says it is for 5V.
Now onto my problem (which may be solved by changing the voltage!):
I'm using the MXD2125 Simple object contained in the memsic demo from the OBEX:
obex.parallax.com/objects/235/
I can control my servos fine(IE its not a problem with the servos or connections), but when I start attempting to use the accelerometer, the servo goes "limp". I'm using this:
to control the servo, but it doesn't work. It doesn't help that I can't get any data back from the prop because : 1)BST's serial terminal doesn't work for me (and I have no idea why) 2) it's on a protoboard (so no VGA or TV) 3) I don't want/don't have time to desolder the accelerometer to use in a demo board.
I assumed accel.x was in gs, from 1 to -1. Dividing by 2 (-.5 to .5) then adding 1.5 (1 to 2) then multiplying by 1000 (1000 to 2000) should give me values that the servo will take, but it goes limp anyways.
Thanks for the help!
Now onto my problem (which may be solved by changing the voltage!):
I'm using the MXD2125 Simple object contained in the memsic demo from the OBEX:
obex.parallax.com/objects/235/
I can control my servos fine(IE its not a problem with the servos or connections), but when I start attempting to use the accelerometer, the servo goes "limp". I'm using this:
SERVO.Set(1,(((accel.x)/2)+1.5)*1000)
to control the servo, but it doesn't work. It doesn't help that I can't get any data back from the prop because : 1)BST's serial terminal doesn't work for me (and I have no idea why) 2) it's on a protoboard (so no VGA or TV) 3) I don't want/don't have time to desolder the accelerometer to use in a demo board.
I assumed accel.x was in gs, from 1 to -1. Dividing by 2 (-.5 to .5) then adding 1.5 (1 to 2) then multiplying by 1000 (1000 to 2000) should give me values that the servo will take, but it goes limp anyways.
Thanks for the help!
Comments
SERVO.Set(1,accel.x*500+1500)
I don't think the above will work because the accel.x value is likely something other than -1 to +1. You'll need to run the demo and look at the values produced or go through the datasheet or both, then change the factors in the above statement to match.
Post Edited (Mike Green) : 6/26/2009 4:35:37 AM GMT
how about using the PST instead of the BST ?
If you alreday mean the PST: without debugging by ANY display at all you will have a hard and really long job until your project is finished
I guess without debugging a problem will take 5 days to solve it
getting debugging to work by
- soldering some resistors on your protoboard to get a TV-signal and a cynch-connector will take half an hour
- soldering 8 resistors on your protoboard to get a VGA-signal and a VGA-plug will take one hour
- describing your problem IN DETAIL what you have tried with PST and what the result is until you get an answer wil take one day
after debug works half a day and your program is running
so get any kind of kind of debugging to work !
best regards
Stefan
I agree that adding a way of debugging - of displaying what's really happening - will make your task a lot easier. Assuming that you already have a serial LCD, this is a way that doesn't require adding any hardware (well, also assuming you have your servo headers wired up properly: you know that you need to connect their I/O pins to Prop I/O pins through a resistor, right?).