View Full Version : RC Servo Code with acceleration for PWMA and PWMB
designer2k2
12-03-05, 01:27 PM
Hello,
ive done 3 years ago in shool a hexabot, with the IsoPod. now i pulled it out back and iam trying to bring it back to live :)
in the past we where using a code where i can say that the servos should move from A to B, and then the servos go with full speed there. in the shool this was enough, but now i want a smooth movement!
for this i have searched in the downloadsection and found the "RCRelMove.txt" code, that is working PERFECT, for PWMA, but thats just controlling the half side of my hexabot. iam trying now since 2 days to "enhance" this code that also PWMB is working, without luck... PWMA is working fine, but PWMB is just making funny stuff and i dont know why
ive attached the code iam using now, could somebody say me what is wrong or missing?
designer2k2
designer2k2
04-27-06, 03:56 AM
hello,
*push*
can nobody help me?
In the file attached there are some references to PWM registers as detailed in the DPS54F80x Users Manual (http://www.freescale.com/files/dsp/doc/user_guide/DSP56F801-7UM.pdf) on page 344 linked on the Download page for the "Pods" on our website. Lines such as :
8000 E03 !
is taking the number 8000 hex and placing it in the Output Control Register for the PWMAx pins. There is a base address of the PWMA register of E00 and the 03 refers to the added offset address of the specific Output Control register. The value 8000 stored there with the ! charecter has been determined to set the appropriate bits in that register for the needed output. This type of setting must also be done for the PWMBx pins, which has a base address of EC0, so 8000 must also be stored in the register EC3 to configure the PWMBx pins in a similar manner :
8000 EC3 !
It appears that this has been attempted with a similar storing in a register of E2x, but I do not know what is located at that register address, or what effect that statement has. Essentially, all references that configure registers for the PWMAx pins referenced with E0x, should probably also be done with the PWMBx pins at register addresses beginning with ECx. It appears that every reference to E2x should be changed to ECx for correct addressing.
That is still no guarantee that the code would work for both sides the hexapod, but is an initial point of reference to begin with.
designer2k2
04-27-06, 02:25 PM
hello,
basicly thats what ive done, just load all the same values from PWMA also into PWMB (hopefully) but its not working.
i used this manual to find the adresses for the PWMB, but on page 112 ist the base adress listet with E2x not ECx, thats why i got it like that...
ECx is the base for ADCB
did i see there something wrong?
designer2k2
Perhaps there is some error in the manual on the page 344 referenced, as it does give the EC0 as being the base for the PWMB register. I believe that the E20 that you already have is probably the correct address for the PWMB_Base.
The only other point I see might be in the RC and RC? words, that reference the E06 PWMVAL0 registers, but do not appear to have a way to look at the PWM values for the PWMB pins. RC is used in the VMX velocity move word, but RC? does not appear to be used. I am unsure of how to change the RC definition to also refernce the value in the PWMB registers.
Alternatively the IsoMax code example for the 18 servo hexapod might be examined to see if it might be paired down to a 12 servo version. It also might give ideas on how to modify the current code you have for use with both PWM registers as it has some similarities in register manipulations.
Hexapod code (http://www.newmicros.com/isopod/appnotes/h3walker.txt)
vBulletin v3.0.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.