Hi,
I am wandering how to generate proper PWM signals (also ONESHOT125 needed) from Default connectors on my CF2.0 ,so that i can use external ESCs to drive Brushless Motor.
Since i'm not that into the DRIVER CODES in VM ,i need someone to help me with the configrations. Just tell me the key points ,ill try myself. Many thanks~ !
[SOLVED] Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
Re: Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
In the motors_def_cf2.c there are configurations for this.
So in platform_cf2.c you should change the motor map.
Hopefully this works out of the box. Remember you have to solder pull-ups (~1k) to VBAT.
Code: Select all
/**
* Brushless motors mapped to the standard motor connectors with pull-ups (~1K) to VBAT soldered.
*/
const MotorPerifDef* motorMapDefaltConBrushless[NBR_OF_MOTORS] =
{
&CONN_M1_BL_INV,
&CONN_M2_BL_INV,
&CONN_M3_BL_INV,
&CONN_M4_BL_INV
};
Code: Select all
{
.deviceType = "CF20",
.deviceTypeName = "Crazyflie 2.0",
.sensorImplementation = SensorImplementation_mpu9250_lps25h,
.physicalLayoutAntennasAreClose = true,
.motorMap = motorMapDefaltConBrushless,
},
Re: Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
yes, I get it.It really helps,thank you very much ~!
Re: Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
hi:tobias wrote: ↑Fri May 15, 2020 8:22 am In the motors_def_cf2.c there are configurations for this.So in platform_cf2.c you should change the motor map.Code: Select all
/** * Brushless motors mapped to the standard motor connectors with pull-ups (~1K) to VBAT soldered. */ const MotorPerifDef* motorMapDefaltConBrushless[NBR_OF_MOTORS] = { &CONN_M1_BL_INV, &CONN_M2_BL_INV, &CONN_M3_BL_INV, &CONN_M4_BL_INV };
Hopefully this works out of the box. Remember you have to solder pull-ups (~1k) to VBAT.Code: Select all
{ .deviceType = "CF20", .deviceTypeName = "Crazyflie 2.0", .sensorImplementation = SensorImplementation_mpu9250_lps25h, .physicalLayoutAntennasAreClose = true, .motorMap = motorMapDefaltConBrushless, },
Here i have get the method above tested. "MotorMap equals to 'motorMapDefaltConBrushless' and project codes are biuld with no error lists.However it comes with one problem while flashing hex files into the CF2.0 through J-link,as picture shows: Those ‘zeros’ are strange, does it mean oversize of the program?
By the way ,my vm is up to date and if i config back to "default brushed motor"、biuld the project 、get hex file flashed, no error occurs with flashing. Did i miss anything somewhere?
Re: Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
I tested building a cload build and flash it with the wireless bootloader and it works for me. I don't see how that change would effect anything other then a pointer value.
Re: Crazyflie2.0 PWM setup to drive BRUSHLESS MOTOR
Yes,i referred to help docs in vm and tried (a similar way of yours ) to use ST-link to flash direct in local terminal. Finally it works and system log shows "use brushless motor "like words. Thanks very much for your guidance.