CJMCU microquad board

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

@plüschi. You are correct all serial RX parts are removed for the CJMCU target. Since there is enough space in the flash and we sorted out all other problems we can add this back. We also can enable in addition 6 channels for standard receivers. If you only want to compile the source code you don’t need to setup the whole Eclipse environment. The tool chain can be used from command line (looks to be you find this out already). If you like I also can help you to setup Eclipse. It’s not very complicated and you can send me a PM for help.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

Speksat is working. To re-enable it:

in main.c, line 143, remove the #ifndef CJMCU + #endif
in mw.c, line 463, remove the #ifndef CJMCU + #endif
in drv_pwm.c, line 72, expand the #ifdef CJMCU to include multiPPM[] AND multiPWM[], this is already DONE in newest baseflight.

Connect speksat to 3.3V, GND, PA3, 5V will fry the sat, you have to run the vcc cable across the board.
Sbus and Sumd should also work.

@mj666 nice little receiver you have. Is that a ppmsum lemonrx or what is it?

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

This is a Deltang Rx31-Sum.

http://www.deltang.co.uk/

I only loosing the antenna very easily and need to resolder a new one. I use them also for my other NanoCopter projects.

viewtopic.php?f=12&t=4893&p=53317#p53317

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

mj666 wrote:This is a Deltang Rx31-Sum.


Pricey. My lemonrx dsm2-sat is $5. But its double the size fo yours.

2 of my motors dont work. Latest git version. Any idea?

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

For me all motors worked imediately. You even can run each motor individualy from the Baseflight Chrome app. I have a similar board with AVR328 wich alredy has a burned FET. I have not seen any specific reason for this. The motor stopped working during normal flight. First i was thinking the motor was going bad but it is still working. I hope this will not be the case for you.
Last edited by mj666 on Tue Jul 29, 2014 10:58 am, edited 1 time in total.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

I messed this up myself because with PPMSUM -> all 4 motors working, with SPEKSAT -> only 2 motors working. But i have no idea WHAT i did mess up.

Do you have a scope? Measure the gate signal of the FET. The gate resistance is so bit there is only a sawtooth left at the gate at 32khz (or my scope has a low impedance). This is not healthy, i propose a way lower pwm frequency (4 or 8 khz) OR change the gate resistors. Any thoughts?


EDIT:
With gentle help from TC himself now ALL 4 motors work in SpekSat config.
Culprit was in drv_pwm.c

Code: Select all

// skip UART ports for GPS
if (init->useUART && (port == PWM3 || port == PWM4)) continue;

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

Locks to be there is a bit more work to finally implement the CJMCU target. May be it is time to add the possible receiver PWM channels back. This should also solve the problem you have with PWM3 and PWM4. I would recommend the following changes for the timer layout and CJMCU target. This will also allow a 6 channel standard receiver at (PA0, PA1, PA2, PA3, PA8, PA11).

drv_timer.c

Code: Select all

#ifdef CJMCU
const timerHardware_t timerHardware[] = {
    { TIM2, GPIOA, Pin_0, TIM_Channel_1, TIM2_IRQn, 0, },          // PWM1
    { TIM2, GPIOA, Pin_1, TIM_Channel_2, TIM2_IRQn, 0, },          // PWM2
    { TIM2, GPIOA, Pin_2, TIM_Channel_3, TIM2_IRQn, 0, },          // PWM3
    { TIM2, GPIOA, Pin_3, TIM_Channel_4, TIM2_IRQn, 0, },          // PWM4
    { TIM1, GPIOA, Pin_8, TIM_Channel_1, TIM1_CC_IRQn, 1, },       // PWM5
    { TIM1, GPIOA, Pin_11, TIM_Channel_4, TIM1_CC_IRQn, 1, },      // PWM6
    { TIM3, GPIOB, Pin_0, TIM_Channel_3, TIM3_IRQn, 0, },          // PWM7
    { TIM4, GPIOB, Pin_9, TIM_Channel_4, TIM4_IRQn, 0, },          // PWM8
    { TIM3, GPIOB, Pin_1, TIM_Channel_4, TIM3_IRQn, 0, },          // PWM9
    { TIM4, GPIOB, Pin_8, TIM_Channel_3, TIM4_IRQn, 0, },          // PWM10
};
#else


drv_pwm.c

Code: Select all

#ifdef CJMCU
static const uint8_t multiPPM[] = {
    PWM1 | TYPE_IP,     // PPM input
    PWM7 | TYPE_M,
    PWM8 | TYPE_M,
    PWM9 | TYPE_M,
    PWM10 | TYPE_M,
    0xFF
};

static const uint8_t multiPWM[] = {
    PWM1 | TYPE_IP,     // PWM input
    PWM2 | TYPE_IP,
    PWM3 | TYPE_IP,
    PWM4 | TYPE_IP,
    PWM5 | TYPE_IP,
    PWM6 | TYPE_IP,
    PWM7 | TYPE_M,
    PWM8 | TYPE_M,
    PWM9 | TYPE_M,
    PWM10 | TYPE_M,
    0xFF
};
#else


May be an even more clean option would be to remove the CJMCU specific section in drv_timer.c. and do the complete mapping as following:

Code: Select all

#ifdef CJMCU
static const uint8_t multiPPM[] = {
    PWM1 | TYPE_IP,     // PPM input
    PWM7 | TYPE_M,
    PWM14 | TYPE_M,
    PWM8 | TYPE_M,
    PWM13 | TYPE_M,
    0xFF
};

static const uint8_t multiPWM[] = {
    PWM1 | TYPE_IP,     // PWM input
    PWM2 | TYPE_IP,
    PWM3 | TYPE_IP,
    PWM4 | TYPE_IP,
    PWM9 | TYPE_IP,
    PWM10 | TYPE_IP,
    PWM7 | TYPE_M,
    PWM14 | TYPE_M,
    PWM8 | TYPE_M,
    PWM13 | TYPE_M,
    0xFF
};
#else


This will leave the timer channel specific code in drv_pwm.c completely unaffected and we are also able to reactivate the Serial RX code.

I don't have a scope to check signals. With the Micro MWC i also use 32kHz and have no problems there but I have replaced the FET's with 6A versions. Looks to be they are using a resistor between the gate and ground. The output is directly connected to the gate. There are empty soldering pads at the backside, likely planned for a capacitor and a diode for each motor output. This configuration is working since quite a while and the only burned FET came from a motor with shorted brushes.
The brushed ESC's from pial.net (used in my other project) are using two resistors, one (10kOhm) between ground and the gate, one (220Ohm) between output and the gate and a schotky diode (at the motor connectors). I also run this with 32kHz with no problems so far.
The AVR328 CJMCU is using two resistors (don't remember the specs) similar like the pial.net ESC's and an capacitor at the motor connector. This is the one I have a dead FET without seeing the reason (also no magic smoke, and no visual damage).
The CJMCU is using 20kOhm between the output and the gate. For me the 32kHz working well and motors a bit warm but FET's don't get warm at all. You can try with lowering the frequency and see if this will change the signals. Dis you measure the signal directly at the motor already. It this also like a sawtooth. In the case the FET's should getting hot? The used FET's are designed to have a switching characteristic.
Looks to be there many different ways how to drive the brushed motors.:-)

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

Have you changed the "pwm_params.idlePulse = PULSE_1MS;" or changed the main.c init sequence so the motors wont start when plugging in the batt ?

The gate resistor is in between stm32 pin and fet gate. Depending on the capacitive load of the fet 20kohm does distort the signal quite a bit at 32khz.

The bad news is, speksat aint an option. As soon as the motors spin and VCC gets shaky the speksat goes reset. Speksat needs 3.3V minimum.
I will try the Graupner SUMD next.


Edit:
Sucess ! Second CJMCU STM32 quad in in the air.
With SUMD it flies really nicely, soft and stable. Acro mode, i have no switch defined yet.
Telemetry says the voltage on the 5V rail while hoovering is below 3.0V. Graupner/SJ is expensive, but nice :)

BTW im using red-blue motors, i dont have any black-white ones (CW / CCW). Anyone knows a CHEAP (less $1 / motor) source of both CW and CCW motors, 7mm dia, 1mm axle ?

Image

Motors are fixed with a rubber band pinched between motor and frame

Image

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

Congratulations. Nice yours is now also working. I have fixed my motors with wrapping a few layers of tesa film before sticking them into the holes. I also don’t like to solder them. I watched my receiver more carefully and I can see there are also brownouts (2 flashes). There may be two options.

1. Connect receiver to the stabilized 3.3V supply.
2. Try to buffer voltage with an additional capacitor

Anyhow I cannot see any issues in flight behavior yet and there will be no brownout with a fresh battery. I'm using CL-0720-12 Motors from Micro Motor Warehouse (a bit more expensive than one dollar).

Edit: 1000µF will not remove the brownout completely. If all of the motors are running full speed for a few seconds and an battery is already used for about 3-4 minutes the brownout is back. For now I’m using 360mAh 25C batteries. May be stronger batteries are needed. I may try with 750mAm but I was not so impressed with such combination in my self-made NanoQuad's.

viewtopic.php?f=12&t=4893#p50846

It also looks to be the MAG orientation is still not correct with the following setting:

set align_mag = 3

From all information about the NAZE it looks to be the MAG is turned by 180 degrees for the CJMCU. Anyhow the output in the GUI looks still not correct.

Tomorrow I will do some more flight test at the open flying field and see how the CJMCU will perform.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: CJMCU microquad board

Post by timecop »

If the board was done properly, they should have used a buckboost for 3.3V supply, so even with lipo current droop, it would still result in clean 3V for sensors/mcu/etc. o well.. at the price these are going, its not worth making my own version with "proper" design.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

Nice frames you make mj666. Beautiful. But 750mah lipo? Heavy...

I dont think a cap solves the issue. A low-drop diode and then a cap in the processor / reciever vcc solves it, but has an additional drop of 0.3V.
It seems a TI2500 based receiver and the STM32 CAN go without buckboost, but a stable 3.3V would be safer, and allow a speksat, which is pretty attractive in functionality for the $5 it costs.

A point i dont like with the CJMCU are the short arms. The ladybird props are too big. I did try 716 motors, they lack power, but 720 motors work fine. I do like the on-off switch. So much easier than plugging in the lipo each start. The onboard charger works BUT i think it charges way more than 1C rate.

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

I double checked my self-made NanoHexa. The electronics is quite similar. Using a 950mAh battery and CL-0820-15 motors I cannot see any brownouts. But here the ESC’s have a separate direct connection to the battery. The AfroMini32 with receiver is also separately connected to the battery. Anyhow it looks to be the receiver and remaining electronics in the CJMCU is not realy affected by the low voltage but this could not be good for the battery to go below 3V. I hope some reasonable part of the voltage drop is coming from resistance of the VCC board wiring (which is very tiny at some places). The ground wiring looks to be in a better shape. May be a bypass witch stronger wires from the power switch (VCC) to the receiver power pin will help.

I tried indoor with the 750mAh battery and this looks not bad after the experience in my other NanoQuad build. I need to verify the performance at the open flying field. Unfortunately it’s raining here today so I may need to wait a while.

Interestingly the CJMCU is only 2 grams lighter (46g including the large battery) than my NanoQuad 7mm motor build but performance looks different (better). I would not expect this small difference in weight and the NanoQuad is still using the more heavy prototype frame. The new frame would reduce the weight by 4g and the NanoQuad would be even 2g lighter than the CJMCY.

An STM based NanoCopter FC (NAZE32 compatible) with integrated receiver and the option to have 8 brushed ESC’s would be realy nice. There could be 4, 6, 8 ESC variants with the same layout. But I think the few additional components will not make a big difference in price so a single 8 ESC version would be also ok. @timecop may be a new maket for you?

The HK Nano MWC (only useful for quads) is quite often sold out and hard to get. My last shipment of micro MWC’s is lost somewhere and I wait now for more than 2 month. I now need to wait another 30 days for the investigation of the parcel before I get the reimbursement. I’m a bit reluctant to order again in the international warehouse since standard delivery time is also 4-6 weeks.
Attachments
CJMCU3.jpg

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

i'll port the support for the CJMCU to cleanflight soon, if anyone's interested cleanflight now also supports the CC3D board - see the cleanflight thread for more details. Feel free to back-port the changes to baseflight.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: CJMCU microquad board

Post by timecop »

dominicclifton wrote:i'll port the support for the CJMCU to cleanflight soon, if anyone's interested cleanflight now also supports the CC3D board - see the cleanflight thread for more details. Feel free to back-port the changes to baseflight.


I'm pretty sure you that nobody is interested in your jobless java changes.
You can keep you javaflight spam to your own thread.

Keep in mind, all CJMCU contributions that you have viewed up to now are licensed under modified Dominic Clifton Is a Jobless Fuck (DCLJF) license, and as such, you are not allowed to use them with clean/javaflight. (For everyone else, they're GPL3).

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: CJMCU microquad board

Post by brm »

timecop wrote:
dominicclifton wrote:i'll port the support for the CJMCU to cleanflight soon, if anyone's interested cleanflight now also supports the CC3D board - see the cleanflight thread for more details. Feel free to back-port the changes to baseflight.


I'm pretty sure you that nobody is interested in your jobless java changes.
You can keep you javaflight spam to your own thread.

Keep in mind, all CJMCU contributions that you have viewed up to now are licensed under modified Dominic Clifton Is a Jobless Fuck (DCLJF) license, and as such, you are not allowed to use them with clean/javaflight. (For everyone else, they're GPL3).


lets talk about hw.
what about the mpu-6500?

less bias issues...

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: CJMCU microquad board

Post by timecop »

I dunno, are there any breakouts for it? I have some junk in queue with MPU6500 and LSM303D but no time, as usual...

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: CJMCU microquad board

Post by brm »

timecop wrote:I dunno, are there any breakouts for it? I have some junk in queue with MPU6500 and LSM303D but no time, as usual...


aha, if the mpu-6500 stuff pops out of the queue send it pls.
i am prepping my gimbal copter with flyingf3 ... the acc device is nice ...

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: CJMCU microquad board

Post by Crashpilot1000 »

timecop wrote:I'm pretty sure you that nobody is interested in your jobless java changes.
You can keep you javaflight spam to your own thread.

Keep in mind, all CJMCU contributions that you have viewed up to now are licensed under modified Dominic Clifton Is a Jobless Fuck (DCLJF) license, and as such, you are not allowed to use them with clean/javaflight. (For everyone else, they're GPL3).


Haha, that is so low. Maybe you could have the FBI to enforce YOUR license http://www.gossamer-threads.com/lists/f ... sure/74892. BTW: Did you ever visit your GNAA (http://en.wikipedia.org/wiki/Gay_Nigger ... of_America) friend WEEV in prison (https://twitter.com/rogerclark/status/3 ... 1005759489)?

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

Today I have done some more testing. The CJMCU is performing better than my NanoQuad build with 7mm Motors. Does the FC make this difference? But the same FC (and Frame) is running very well with 8.5mm motors. The weight is not much different. I also was flying with the 750mAm battery. For both batteries brownouts will come after 3-4 minutes of flying. Flying with my NanoHexa and there are no brownouts at all (more than 7min flying). I really looks to be a problem of the weak wiring of the power supply of the CJMCU board.

BTW: Nice to see you all here in this tread. I just wondering what happens and why we cannot work all together to improve the 32 bit FC software an may develop some nice new hardware. In general we should have similar goals and like to enjoy this nice hobby. This is just a thought. May be the real live is not that easy. ;)

Attached you can find the latest patch for Baseflight and the CJMCU target:

- Adjust timer layout to allow 6 channel standard RX at (PA0, PA1, PA2, PA3, PA8, PA11)
- reenable SerialRX
- fix warning for CJMCU build

This changes are flight tested. I think i need to get some help to make a proper pull request via Git. :)
Attachments
baseflight.zip
(1.6 KiB) Downloaded 364 times

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

thanks MJ666. I did a bit of work on cleanflight today to support this target. Specifically the GPS conditional compile (excluded more code than in baseflight) and the I2C support. I'll hopefully be able to give you guys a binary to test soon. Cleanflight has an additonal pid controller which you may want to test on this board.

Just wondering if you have links to the motors and batteries you're using?

this links might help with regards to git/pull requests

https://help.github.com/articles/creati ... ll-request

https://help.github.com/articles/using-pull-requests

basically, from your github account fork the project, then clone it using git. then make a new branch. then make changes and commit them. then push the new branch to your forked repo. then create a pull request.

it's not that hard and there is lots of help out there and it really helps out your fellow developers when it comes to sharing and collaboration.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: CJMCU microquad board

Post by timecop »

mj666 wrote:Attached you can find the latest patch for Baseflight and the CJMCU target:

- Adjust timer layout to allow 6 channel standard RX at (PA0, PA1, PA2, PA3, PA8, PA11)
- reenable SerialRX
- fix warning for CJMCU build

This changes are flight tested. I think i need to get some help to make a proper pull request via Git. :)


Code: Select all

+    PWM1 | TYPE_IP,     // PWM input
+    PWM2 | TYPE_IP,
+    PWM3 | TYPE_IP,
+    PWM4 | TYPE_IP,
+    PWM9 | TYPE_IP,
+    PWM10 | TYPE_IP,
+    PWM7 | TYPE_M,
+    PWM14 | TYPE_M,
+    PWM8 | TYPE_M,
+    PWM13 | TYPE_M,


I'm not sure the multippm/pwm maps are correct - and I don't see changes to drv_timer that actualyl adds those maps, either.
TYPE_IP is for PPM input, and there should only be one of them. TYPE_IW is for the PWM input, which is what your multiPWM should be using.
I dont remember what the code does, but attaching PPM handler to 6 inputs is probably not a good idea.

Crashpilot1000 - lolwut? Not even gonna bother replying, please try to make sense or stay on topic of this thread. Right now you're failing both things.
unemployedclifton - i still have you on ignore on the forum, and don't feel like clicking "show this rant anyway" button.

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

@timecop, you are correct it should be TYPE_IW. I added the latest HEX and updated the patch. I also test build the other two targets in my environment (GNU tool chain). NAZE will build with a few warnings but OLIMEXINO will fail to build. This looks to be caused by the removal of the LED's for this target in combination of the absence of BUZZER and/or INVERTER.

The motors I’m using are CL-0720-12 from Micro Motor Warehouse without the plugs:

http://micro-motor-warehouse.com/collec ... cl-0720-12

Batteries are.

360mAh:
http://www.crossdata-tools.de/nanoheli/ ... b90bfffd85

or the Turnigy Nanotech 750mAh but you get both types also from other vendors also.
Attachments
baseflight_CJMCU.zip
(59.27 KiB) Downloaded 369 times
baseflight.zip
(1.6 KiB) Downloaded 348 times

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

I use banggood motors and props, and 240mah UDI lipos ($12 for 5).

Props (a little too big for the CJMCU):
http://www.banggood.com/Wholesale-3-Set ... 47127.html

Motors (way cheaper than in the aussie shop, excellent quality, 1mm shaft):
http://www.banggood.com/Wholesale-2-X-7 ... 63727.html

Lipo (Jesolins recommends them in the pocketquad thread):
http://www.banggood.com/Wholesale-5-X-U ... 63732.html

Receiver is the Graupner GR-12SH+
The esc freq is 8khz.
The 1.5 year old lipo, sagging to 2.8V at first, did recover and keeps a good 3.2V under load now.

This is with 0.20 rate, low P, no expo for improved agility:
http://youtu.be/zBga9OEQLDQ

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

timecop wrote:unemployedclifton - i still have you on ignore on the forum, and don't feel like clicking "show this rant anyway" button.


LMFAO, clearly TC's stalking skills are not up to scratch :D

Plüschi wrote:I use banggood motors and props, and 240mah UDI lipos ($12 for 5).

mj666 wrote:The motors I’m using are CL-0720-12 from Micro Motor Warehouse without the plugs, Batteries are 360mAh or the Turnigy Nanotech 750mAh but you get both types also from other vendors also.


thanks for the info guys, i'll order up some stuff this weekend.

I've been working on the CJMCU support in cleanflight, a couple more tweaks and it should fit on the flash. You can see the progress here:

https://github.com/hydra/cleanflight/commits/cjmcu

tomm
Posts: 3
Joined: Mon Jul 07, 2014 7:12 pm

Re: CJMCU microquad board

Post by tomm »

hi mj666 / plüschi,
where did you get your board? i only can find that one on aliexpress http://www.aliexpress.com/item/FREE-SHIPPING-CJMCU-miniature-four-axis-flight-control-nine-axis-module-STM32-MPU6050-HMC5883L/1942686853.html.
but the picture there is showing a naked board.
thanks

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »


User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

From GLB too here.

2 months for delivery. Seems the parcel was lost in the mail, i complained, and they sent me another one. They never told me "we send replacemnt", but the parcel sure didnt look like it was 2 months in china mail. It wasnt ripped open, smashed or smeared in grease at all.

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

Hi guys, I've made the changes to support the CJMCU board in cleanflight, since I don't have a board yet I've been going with what has been discussed in this thread, if someone wants to give it a try that'd be awesome.

grab the cleanflight code from here:

https://github.com/hydra/cleanflight

build with:

Code: Select all

make TARGET=CJMCU


binary gets built as obj/cleanflight_CJMCU.hex

If there's any cleanflight specific issues please raise them in the issue tracker here:

https://github.com/hydra/cleanflight/issues

binary attached

(note, it's 63992 bytes and since the last 2k of flash is used for config storage it probably won't work on 64k variants yet, cleanflight has some additional features that could be compiled out to bring the size down a bit).

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

deleted, duplicate.
Last edited by mj666 on Mon Aug 04, 2014 10:38 am, edited 1 time in total.

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

@timecop, is there anything which holds you up to take over last changes for the CJMCU target into the Baseflight master? After this last step it should be completed and full functional.

@dominicclifton, Thanks for you efforts to support the CJMCU target in Cleanflight.

I will be busy with other things for the next 2 weeks may be after this we can start to port my I2C Sonar (SRF and Maxbotics) support done for Harakiri some time ago to baseflight and cleanflight? Please let me know if you have interest. This will provide users more options for higher quality sonar sensors.

BTW: The dynamic I2C speed switching for the Maxbotics Sonar works without any issues with Harakiri since I implemented this. The reminder of the I2C devices of our flight controllers (NAZE, MW32, Flip32+) will also work with 800Mz I2C speed. This is of spec but working well and will free up time additional time for other computing. Let me know you thoughts.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: CJMCU microquad board

Post by timecop »

OK, I committed your last patch. Unlike some people trying to waste time in this thread (hello Dominic "jobless" Clifton), I do have other things to do usually :)

Regarding i2c overspeed, I'm not very excited about it. Or I2C devices in general. I'll consider it if it doesn't add too much bloat into the code and is done without hacking other stuff.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

I did replace the 20Kohm gate resistors with 200 ohm ones. Now it lacks power, needs 75% throttle to hoover, it doesent "shoot up" like the pocketquad with the same motors / props, it "creeps up".
I have no idea if this is related to the gate resistors, or it's my lipo going bad. I did notice the "frame lost" led on the graupner receiver occasionally lights, and goes ON nearly constantly on at the end of flight.

This didnt happen before i swapped resistors. Any ideas?

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

mj666 wrote:@dominicclifton, Thanks for you efforts to support the CJMCU target in Cleanflight.


you're welcome mj666. i think the more people that test this out the better. the fact that 64k of flash is used has already driven a number of great changes that mean cleanflight and baseflight have more flashram available for larger devices. so thanks to you guys and everyone else working on this stuff.

timecop wrote:Unlike some people trying to waste time in this thread (hello Dominic "jobless" Clifton), I do have other things to do usually :)


LMFAO, do your homework TC :D

In other news I ordered a CJMCU board, batteries, motors, etc and I'm sure I will devote more time to this target when my orders arrive here! Maybe with some fancy WS2811 LED support :D

dominicclifton
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: CJMCU microquad board

Post by dominicclifton »

Ok, I did a little bit more on this and got the code size down to 63296 bytes which leaves 2k free for config so it might work on 64k CJMCU variants now.

Attached!
Attachments
cleanflight_CJMCU-98e51fb2dc81773f0fe6ea10a1b43f0a08147a58.zip
(62.92 KiB) Downloaded 353 times

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

Could someone post a CLI dump please ?

edit: nevermind, got it to fly, thanks to everyone involved :)

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

I wonder why they threw a mag at this board, it can' work because motors are too close :lol:

Romushock
Posts: 11
Joined: Fri May 30, 2014 3:55 pm

Re: CJMCU microquad board

Post by Romushock »

Hi guys. It's frustrately enought, but my quad continues to remain on the ground. I've tried both firmware, from mj666 and dominicclifton, both flash on OK, baseflight configurator see a quad,... But I can not make arming.
I've tried two receivers, spectrum AR6200 satellite connected SER to PA3 and HK SuperMicro systems http://www.hobbyking.com/hobbyking/store/__17634__2_4Ghz_SuperMicro_Systems_Receiver_and_ESC_All_in_one_5ch_.html connected CH1 to PA0, CH2 to PA1, CH3 to PA2 and CH4 to PA3, but invane.
Any idea? THKS

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

Romushock wrote:Hi guys. It's frustrately enought, but my quad continues to remain on the ground. I've tried both firmware, from mj666 and dominicclifton, both flash on OK, baseflight configurator see a quad,... But I can not make arming.
I've tried two receivers, spectrum AR6200 satellite connected SER to PA3 and HK SuperMicro systems http://www.hobbyking.com/hobbyking/store/__17634__2_4Ghz_SuperMicro_Systems_Receiver_and_ESC_All_in_one_5ch_.html connected CH1 to PA0, CH2 to PA1, CH3 to PA2 and CH4 to PA3, but invane.
Any idea? THKS


This is how I plugged a Spektrum compatible SAT, it works until battery voltage drops too much and brownout, after about 4mn with a 300mAh li-po (a 3.3V dc/dc boost regulator connected on 3.3V should be used):

Image

serial to PA3, Vcc to +3.3V and gnd to gnd...

You've to bind the sat with your TX beforehand using a full size RX or this Arduino sketch, baseflight doesn't have the code to do it.
Then you've to configure it in baseflight configurator's CLI:

Code: Select all

feature serialrx
map TAER1234
set serialrx_type = 1 (or 0 if your TX uses less than 8 channels)
save


then make sure you set travels on your TX so the channels read something like 1050-1950 in configurator receiver tab.

edit:
Here's the firmware I'm using (built from current github sources):
Attachments
baseflight_CJMCU.zip
(59.26 KiB) Downloaded 344 times
Last edited by goebish on Fri Aug 15, 2014 2:14 pm, edited 3 times in total.

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

Plüschi wrote:I did replace the 20Kohm gate resistors with 200 ohm ones. Now it lacks power, needs 75% throttle to hoover, it doesent "shoot up" like the pocketquad with the same motors / props, it "creeps up".
I have no idea if this is related to the gate resistors, or it's my lipo going bad.


I noticed that too, it has far less "punch" (I can't make it flip :() than my other micros running multiwii with the same battery / motors, I'm not sure the resistor between gate and mcu is the problem because the HK PUMQ has the same crappy driver (20k res on gate, no pull down, and no flyback diode) and it performs well with 8 Khz and 32 KHz PWM.

Maybe I should try to swap the fets with some known "good" ones ?

edit:
another difference with the PUMQ is that on this one the mcu doesn't run at 5V, maybe this make a difference to drive the fet gate with 5V or something in the 2.7-3.3V range, I'm not enough electronically inclined to answer...
Last edited by goebish on Fri Aug 15, 2014 2:24 pm, edited 1 time in total.

Romushock
Posts: 11
Joined: Fri May 30, 2014 3:55 pm

Re: CJMCU microquad board

Post by Romushock »

My experience with CLI is lower than zero... :oops: I was able to change channel map to ERTA (mode1) and save it, but can't change rx type.
Immagine.png

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

Looks like the firmware you're using doesn't have serial rx support, try to flash the one I uploaded in the previous post.
(don't forget to remove BOOT0 jumper ;))

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

The firmware i published in my post 68 schould support a 6 channel standard RX at (PA0, PA1, PA2, PA3, PA8, PA11) and also serial RX. Also if you build a recent baseflight version it should work. With cleanflight the changes for the standard RX are not yet implemented. The CJMCU target have the feature RX_PPM enabled by default and you need to enter command "feature -RX_PPM" and "save" from CLI to use a standard RX. If the standard RX still does not work there could be a bug since this config is not tested by anybody yet as far as I know.

I think the BOOT0 jumper only need to be open for the initial flash or if the flashed firmware in not working at all otherwise you can flash with the baseflight chrome configurator.
Last edited by mj666 on Fri Aug 15, 2014 5:44 pm, edited 2 times in total.

Romushock
Posts: 11
Joined: Fri May 30, 2014 3:55 pm

Re: CJMCU microquad board

Post by Romushock »

Thanks goebish, something seems to move. But... Stick positions in configurator are different from reality, and can't arming as before. Does exist some mode to calibrate Rx? Sorry for a stupid question... :oops:
Immagine 1.png

PS in dump find nothing...
Last edited by Romushock on Fri Aug 15, 2014 5:57 pm, edited 1 time in total.

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

try
map TAER1234
if it still doesn't work, try serialrx_type = 0 instead of 1.

Romushock
Posts: 11
Joined: Fri May 30, 2014 3:55 pm

Re: CJMCU microquad board

Post by Romushock »

YYEEAAAH!!! I SAW IT FLY!!! :D :D :D
A bit strange behavior - at some throttle position begin to vibrate braces. Tried 3 times, the central plate remains stationary, two braces begin to vibrate, and then added a third. Can somebody share PIDs here? Thanks a lot for a help, guys. I was hoping in the depth of me that here I will find a clever people. :lol:

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: CJMCU microquad board

Post by mj666 »

For me the CJMCU is flying well with stock PID's. Only have little wobble in some flight situation. In examle on fast stationary descent it is normal but my other quads have less of this wobble. I have changed the yaw RC rate to .85 and removed the expo. All other changes done in the CLI can be found in one of my earlier posts.

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

mj666 wrote:Interestingly there is the connector P8 which is prepared for the direct connection of an NRF24L01 wireless module as an receiver.

Cool, I might implement Flysky RX when I have a chance, so it could be used with a WLToys or moded Deviation radio.

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

mj666 wrote:It also looks to be the MAG orientation is still not correct with the following setting:

set align_mag = 3


MAG doesn't work when motors are installed, they are too close from the sensor.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: CJMCU microquad board

Post by Plüschi »

goebish wrote:I noticed that too, it has far less "punch" (I can't make it flip :() than my other micros running multiwii with the same battery / motors


Could this be because the arms are short / wide? Much of the prop downwash will end on the mainboard or on the arms.

You did connect you SAT VCC to the switch and not to the 3.3V or VCC pads. Is there more volts at the switch than at the VCC pad?

btw this in mixer.c could help power (not turning rate, but max lifting power, untested) :

Code: Select all

            //motor[i] -= maxMotor - mcfg.maxthrottle;
            motor[i] -= (maxMotor - mcfg.maxthrottle)>>1;

goebish
Posts: 23
Joined: Mon Sep 16, 2013 12:01 pm

Re: CJMCU microquad board

Post by goebish »

Sat Vcc is connected to 3.3V pad, what you think is a wire in the (bad) picture is the "2" silkscreen.

Post Reply