BotBoard Steam Plane

My current project is dealing with a steam RC airplane
For the project I bought a Spektrum DX5e controller and receiver.

I was wondering if I could get the bot board and AtomPro 28 I have working with the reciever. Simply put all the outputs from the receiver into the bot board and have the bot board control the servos
I’ve been doing research on it and found this
lynxmotion.net/phpbb/viewtopic.php?t=4362
Physically its what I am trying to do but I have tried that code over and over again and can’t get it to work at all.
I was wondering if there might be a different approach to this problem or what would I have to do to get it working.

All help is appreciated

Oh yeah the bot board would later be used for an automated flight system of some kind, in case it goes out of signal range or is plummeting to the ground. :stuck_out_tongue:

The simple answer is yes. You can plug in all 5 channels from your receiver into 5 pins on the Atom Pro bot board and plug your servos into other pins on the Bot board.

The simplist approach would be to simply us the pulsin command to read in the pulse values that are coming from your receiver.

Something like:

[code] ;Read input pulse lengths in the correct order that take shortest time
PULSIN RCCh0, 0, RCInput(0)
PULSIN RCCh2, 0, RCInput(2)
PULSIN RCCh4, 0, RCInput(4)

PULSIN RCCh1, 0, RCInput(1)
PULSIN RCCh3, 0, RCInput(3)

[/code]
If you do a serach on the forums here for pulsin, you will find several examples. If you are using pulsin to read the values in, it is highly unlikely that you will be able to read two consecutive channels that your receiver generates without having to wait awhile, That is why this code skips channels to speed up the code. However the best order depends on your receiver.

I do have some assembly language code that can read in all the channels in one pass, that you can find if you do a search on “mpulsin” but you might want to wait to try that until you get it limping along and decide you need the speed improvements.

A simple program could probably be layed out like:

;[con]
; define constants
RCCh0		con P0  
RCCh1		con P1  
RCCh2		con P2  
RCCh3		con P3  
RCCh4		con P4  

SRVO0		con	P11
SRVO1		con P12
SRVO2		con P13
SRVO3		con P14
SRVO4		con P15


;[vars]
RCInput    		var word(5) 

HServoOutput 	var sword(5)
i				var byte
;...
;[init]
;Interrupt init 
ENABLEHSERVO 

;... all of the stuff you need to initialize your setup
;[main loop]
main:
;
;	Read in the pulse values
;	Read input pulse lengths in the correct order that take shortest time 
	PULSIN RCCh0, 0, RCInput(0) 
	PULSIN RCCh2, 0, RCInput(2) 
	PULSIN RCCh4, 0, RCInput(4) 
  
	PULSIN RCCh1, 0, RCInput(1) 
	PULSIN RCCh3, 0, RCInput(3) 

; 	convert the 5 channels into hservo values -12000 to 12000
; 	note: this calculation will probably need to be tweaked!!!
	for i = 0 to 4
		HServoOutput(i) = (RcInput(i) -1500) * (12000/1500)
	next
	
; now output the values to hservo
	hservo [SRVO0\RCInput(0),SRVO1\RCInput(1),SRVO2\RCInput(2),SRVO3\RCInput(3),SRVO4\RCInput(4)]

; and go back to do again
	goto main

Note, I quickly typed this up so there are probably mistakes and the conversion values may not work correctly… But it might get you along the right track.

Kurt

Thank you, thank you

Kurt you are a life saver in this. If I need to learn the assembly part of it I’ll ask.
So far right now I haven’t had a chance to finish building the plane so I’m not sure about latency issues yet.

Thanks again.
~Mark