Atmega328 with fet output for motor brushed
Re: Atmega328 with fet output for motor brushed
Thanks for the explanation.
Re: Atmega328 with fet output for motor brushed
Hi, I just wanted to post that there sellers online that sell motor drivers, specifically for this purpose See http://www.pial.net/store/.
Hobbyking has multiwii boards with integrated brushed moror drivers, needs a dsm2 compatible transmitter. See http://www.hobbyking.com/hobbyking/store/__42255__Micro_MWC_Flight_Control_Board_DSM2_ESC_39_s_X4_Brushed_Integrated.html. It can provide up to 2a in 1s attery.
I am not in anyway affiliated with any of these sellers. I just wanted to point people in this thread because i thought it might interest them.
Hobbyking has multiwii boards with integrated brushed moror drivers, needs a dsm2 compatible transmitter. See http://www.hobbyking.com/hobbyking/store/__42255__Micro_MWC_Flight_Control_Board_DSM2_ESC_39_s_X4_Brushed_Integrated.html. It can provide up to 2a in 1s attery.
I am not in anyway affiliated with any of these sellers. I just wanted to point people in this thread because i thought it might interest them.
Re: Atmega328 with fet output for motor brushed
Thanks for the schematic goebish. I think I am starting to understand. So I need a mosfet a resistor and a diode that goes across the motor terminals. Now to find the correct parts and sources for the parts
Thanks rgotera for the info. That DSM2 integrated board looks interesting.
Thanks rgotera for the info. That DSM2 integrated board looks interesting.
Re: Atmega328 with fet output for motor brushed
Hi all,
I'm starting to build a microquad and I've a question:
I will use a Pro mini 328 processor, can I use a "normal" 4 channels Rx instead of DSM2 Sat Rx?
Then, may I use MWii 2.3 "official" code (of course after setting it up with config.h)?
With official MWii 2.3 code, how will be the output freq. to fet/motors?
Thanks
Carlo
I'm starting to build a microquad and I've a question:
I will use a Pro mini 328 processor, can I use a "normal" 4 channels Rx instead of DSM2 Sat Rx?
Then, may I use MWii 2.3 "official" code (of course after setting it up with config.h)?
With official MWii 2.3 code, how will be the output freq. to fet/motors?
Thanks
Carlo
Re: Atmega328 with fet output for motor brushed
The 328 isnt any good for DSM2 Sat Rx anyway. The micro MWC uses dsm2 PPM-SUM. You may use your 4 "normal" channels instead.
Newest 2.3 "official dev" version does it
Search config.h to set motor pwm frequency.
Newest 2.3 "official dev" version does it
Search config.h to set motor pwm frequency.
Re: Atmega328 with fet output for motor brushed
Plüschi wrote:The 328 isnt any good for DSM2 Sat Rx anyway. The micro MWC uses dsm2 PPM-SUM. You may use your 4 "normal" channels instead.
Newest 2.3 "official dev" version does it
Search config.h to set motor pwm frequency.
Tanks Pluschi,
Yes, I know that Micro MWC uses dsm2 PPM-SUM, infact i asked for a confirmation about using a 4 "normal" RX as I don't have a dsm2 RX
But in config.h MWii vers. 2.3 I haven't seen the motor output freq setup...
I will look better
Cheers
carlo
Re: Atmega328 with fet output for motor brushed
Dev version r1648 is here:
https://code.google.com/p/multiwii/down ... p&can=2&q=
https://code.google.com/p/multiwii/down ... p&can=2&q=
-
- Posts: 244
- Joined: Sat Mar 23, 2013 12:34 am
- Location: Australia
Re: Atmega328 with fet output for motor brushed
Plüschi wrote:- 10k to 20k gate resistance on your fet design is a little bit much.
- 328 is limited to 4 outputs. Except you throw out arduino timing and use timer 0 for pwm.
- 32u4 does have more. I dont know exact numbers. While the chip spec is good, real life is not. Some of the OCXXX are not available on pins, and some are combined. Maybe 6 outputs are possible, but not 8. You will have to research that yourself. Count the OCxx except the OC0x ones in the atmega32u4.pdf
Hi Plüschi!
I don't see any comments beside the config.h in current build stating what the limitations are. So am I correct in understanding that any of the higher EXT_MOTOR_xKHz defines won't work on a hex quad utilising 328p? So just stick with the EXT_MOTOR_RANGE. Also, EXT_MOTOR_RANGE is mutually exclusive with the other EXT_MOTOR_xKHz defines?
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Atmega328 with fet output for motor brushed
felixrising wrote:Plüschi wrote:- 10k to 20k gate resistance on your fet design is a little bit much.
- 328 is limited to 4 outputs. Except you throw out arduino timing and use timer 0 for pwm.
- 32u4 does have more. I dont know exact numbers. While the chip spec is good, real life is not. Some of the OCXXX are not available on pins, and some are combined. Maybe 6 outputs are possible, but not 8. You will have to research that yourself. Count the OCxx except the OC0x ones in the atmega32u4.pdf
Hi Plüschi!
I don't see any comments beside the config.h in current build stating what the limitations are. So am I correct in understanding that any of the higher EXT_MOTOR_xKHz defines won't work on a hex quad utilising 328p? So just stick with the EXT_MOTOR_RANGE. Also, EXT_MOTOR_RANGE is mutually exclusive with the other EXT_MOTOR_xKHz defines?
Hi,
On 328p,
EXT_MOTOR_xKHz is valid only for 4 motors.
EXT_MOTOR_RANGE can also be used for 4 motors, but EXT_MOTOR_xKHz will give a better result (less noise ans higher PID for me)
Currently you can use EXT_MOTOR_RANGE for 6 motors (mutually exclusive with the other EXT_MOTOR_xKHz)
exemple here:
http://www.youtube.com/watch?v=NqVz4Bve4ko
I even made a version for 8 brushed motors on a 328p if you want to test (no code for the moment in any repository)
http://www.youtube.com/watch?v=a8sVT7EBh58
Re: Atmega328 with fet output for motor brushed
Thanks Alex.
I'll have a look to see if it's possible to have EXT_MOTOR_xKHz for 6 motors on the 32u4.
I'll have a look to see if it's possible to have EXT_MOTOR_xKHz for 6 motors on the 32u4.
-
- Posts: 4
- Joined: Fri Feb 07, 2014 2:55 am
Re: atmega32u4 with fet output for motor brushed
I'm currently trying to use EXT_MOTOR_8KHz for 6 motors on the 32u4. I've had a look at the code, but can't seem to get it right. I've added the following to output.cpp
But still can't seem to get motors/fets 5 and 6 on pin 11 and 13 to work. Maybe someone has had success with 6 motors using EXT_MOTOR_xKHz, and would be willing to point me in the right direction?
Code: Select all
#if (NUMBER_MOTOR > 4)
#if defined(EXT_MOTOR_8KHZ)
OCR1C = (motor[4]-1000) << 1;
TC4H = (motor[5]-1000) << 1; // pin 13
...
But still can't seem to get motors/fets 5 and 6 on pin 11 and 13 to work. Maybe someone has had success with 6 motors using EXT_MOTOR_xKHz, and would be willing to point me in the right direction?
Re: Atmega328 with fet output for motor brushed
I'm also quite interested in a brushed FC for Hexa- and Octocopters. I think using an STM32 based design will provide 8 Hardware PWM motor outputs out of the box. Even there is the Baseflight and Cleanflight firmware already available wich already works. I’m flying already an Hexacopter with such a configuration and have a Octocopter on my bench. Soldering two cables directly to the controller pins fro the Octocopter is actually challenging me. I already killed the first controller in my soldering trials. Please see my posts here:
viewtopic.php?f=12&t=4893#p53226
Baseflight and Cleanflight is also ported to this brushed CJMCU controller. The schematics is also available in this tread:
viewtopic.php?f=22&t=5177
Actually I’m thinking about combining all components used for my Hexa and Quadcopter into a single board with 8 brused ESC’s 6A as a winter project. Already checked with Deltang and David could provide preprogrammed Rx31 receiver chips to integrate at the FC. Another solution could to use cheap spectrum sats like the AlienWii controller is doing or using external mini sumPPM RX like the various available Deltang receivers.
viewtopic.php?f=12&t=4893#p53226
Baseflight and Cleanflight is also ported to this brushed CJMCU controller. The schematics is also available in this tread:
viewtopic.php?f=22&t=5177
Actually I’m thinking about combining all components used for my Hexa and Quadcopter into a single board with 8 brused ESC’s 6A as a winter project. Already checked with Deltang and David could provide preprogrammed Rx31 receiver chips to integrate at the FC. Another solution could to use cheap spectrum sats like the AlienWii controller is doing or using external mini sumPPM RX like the various available Deltang receivers.
-
- Posts: 4
- Joined: Fri Feb 07, 2014 2:55 am
Re: atmega32u4 with fet output for motor brushed
I see what was missing. Forgot to connect the pins to the timers (in case anyone else is interested).
pins 11 and 13 and related motors are working now.
Code: Select all
TCCR1A |= _BV(COM1C1); // connect pin 11 to timer 1 channel C
TCCR4A |= (1<<COM4A1)|(1<<PWM4A); // connect pin 13 to timer 4 channel A
pins 11 and 13 and related motors are working now.
Re: Atmega328 with fet output for motor brushed
@alienquads
What FC you are actually using for a brushed hexacopter?
What FC you are actually using for a brushed hexacopter?
-
- Posts: 4
- Joined: Fri Feb 07, 2014 2:55 am
Re: Atmega328 with fet output for motor brushed
@mj666
I am using a prototype board featuring an "atmega32u4" so your baseflight/cleanflight suggestions are not compatible.
I do have the hexacopter setup working with multiwii on EXT_MOTOR_8KHz. However, I do not think my code is quite right for the two additional motor pins as the hexacopter tends to drift quite a bit. With no other changes the hexacopter doesn't drift using 490Hz EXT_MOTOR_RANGE. However I don't want to run 490Hz for several reasons.
I am using a prototype board featuring an "atmega32u4" so your baseflight/cleanflight suggestions are not compatible.
I do have the hexacopter setup working with multiwii on EXT_MOTOR_8KHz. However, I do not think my code is quite right for the two additional motor pins as the hexacopter tends to drift quite a bit. With no other changes the hexacopter doesn't drift using 490Hz EXT_MOTOR_RANGE. However I don't want to run 490Hz for several reasons.
-
- Posts: 4
- Joined: Fri Feb 07, 2014 2:55 am
Re: atmega32u4 with fet output for motor brushed
I've finally managed to get my brushed 32u4 hexacopter to fly fairly well.
For anyone else who might be interested in trying an 32u4 brushed hexacopter, here is the EXT_MOTOR_8KHz code I am using in output.cpp.
I'd really appreciate if one of the devs could take a peek to see if the PWM timers look correct.
I also needed to change the motor pin order for PROMICRO as follows to make this work.
And add the following code to connect the pins to the timers:
For anyone else who might be interested in trying an 32u4 brushed hexacopter, here is the EXT_MOTOR_8KHz code I am using in output.cpp.
Code: Select all
#if defined (EXT_MOTOR_8KHZ)
OCR1A = (motor[0] - 1000) << 1; // pin 9
OCR1B = (motor[1] - 1000) << 1; // pin 10
OCR3A = (motor[2] - 1000) << 1; // pin 5
TC4H = (motor[3] - 1000)>>8; OCR4D = ((((motor[3]-1000)<<1))&0xFF); // pin 6
OCR1C = (motor[4] - 1000) << 1; // pin 11
TC4H = (motor[5] - 1000)>>8; OCR4A = ((((motor[5]-1000)<<1))&0xFF); // pin 13
#endif
I'd really appreciate if one of the devs could take a peek to see if the PWM timers look correct.
I also needed to change the motor pin order for PROMICRO as follows to make this work.
Code: Select all
//uint8_t PWM_PIN[8] = {9,10,5,6,4,A2,SW_PWM_P3,SW_PWM_P4}; //for a quad+: rear,right,left,front
uint8_t PWM_PIN[8] = {9,10,5,6,11,13};
And add the following code to connect the pins to the timers:
Code: Select all
TCCR1A |= _BV(COM1C1); // connect pin 11 to timer 1 channel C
TCCR4A |= (1<<COM4A1)|(1<<PWM4A); // connect pin 13 to timer 4 channel A
Re: Atmega328 with fet output for motor brushed
i´m a little confused. is it possible to run 6 brushed motors on 328? if yes, would someone share his mwii sketch? i have build a nano spider hex with a pro mini
Re: Atmega328 with fet output for motor brushed
Sandrail wrote:i´m a little confused. is it possible to run 6 brushed motors on 328? if yes, would someone share his mwii sketch? i have build a nano spider hex with a pro mini
I'm also confused and would like to know too
My project is to use a Mini MWC board (328p from HK with DSM rx) to control the built-in brushed ESCs of another FC board (Revell Hexatron, 6X, 2S).
I'm actually a bit lost. This is what I did :
Soldered 1pin cables to the G leg of the 9926B MOSFETS (http://aosmd.com/pdfs/datasheet/AO9926B.pdf).
Flashed the Mini MWC with 2.4.
Uncommented #define MINTHROTTLE 1050 // for brushed ESCs like ladybird
Uncommented and tried different values for #define EXT_MOTOR_xxKHZ
But I'm still getting nothing from the motors. The best I have is the motor buzzing with #define EXT_MOTOR_1KHZ
Also tested with the short made between the husban chip and the resistors before the Mosfet.
Dumb question because I'm new to MultiWii really: although I tested all ports on the FC, is it right to assume the motors number shown in the GUI match the numbers on the board?
I'm not sure what to do next and where to look at. I'm definitely lacking knowledge. I'm posting a pic of the Hexatron board on which I followed (unless wrong ) all the mosfets traces to the Husban chip which seems to handle everything.
Maybe cut all the traces feeding the husban chip? Any suggestion is welcome
I'd like to have at least have one motor run first before trying to have the Mini MWC run all 6 motors/ESCs which I believe according to a previous post is not yet possible with the current code.
Thank you!
Re: Atmega328 with fet output for motor brushed
Sandrail wrote:i´m a little confused. is it possible to run 6 brushed motors on 328? if yes, would someone share his mwii sketch? i have build a nano spider hex with a pro mini
Yes it should be possible. Since i have no hexa i cant test it.
It should be easy if you use 1khz pwm.
You dont have to change much, just connect the 2 timer0 pwm outputs and write the values into the compare regs. Output pins will be pin5 and pin6.
See attached sketch. You "should" be able to fly it, let ext_pwm be 1khz, and use ppmsum receiver.
- Attachments
-
- MultiWii_2_2_micro_328.zip
- (22.55 KiB) Downloaded 458 times
-
- Posts: 9
- Joined: Mon Jul 28, 2014 10:28 am
Re: Atmega328 with fet output for motor brushed
Hi
I built a brushed quadcopter with multiwii 2.3 and si2302 fet. Somebody tell me What I have to do for ESC's step by step???? when I arm it the motors spin and I can't stop it?With radio control They work same(%50 and up).how can I change pwm output to 0 to 2000 in MWC 2.3 ???What part of source code should be change???
Please answer if you know.
Thanks alot.
I built a brushed quadcopter with multiwii 2.3 and si2302 fet. Somebody tell me What I have to do for ESC's step by step???? when I arm it the motors spin and I can't stop it?With radio control They work same(%50 and up).how can I change pwm output to 0 to 2000 in MWC 2.3 ???What part of source code should be change???
Please answer if you know.
Thanks alot.