Can anyone point me towards the code for headmovement? I need it for Xan’s code. If there is such a thing. I’ve been searching for days but can’t seem to find anything…
The best would be to have the code from the A-Pod. That is beautifull!
IF (ABS(TravelLengthX)>TravelDeadZone | ABS(TravelLengthZ)>TravelDeadZone | ABS(TravelRotationY*2)>TravelDeadZone) THEN
;Calculate walking direction X and Z
TravelLengthXZ = SQR((TravelLengthX * TravelLengthX) + TravelLengthZ * TravelLengthZ)
HeadAngle = TOINT(FACOS(TOFLOAT(TravelLengthZ) / TOFLOAT(TravelLengthXZ)) * 180.0 / 3.141592)-180
;Add sign depending on the direction of X
HeadAngle = HeadAngle * (TravelLengthX/ABS(TravelLengthX))
ENDIF
;Calculate body angle depending on rotation
IF ABS(TravelRotationY2)>TravelDeadZone & ABS(TravelRotationY3) > ABS(HeadAngle) THEN
HeadAngle = -TravelRotationY3 ; Rotation max = 166 to get max range of 90 deg.
ENDIF
RETURN[/code]
you may need to change your TravelDeadZone as its abit twitchy!
it will move the head so it faces the walking direction. and also yes 'during body moves.
just cope it into your code at the given places and it should work just fine. any problems just ask.
This is thanks to Xan, who sent this to me awhile back, when i was after the same idea as you.
you can rename what ever you like as long as it corresponds with other sections of the code.
i remember resently reading that Zenta has been having problems getting his A-Pod hexapod to walk correctly due to the excess weight (offsetting the balance) of the head and tail. im guessing you wont be hiding the electronics in the tail or head as he did.
2DOF would work ok i guess. never tried it myself.
anyway good luck with your project.
look forward to seeing it.
just a thought that you will notice the code will make the servo twitch slightly while following direction, (not off putting but you will notice it) and i beleive its because the code is asking the sservo to return to center
;Return to the middle position
HeadAngle=0
and i beleive its trying to loop this in each time the code is called.
should be fine though.
They do twitch when put the power in. But the Big transistor on the board get really hot. That is wat i smelled.
It is the ssc-32 that is giving the problem. Not the BBA pro 28
it was working fine. my hexapod was walking. I was calibrating the legs when i smelled something. Now it doesn’t do anything except for the twitching you mensioned.
Here is an overview of the SSC.
I think you’re talking about the part marked with number one. It’s the voltage regulator. It’s supposed to get a little hot when in use but can burn when you put to much amps trough it. The Voltage regulator is supposed to only feed the electronics. No servos. Do you have jumper 5 installed?
I would also check for shorts. Maybe a servo wire got caught in a servo, or stretched, such that wires got exposed and maybe the pulse wire is shorted out…
Also check your wires for connecting the BB2 to the SSC-32 as well as the power wires…
Try disconnecting all of the servos from the board. Does the SSC-32 power up properly. If so you can try simply adding a few see if it still comes up, until you find the one. You might also be able to use a voltmeter and check to see what the resistence is from the pulse to ground of each of these wires.
I think a servo probably was connected backwards and got ruined. happened to me and my regulator got real hot. you were probably smelling the servo burning up.
Also as a long shot, check to make sure that there is nothing shorting out any of the traces. For example there could be a lose bolt/nut that was floating around in your case, but now rolled under it and shorted out something… (Happened to me).
The only way the regulator can get smoking hot is if the output were shorted to ground. Was there any metal parts that could have touched the traces on the board?
What specifically did you have connected to the VL terminal?
Normally this is a 9vdc battery. When using a 9vdc battery if the output of the regulator were to become connected to ground via whatever means, the result would be the 9vdc battery would quickly become depleted, the regulator would go into shutdown but nothing would be permanently damaged. But if you had a 1000mAh or larger pack it could maybe damage the regulator.
Put an ohm meter from ground to the 5vdc line, this can be found by the analog input headers. If it’s 0 ohms that means there is a short somewhere on the 5vdc line.
If you’re lucky the board may still be good, but the regulator itself may be bad. The only way to determine this is to remove the regulator and try to inject 5vdc onto the 5vdc line.
Keep us posted.
As far as regulators going bad, I have never heard of them going bad for no reason. If anyone else has, I’m all ears… To the best of my knowledge something has to short out the output in order for the regulator to burn up.
Bypass caps are not known for going bad in a few weeks of use. There is a tantalum cap on the output. It’s probably the best place to look for a short. If it’s the tantalum, it may be a factory defect?
I have had 2 regulators go bad after connecting an AC power adapter to them accidentally (although I highly doubt that’s what he did). kurt might be right though. a loose bolt might have fallen underneath the board when the robot stood up and could have shorted something. Has the board been removed from the robot since this happened?
Uh this isn’t the regulator “going bad”. This is I screwed up and I blew up my regulator.
In fact the regulator used on the ssc-32 and abb is pretty tough in that it can handle a short circuit for quite some time before allowing you to kill it. it actually tries to protect itself when it starts to get hot by reducing its output voltage. what it doesn’t handle is “I put too much voltage across it’s input” or “I put reverse voltage across its input” or “I smacked it with a screwdriver and busted a leg off”. Actually all three of those errors are highly likely to take out the tantalum filter capacitors before the regulator gives up the ghost. so reality is if you manage to actually kill the regualtor then you tried pretty hard.
consider please if you put the car in reverse instead of drive as you intended then step on the gas and smash into the garage door or car behind you, do you seriously think it’s the fault of the car? O.o