HobbyKing.com New Products Flash Sale
Closed Thread
Thread Tools
Old May 23, 2013, 06:30 PM
Registered User
Portland, OR, USA
Joined Mar 2010
263 Posts
I was under the impression that each coil in the motor gets a certain % of PWM duty cycle (firing off a MOSFET to send higher voltage to the coil). The ratio of the 3 levels dictate the position of the motor. So I think yes, the number of rotational steps would be limited by the bit depth of the PWM, and also the size of the LUT in the firmware that converts rotational position to the 3 PWM values.

In FW0.2 in the main.c file I see an array of floats called sinusas which has 91 elements that when graphed make 1/2 of a sine wave. Could that be what it's for?
Tom Frisch is online now Find More Posts by Tom Frisch
Sign up now
to remove ads between posts
Old May 23, 2013, 08:37 PM
Suspended Account
Joined Dec 2010
11,764 Posts
Quote:
Originally Posted by pagercam View Post
I've been trying to figure out what sort of rotational resolution a system like this can achieve using PWM. Does the PWM 0-100% represent one revolution? and does the size (bit width) of the PWM directly relate to the rotational resolution i.e. does a 12b PWM allow for control to 1/4096 of a revolution (16b -> 1/65536)? How stable is the rotation setting if the PWM setting are not updated do the motors remain at the same rotation or is there some level of jitter? I imagine that as this ends up providing analog control there is some randomness, but I'm tring to figure out how stable this is compared to a stepper motor for control.
I duno about this particular implementation, but for example here with ESC32, with 1000 step sin lookup table, the resolution and repeatability is exact. As long as you don't make the motor skip poles (i.e. driving it too hard off balance or whatever), repeatability is always perfect. There's no jitter since PWM is generated by hardware. It is basically like a stepper motor, except you don't have as much holding torque.

sinesc r0 test (0 min 35 sec)
timecop is offline Find More Posts by timecop
Old May 24, 2013, 03:20 AM
Registered User
Joined Sep 2010
11 Posts
Quote:
Originally Posted by Tom Frisch View Post
I was under the impression that each coil in the motor gets a certain % of PWM duty cycle (firing off a MOSFET to send higher voltage to the coil). The ratio of the 3 levels dictate the position of the motor. So I think yes, the number of rotational steps would be limited by the bit depth of the PWM, and also the size of the LUT in the firmware that converts rotational position to the 3 PWM values.

In FW0.2 in the main.c file I see an array of floats called sinusas which has 91 elements that when graphed make 1/2 of a sine wave. Could that be what it's for?
Yes the sinusas is a sine wave I hadn't plotted it but it does look like the 1st quarter of a sine wave. I think the wave forms for a 3 phase motor are supposed to look like this diagram. In a normal 3 phase continuous running motor these waveforms continue for ever and the frequency of the sine waves (120 degrees a part) set the speed of the motor. I'm guessing for the holding the position like we want in a gimbal we would just choose one point and the 3 signals A, B, C (U,V, W) need to be taken from a vertical line corresponding to the rotation that we want. The calculations for each axis are the same in the form:
YawPh1=(sin(yaw_output )*5*configData[8])+500;
YawPh2=(sin(yaw_output+2.09)*5*configData[8])+500;
YawPh3=(sin(yaw_output+4.19)*5*configData[8])+500;
If you notice the calcs are the same for the 3 signals just adding 2.09 (4.19 = 2 x 2.09). I realized that this is 1/3 of 2*pi (one full rotation, so indeed it appears that we have 3 sine waves separated by 120 degrees. So that all makes sense and seems to prove that one full sine wave equals one revolution and that the other two signals are just offset from the first by 120 & 240 degrees so that all seems pretty straight forward. It also suggest to me that the better resolution we have in the PWM the better resolution we have in the position within the limits of the electronics and motors. If I understand the circuit properly the PWM is simply providing a ration of a single wire being 12V to GND or GND to 12V and thus generating a current level. Most of the motors I've seen for gimbals seem to be right around 15 Ohms. So using the old Ohms law V=IR (Voltage = Current * Resistance) it means that 12V at 15 Ohms should provide a current of 0.8 Amps and the PWM will adjust the current between 0 and 800 mA. A lower resistance would be higher current (more power/torque) and higher resistance would be lower power/torque. The L6234 motor driver used on other gimal controllers and the FETs on this one are rated at 4+ Amps which is probably higher that needed for the steady current but are probably required for the current surge with fast switching.

I was having trouble figuring out how the 9 positive and 9 negative control signals worked but I found that this processor (STM32F103) has a extra feature beyond the simple PWM offered in most micro-controllers it has a dead band generator with positive and negative signals. I've read a lot of datasheets over the years and never seem this feature that will guarantee that one and only one FET will be on at a time (stuff not blowing up is a good thing). I was thinking of building my own gimbal controller with another processor but this is too good a feature that I'll have to use this design.
pagercam is offline Find More Posts by pagercam
Old May 24, 2013, 03:21 AM
Registered User
Joined Sep 2010
11 Posts
If anyone has a circuit board(s) that they would be willing to sell, I'd love to get a hold of one. PM me and we can work out costs.
pagercam is offline Find More Posts by pagercam
Last edited by pagercam; May 24, 2013 at 01:29 PM.
Old May 25, 2013, 04:28 AM
Registered User
Joined Sep 2011
147 Posts
my boards arrived today (germany)
no ordering all the parts
edge0xc is offline Find More Posts by edge0xc
Old May 25, 2013, 06:15 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts
Quote:
Originally Posted by edge0xc View Post
my boards arrived today (germany)
no ordering all the parts
From itead?
My boards stuck in customs (for almost a week)...Hate it...
evvaldis is offline Find More Posts by evvaldis
Old May 25, 2013, 07:26 AM
ROLLER-COASTER-JUNKIE
Joined May 2013
113 Posts
Quote:
Originally Posted by evvaldis View Post
From itead?
My boards stuck in customs (for almost a week)...Hate it...
My boards too.......
KingDaKa is offline Find More Posts by KingDaKa
Old May 25, 2013, 09:41 AM
Registered User
Joined Sep 2011
147 Posts
yes, from itead


Quote:
Originally Posted by evvaldis View Post
From itead?
My boards stuck in customs (for almost a week)...Hate it...
i would like to use this stmf103
http://www.reichelt.de/STM-Controlle...STM32+F103RBT6

has less memory, but enough?

Alex
edge0xc is offline Find More Posts by edge0xc
Old May 25, 2013, 10:47 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts
Quote:
Originally Posted by edge0xc View Post
yes, from itead




i would like to use this stmf103
http://www.reichelt.de/STM-Controlle...STM32+F103RBT6

has less memory, but enough?

Alex
No, you cant use it. It has different peripheral(less timers) than 103rc. Stm32f103rc is the only mcu that you can use with this project
evvaldis is offline Find More Posts by evvaldis
Old May 25, 2013, 03:58 PM
Registered User
Joined Aug 2008
32 Posts
@edge0xc: How long does itead take to Germany?
Btw. if you buy parts, you should buy them at digikey and/or Mouser. Digikey and Mouser are paying the shipment (Fedex / UPS) and they also pay the customs. (For Orders above 65€).
The parts arrived here after 3 days.
MPXTony is offline Find More Posts by MPXTony
Old May 26, 2013, 02:13 PM
Registered User
Joined Sep 2011
147 Posts
well i waited 2 weeks.
and i will order my parts at mouser
edge0xc is offline Find More Posts by edge0xc
Old May 26, 2013, 03:06 PM
Registered User
United States, OR, Portland
Joined Sep 2011
142 Posts
I'm a moron and my bag of BLGC parts fell out of my car somehow on Thursday, so I had to order all new boards and parts. With any luck it'll all be here by next weekend.

Back to the waiting game!
wooden is offline Find More Posts by wooden
Old May 26, 2013, 05:25 PM
Registered User
Joined Apr 2013
91 Posts
Quote:
Originally Posted by wooden View Post
I'm a moron and my bag of BLGC parts fell out of my car somehow on Thursday, so I had to order all new boards and parts. With any luck it'll all be here by next weekend.

Back to the waiting game!
I've been waiting for my boards since the the 20th.

Us postal service is terribly slow.

Processed through USPS Sort Facility
May 23, 2013, 4:22 pm
LOS ANGELES, CA 90009
International Letter
Depart USPS Sort Facility
May 22, 2013
PORTLAND, OR 97218
Processed at USPS Origin Sort Facility
May 22, 2013, 3:00 am
PORTLAND, OR 97218
Processed at USPS Origin Sort Facility
May 21, 2013, 8:46 pm
PORTLAND, OR 97208
Accepted at USPS Origin Sort Facility
May 21, 2013, 7:30 pm
LAKE OSWEGO, OR 97034
Electronic Shipping Info Received
May 21, 2013
Shipment Accepted
May 21, 2013, 1:34 pm
LAKE OSWEGO, OR 97034
natious is offline Find More Posts by natious
Old May 27, 2013, 03:20 AM
Registered User
Portugal, Faro District, Tavira
Joined May 2013
13 Posts
Hi, do you still have one board available to sell?

Thank you

Regards

NF
giantpt is offline Find More Posts by giantpt
Old May 27, 2013, 09:36 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts
Good news: finally got pcb's!

Bad news:
I2C works really unstable. Don't know yet if it is HW or SW problem.

But board works! Looks like there is no big mistakes.
evvaldis is offline Find More Posts by evvaldis
Closed Thread


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Open Source Brushless Gimbal edge0xc Multirotor Electronics 3037 Jul 16, 2014 04:52 PM
Idea Open Source Gopro Brushless Gimbal icais Multirotor Talk 16 Mar 28, 2014 12:07 PM
Discussion SkyLight SBG - GoPro 2 Version Released (+ GP3 Beta + 3 axis Alpha) !! ed_jza80 Multirotor Talk 494 Jan 03, 2014 10:09 AM
Sold open source brushless gimbal controller jy0933 Aircraft - Electric - Multirotor (FS/W) 57 Mar 26, 2013 07:02 PM
Sold [closed] open source brushless gimbal controller jy0933 Aircraft - Electric - Multirotor (FS/W) 16 Feb 26, 2013 09:19 AM