CPPM receiver with BigQuad deck on the Roadrunner

Discussions about all things Bitcraze
Post Reply
matejkarasek
Beginner
Posts: 21
Joined: Tue Jul 09, 2019 11:50 am

CPPM receiver with BigQuad deck on the Roadrunner

Post by matejkarasek »

Hi,

I have a Roadrunner board with the BigQuad deck, and have managed to hook up a servo that I can actuate via PWM, using the Android Crazyflie Client app.
I have also connected a CPPM receiver, but no idea how to get that working. I would like to use CPPM signals as the main controller.

Does anyone have experience with that?

Thanks,
Matej
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: CPPM receiver with BigQuad deck on the Roadrunner

Post by tobias »

Unfortunately the CPPM input does not work at the same time as the Loco deck which is integrated to the Roadrunner. It might be possible to move the CPPM to another available TIMER and PIN but that requires some investigation and coding work. Also to have the Loco deck work with the BQ-deck have you checked this?
matejkarasek
Beginner
Posts: 21
Joined: Tue Jul 09, 2019 11:50 am

Re: CPPM receiver with BigQuad deck on the Roadrunner

Post by matejkarasek »

Hi Tobias,

Thanks for your reply, only replying now as my notifications were not set up correctly...

I have made the software and hardware changes as described under your link (only the first part as I don't plan to use the flow deck).

I won't need the CPPM and the (integrated) Loco deck working at the same time (at least at the beginning). Is it possible to disable the Loco deck for now (I suppose this would require hardware change to get CPPM working)?

Is there some example how to set up CPPM with a BigQuad deck on the crazyflie board?

Thanks!
Matej
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: CPPM receiver with BigQuad deck on the Roadrunner

Post by tobias »

The loco deck would need a FW were it is disabled. In the tag.mk comment out the bcDWM1000 line

Code: Select all

#CFLAGS += -DDECK_FORCE=bcDWM1000
Then rebuild the tag FW and flash it.

Code: Select all

make PLATFORM=tag
In the tag.mk file you have probably added build flags for the BigQuad deck right so you know how to do this?

As for the CPPM there is no good documentation and it's been a while since I used it myself so you might have to play around a bit. The configuration for the channels etc can be found in extrx.c. This defines you might have to change or configure accordingly in your transmitter so the mapping is correct. Other then that the extrx input has priority, so as soon as a signal is received, it should start working. A good way to debug would be to look at the extrx log variables.
matejkarasek
Beginner
Posts: 21
Joined: Tue Jul 09, 2019 11:50 am

Re: CPPM receiver with BigQuad deck on the Roadrunner

Post by matejkarasek »

Thanks, Tobias, got it working following your instructions!
Obviously (although not obvious to me at first) I also needed to uncomment the previously commented lines as described here

Thrust still behaves a bit strange, will look at that tomorrow...
matejkarasek
Beginner
Posts: 21
Joined: Tue Jul 09, 2019 11:50 am

Re: CPPM receiver with BigQuad deck on the Roadrunner

Post by matejkarasek »

Reviving this thread...

Got to a point, where I would like to use the CPPM and the Loco deck at the same time.

I am trying to move the CPPM to PB6 (SCL of I2C1 by default), but my embedded programming skills are very limited.

Since I2C1 is also used by the EEPROM, I would like to disable it and use hardcoded values instead, but for now not sure how to do that...
Following this forum thread, in configblockeeprom.c, in configblockTest(void) I have replaced

Code: Select all

return eepromTest();
with

Code: Select all

return 1;
But I suppose that only bypasses the test...
Do I need to disable I2C1 entirely?

To reconfigure the CPPM pin, I have changed the cppm.c in the following way (lines 43-52):

Code: Select all

#define CPPM_TIMER                   TIM4
#define CPPM_TIMER_RCC               RCC_APB1Periph_TIM4
#define CPPM_TIMER_CH_Init           TIM_OC1Init
#define CPPM_TIMER_CH_PreloadConfig  TIM_OC1PreloadConfig
#define CPPM_TIMER_CH_SetCompare     TIM_SetCompare1
#define CPPM_GPIO_RCC                RCC_AHB1Periph_GPIOB
#define CPPM_GPIO_PORT               GPIOB
#define CPPM_GPIO_PIN                GPIO_Pin_6
#define CPPM_GPIO_SOURCE             GPIO_PinSource6
#define CPPM_GPIO_AF                 GPIO_AF_TIM4
I can make without errors and flash, but CPPM is not working.

I suppose line 92 should also be changed to TIM4_IRQn (?), but that seems to make the board freeze.

@tobias I would appreciate some pointers on the next steps... :)
Post Reply