adding CPPM receiver to Bolt FC with mounted flow deck

Discussions about all things Bitcraze
Post Reply
4things
Beginner
Posts: 9
Joined: Wed Mar 02, 2022 8:27 pm

adding CPPM receiver to Bolt FC with mounted flow deck

Post by 4things »

Dear community could you please tell me if there is any option to use an CPPM Receiver with Bolt FC and mounted Flow deck?

a working solutions for me could be to use the pin 5 of the right deck connector wich is used by the big quad deck. (marked in red)
Bildschirmfoto 2022-03-16 um 15.49.11.png
I could figure out what flags need to be set to compile the code with ppm input.

thank you in advance
4things
Beginner
Posts: 9
Joined: Wed Mar 02, 2022 8:27 pm

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by 4things »

figured out that the bigquad deck wich supplies cppm uses pin 5 on right connector to read signal from receiver.
the flow deck uses pin 5 MOSI for communication to PMW3901MB. is there a possible way to remap the cppm pin?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by tobias »

Yes as of this #862 pull request it is possible to remap the CPPM input.
4things
Beginner
Posts: 9
Joined: Wed Mar 02, 2022 8:27 pm

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by 4things »

thank you. I've tried to change the pin to PB8 (IO_1 left Crazyflie connector Pin 6) by changing the cppm.c line 78 and below to

Code: Select all

  #else // default is PB8
  #define CPPM_TIMER_NUMBER            10
  #define CPPM_TIMER_CHANNEL           1
  #define CPPM_GPIO_RCC                RCC_AHB1Periph_GPIOB
  #define CPPM_GPIO_PORT               GPIOB
  #define CPPM_GPIO_PIN                GPIO_Pin_8
  #define CPPM_GPIO_SOURCE             GPIO_PinSource8
#endif
at extrx.c I changed

Code: Select all

#define ENABLE_CPPM
bool extRxArm = true;
bool extRxAltHold = true;
  
#define EXTRX_ARMING true 
#define EXTRX_ALT_HOLD true 

is my pin correct? do I need to make other changes to code? I disabled all expansion decks except the needed flow deck and bigquad deck.

do how could I check if the bolt deck receives ppm?

thank you in advance
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by tobias »

For Bolt the CPPM deck driver has to be activated. In the kbuild menuconfig:
- Set "Force load specified custom deck driver" to bcCPPM
- Enable the "Support the CPPM deck".

After flashing this the the console output should be similar to:

Code: Select all

SYS: ----------------------------
SYS: Crazyflie Bolt is up and running!
SYS: Build 83:6c33f7eae10e (2022.01 +83) MODIFIED
SYS: I am 0x383135343036510C00480038 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_INFO: CONFIG_DECK_FORCE=bcCPPM found
DECK_INFO: compile-time forced driver bcCPPM added
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcCPPM for deck 0
EXTRX: CPPM initialized, expecting AETR channel mapping
IMU: BMI088: Using SPI interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Complementary (1) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushless motor driver
SYS: About to run tests in system.c.
SYS: NRF51 version: 2022.01
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
DECK_CORE: Deck 0 test [OK].
SYS: Self test passed!
STAB: Wait for sensor calibration...
SYS: Free heap: 20560 bytes
EXTRX: CPPM Task Started
STAB: Ready to fly.
To activate CPPM PB8 in the top of cppm.c add

Code: Select all

#define CPPM_USE_PB8
The variable changes you suggested I would leave out

Code: Select all

bool extRxArm = true;
bool extRxAltHold = true;
To debug it you can check the cfclient log variables extrx_raw to see the RX channel values and extrx to see the final translated values. You might have to edit the defines like EXTRX_SCALE_ROLL in the top of extrx.c to get scaling and such correctly.
extrx_raw.png
4things
Beginner
Posts: 9
Joined: Wed Mar 02, 2022 8:27 pm

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by 4things »

thank you so much that helped a lot and finally I could get it working.

I need cppm with flow deck and assist mode hover.
while using cfclient and takeoff the optical flow works.
After enabling the the transmitter assist mode is disabled and the drone isn't locked in place anymore.
Is it possible to activate position hold alt hold by default?

could it be an alternative to enable it through

Code: Select all

EXTRX_CH_ALTHOLD 
parameter?


thank you in advance
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: adding CPPM receiver to Bolt FC with mounted flow deck

Post by tobias »

I have not tired it but yes, looks like it.
Post Reply