Thursday, May 30, 2013

Brushless Gimbal Configuration and Operation

Here's the followup to this post where I promised to cover the setup and operation of proper setup and operation of a brushless gimbal.

Right now it's a work in progress, as I'm just starting to fiddle with the thing.  Like most postings here, this is just a journal of my continuing ignorance, so feel free to leave questions and comments below.

When I'm finished with this, I'll probably split this into two posts: one for building the software, getting the drivers installed, and getting the GUI running, and one on actually using the GUI to tune the gimbal.





Configuring on Windows

There's a bunch of hassles regarding getting the proper USB driver.  I'll try this on Mac first and then come back to Windows later.

Configuring on Mac

Things turned out to be pretty simple on a Mac.  The driver was already installed, and the usbserial device was created when I plugged the BLG in using the USB connector.

# before plugging in the BLG

$ ls /dev/*usb*
ls: /dev/*usb*: No such file or directory

# after plugging in the BLG


$ ls /dev/*usb*
/dev/cu.usbserial-A96LPFBJ /dev/tty.usbserial-A96LPFBJ


I opened another terminal window and started the GUI.  This was also pretty simple on the Mac, since the Tcl interpreter the GUI uses comes installed by default.

$ ~/blg/BruGi_049A_r45/_BruGi/GUI --> wish bl-tool2_049.tcl 













Oops, it looks like I've downloaded version 49, while the pre-installed firmware is version 48.  Later I'll try recompiling and reloading, but for now I'll download version 48 and see how that works.

Hmm, the BLG starts up and operates, and the GUI seems to start up with no problem, but as soon as I click Connect, the motors jump and then the entire BLG goes limp.  Yikes, is it dead?


mh@maru ~/blg/_048/_048/GUI --> wish bl-tool2_048_AHa.tcl



No,  power-cycling brings everything back to normal.  Whew!!!

Command Line Fiddling

So, before we try building and installing version 49, let's see what happens if we connect directly to the BLG card.  It turns out there's an online command mode, complete with help.  Here's the help text, and the output of a couple of the transmit commands.  Note that this is pretty old school, so you have to type the commands in caps, and press control-J to terminate the line.  You won't see any echo.  The board talks at 115200/8/N/1.  It might be easier to use the Arduino terminal window.


mh@maru ~ --> screen /dev/tty.usbserial-A96LPFBJ 115200

MPU6050 ok (LOW)
Motion detected during Gyro calibration. Starting over!
(repeated lots)
Gyro calibration: done
GO! Type HE for help, activate NL in Arduino Terminal!

Explanation in brackets(), use Integers only !

WE    (Writes active config to eeprom)
RE    (Restores values from eeprom to active config)
TC    (transmits all config values in eeprom save order)
SD    (Set Defaults)
SP gyroPitchKp gyroPitchKi gyroPitchKd    (Set PID for Pitch)
SR gyroRollKp gyroRollKi gyroRollKd    (Set PID for Roll)
SA accelWeight    (Set Weight in accelWeight/1000)
SF nPolesMotorPitch nPolesMotorRoll
SE maxPWMmotorPitch maxPWMmotorRoll     (Used for Power limitiation on each motor 255=high, 1=low)
SM dirMotorPitch dirMotorRoll motorNumberPitch motorNumberRoll
GC    (Recalibrates the Gyro Offsets)
TRC   (transmitts RC Config)
SRC minRCPitch maxRCPitch minRCRoll maxRCRoll (angles -90..90)
SCA rcAbsolute (1 = true, RC control is absolute; 0 = false, RC control is proportional)
TCA   (Transmit RC control absolute or not)
UAC useACC (1 = true, ACC; 0 = false, DMP)
TAC   (Transmit ACC status)
OAC accOutput (Toggle Angle output in ACC mode: 1 = true, 0 = false)
ODM dmpOutput  (Toggle Angle output in DMP mode: 1 = true, 0 = false)
HE    (This output)

TAC
1

TRC
-45
45
-45
45

TC
48
10000
500
2000
20000
500
6000
0
14
14
1
-1
0
1
100
100


Quitting screen (control-A control-\) resets the board.


To Be Continued...

Next I'm going to build and install version 49, and try the version 49 GUI again.


WORK IN PROGRESS

This posting is a work in progress.  Everything below is for future cut and paste.






http://www.olliw.eu/2013/brushless-gimbal-direct-drive


http://www.rcgroups.com/forums/showpost.php?p=24926526&postcount=4145
http://www.rcgroups.com/forums/showthread.php?t=1829058&page=2
http://www.rcgroups.com/forums/showthread.php?t=1829058&page=17&pp=100#post25034592


Links
http://www.rcgroups.com/forums/showpost.php?p=24926396&postcount=542
http://www.rcgroups.com/forums/showthread.php?t=1872416
http://www.rctimer.com/index.php?gOo=goods_details.dwt&goodsid=872&productname=
http://www.rctimer.com/index.php?gOo=goods_details.dwt&goodsid=884&productname=
https://code.google.com/p/brushless-gimbal/downloads/list





Here's the gimbal being powered up and running smoothly.

Here's the insanity that results if you've got the IMU positioned incorrectly or swap your yaw/roll connections.
Likewise if you get twitchiness like this.


3 comments:

  1. Hi

    thanks for this post. I am trying to open the GUI, but don't succeed. I open the terminal window, but I guess the command line I type is not correct since it tells me "no such file or directory".
    What I type is

    verdi:~ me$ ~/users/me/downloads/_048/GUI --> wish bl-tool2_048_AHa.tcl

    I am all new to the terminal window, so I guess this is not the way I should type it. Do you know what's wrong?

    thanks!

    ReplyDelete
    Replies
    1. First, make sure your mac has a good wish executable:

      /usr/bin/wish

      This will give you a blank window that you can close.

      Then, type

      ls

      and see a list of files. Make sure the bl-tool hasn't changed names subtly. Then try one of these:

      /usr/bin/wish bl-tool2_048_AHa.tcl
      /usr/bin/wish -f bl-tool2_048_AHa.tcl

      Delete
  2. YES!
    thanks, I now have the GUI. But it seems that I the BLG doesnt connect:
    $ ls /dev/*usb*
    ls: /dev/*usb*: No such file or directory.
    Is there another way to set-up the connection?

    ReplyDelete