Thread Tools
May 23, 2013, 06:30 PM
Registered User
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?
Sign up now
to remove ads between posts
May 23, 2013, 08:37 PM
Suspended Account
Quote:
Originally Posted by pagercam
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)
May 24, 2013, 03:20 AM
Registered User
Quote:
Originally Posted by Tom Frisch
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.
May 24, 2013, 03:21 AM
Registered User
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.
Last edited by pagercam; May 24, 2013 at 01:29 PM.
May 25, 2013, 04:28 AM
Registered User
my boards arrived today (germany)
no ordering all the parts
May 25, 2013, 06:15 AM
Registered User
evvaldis's Avatar
Quote:
Originally Posted by edge0xc
my boards arrived today (germany)
no ordering all the parts
From itead?
My boards stuck in customs (for almost a week)...Hate it...
May 25, 2013, 07:26 AM
ROLLER-COASTER-JUNKIE
Quote:
Originally Posted by evvaldis
From itead?
My boards stuck in customs (for almost a week)...Hate it...
My boards too.......
May 25, 2013, 09:41 AM
Registered User
yes, from itead


Quote:
Originally Posted by evvaldis
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
May 25, 2013, 10:47 AM
Registered User
evvaldis's Avatar
Quote:
Originally Posted by edge0xc
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
May 25, 2013, 03:58 PM
Registered User
@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.
May 26, 2013, 02:13 PM
Registered User
well i waited 2 weeks.
and i will order my parts at mouser
May 26, 2013, 03:06 PM
Registered User
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!
May 26, 2013, 05:25 PM
Registered User
Quote:
Originally Posted by wooden
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
May 27, 2013, 03:20 AM
Registered User
Hi, do you still have one board available to sell?

Thank you

Regards

NF
May 27, 2013, 09:36 AM
Registered User
evvaldis's Avatar
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.


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Idea Open Source Gopro Brushless Gimbal icais Multirotor Drone Talk 17 Dec 14, 2016 07:29 AM
Discussion Open Source Brushless Gimbal edge0xc Multirotor Drone Electronics 3074 Nov 06, 2016 06:38 AM
Discussion SkyLight SBG - GoPro 2 Version Released (+ GP3 Beta + 3 axis Alpha) !! ed_jza80 Multirotor Drone 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