[chbot] The next steps for my bot and control board.

Carl Ranson chchrobotics@lists.linuxnut.co.nz
Thu, 05 Oct 2006 19:59:21 +1300


Resolved. The code was right but there were a couple of minor hardware 
mistakes that were at fault.
Thanks Mike for the expertise.

The cute thing is now that my motor control works on servo signals, I 
can add more servos with no extra code so pan and tilt aiming on the 
nail gun will be easy

CR

Michael Pearce wrote:

>Does the RTOS use time slicing and what timer does it use?
>
>1. Make sure its not the same timer used.
>
>
>2. It may be possible that the priority of your interrupt 
>need to be increased as the RTOS may steal the time your 
>code needs, this would make it change the pulse length, and 
>will cause the servo to jump around.
>
>3. Try code without the RTOS to start with, to make sure it 
>works by itself.
>
>Timing:
>
>10MHz x 4 = 40MHz - 40 MHz/4 = 10 MIPS
>10MIP = 100ns/instruction
>1.5ms = 1.5e-3 / 1e-7 = 15,000
>
>Your calculations are correct for timer settings with 
>prescale = 1:1
>
>
>You are welcome to pop out to Rolleston if you dont mind a 
>drive - have scope and logic analizer available.
>
>
>Mike
>
>On Saturday 30 September 2006 18:02, Carl Ranson wrote:
>  
>
>>I've tried the same basic technique from within my RTOS
>>framework and can't get it going right.
>>
>>Using it to drive a servo it jumps around randomly
>>(freaks out). At first i thought it was a power supply
>>noise problem, so i rigged up a seperate supply for the
>>servo. No difference.
>>
>>Its entirely possible that ive got the timing all wrong.
>>Im running a 10MHz crystal with PLLx4 enabled (10MHz
>>effective instruction clock).
>>
>>With a timer prescale of 1:1 i would expect that setting
>>the period register to 15000 to give me a 1.5ms pulse.
>>
>>There are enough things i could have done wrong that I'd
>>like to measure whats actually going on.
>>
>>Is there anyone on the west side that wouldn't mind
>>giving me 30 mins of scope time?
>>Cheers
>>CR
>>    
>>
>
>
>  
>