The Daily Click ::. Forums ::. Klik Coding Help ::. Any REAL programmers out there?
 

Post Reply  Post Oekaki 
 

Posted By Message

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
12th April, 2010 at 16:05:00 -

If you can get this working I'd greatly appreciate a list of the steps you took.

The tools you used, ect.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th April, 2010 at 20:26:05 -

The actual servo controller should be arriving tomorrow or the next day.
If I get it working with MMF2 then of course I'll let everyone know how I did it (maybe write an article).
Is that what you're interested in, or just the bit about dlls?

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
12th April, 2010 at 20:57:16 -

Everything,

but yes, especially the bit about retrieving what commands can be sent to the dll's.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th April, 2010 at 13:24:20 -

Well, it arrived, but I'm having difficulty getting it to work.
I plugged in a 4.8V battery pack and servo (all wired up the correct way), and it just melted the servo before I even connected it to a computer

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
17th April, 2010 at 12:02:49 -

Hi there,

I am a retired clicker but I did do my degree in electronics and computer science and I worked as an embedded systems engineer for a while! Robotics is also one of my many hobbies, I am currently building a mini sumo robot and I have built a couple of micromices.

Anyhow from a very very brief read up on the board, it appears to offer a virtual COM port over USB. I have controlled embedded systems over USB from MMF2 using the Serial port object, it works very well!

The example application with it allows you to connect, send and receive. If it was me I would read up on the protocol and find the COM port the board is hiding on (device manager, it will probably come up something like Microchip CDC) and see if it responds to sending some commands.

You may need a bigger battery pack greater than 4.8V for PC less operation. If it is less than 5V and if it's a conventional regulator you will need greater than about 5.5 to 6V to beat the drop across the regulator - hence the microcontroller onboard would probably not be powered. 4.8 is fine for the motors, plugging in to USB should power up the micro as well as the motors.


Another option is the Arduino/Freeduino. The arduino/freeduino offers an excellent and cheap way to get started in embedded systems http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=1

should be tons of examples on servo control for arduino

Edited by an Administrator

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
17th April, 2010 at 18:58:06 -

Thanks for all the info - I'll look into that Arduino thing. It's cheap, which is nice

It's not actually for a robot as such - I just need to have 3 servos and 1 motor controlled by a laptop (so it pretty much has to be USB; bluetooth would be better but it's too expensive). It will be connected to the computer at all times.

I now have the controller working using the supplied software, so I at least know it's not broken, but no luck with the dll in MMF2. I'll look into using the serial connection, but the dll would have been better - don't suppose you have any ideas of how to get that working, do you?

Thanks again


 
n/a

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2722
21st April, 2010 at 10:46:16 -

Hi, I just had an quick peek through the source code and I think you should read the file: "Usc_protocol.cs" since that file defines the constants needed to communicate.

The file: "Usc.cs" holds the class which setups an object that represents the connection to the computer. Err well you probably figured this out yourself from the comments.

But it seems like this was setup to read, store and execute script files. So I would say: create a simple script file and figure out which functions are called from the class located in: "Usc.cs" because if the file: "UscSettings.cs" takes care from loading the settings and script(s?)

This function is "Usc.cs" loads the settings: "public void setUscSettings(UscSettings settings, bool newScript)"

I wasn't able to find the function: "controlTransfer" but it's probably in the SDK. Anyways I found this forum post when searching: http://forum.pololu.com/viewtopic.php?f=16&t=2458&p=11208

And that's probably all I could do so far. Good luck with controlling your servo's. You could always control them by letting mmf create the little scripts for you and send it to the hardware. But it's some sort of intermediate solution.

Cheers

 
Image jenswa.neocities.org

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
21st April, 2010 at 18:47:12 -

Unfortunately I am in embedded programmer, I have dabbled in system programming (command line apps in C/C++ and a tiny bit of python) but Jenswa (Hi there fellow iklik-it dude , long time no see hope your well) and others in this thread I think have more experience on PC side than me. I work at the low levels close to hardware, so that's where I feel most comfortable .

I had a look at the Edwards protocol (http://www.seetron.com/ssc.htm) which the board also accepts. Its 3 bytes and is very simple!

Byte 1: Marker 0xFF (hex) or 255 in decimal (note this is not a sting of 255 but a single byte - one character)
Byte 2: Servo number from 0x00 to 0xFE (0 to 254)
Byte 3: Servo position from 0x00 to 0xFE (0 to 254 with 127 being centre)

I have modified the serial port example for MMF2 to send packets according to Edwards protocol, and I have emailed it you - it should get something working in a fashion if you can not figure the DLL approach out. Assuming Pololu are not fibbing about it being able to use either protocol, it should work. Find the com port the board is on, alter as necessary, then open the port (9600 baud should be fine). The little red indicator AO should go green if all is good!

Also note my example will only work from the second servo on and also you will lose one position increment at the one end. For testing just move the motor plug along the connector to the 2 nd position

This is due to a 0 character being a null terminator for strings. If this works you may be able to use the binary object (i.e. use 3 bytes and address them manually) then send a string from the binary object. I'm not sure about the serial object itself though, this maybe a limitation of using MMF - a null terminator is usually used to tell functions to stop reading characters (singular bytes) from this array (i.e. stop here no more data, unless you want to read out the end of the array and read god knows what ! ). As there is there no way to set the string length any other way I think that maybe a limitation.


 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2010 at 21:18:15 -

Thank you very much for going to all that trouble to help me
Like you said, it does look like it ought to be quite simple using the serial object - but unfortunately, it doesn't seem to be working so far

Looking in Control Panel, the servo controller seems to use 2 COM ports:

Pololu Micro Maestro 6-Servo Controller Command Port (COM4)
Pololu Micro Maestro 6-Servo Controller TTL Port (COM5)

I've tried them both, but with no success.
I don't get an error message, and the circle goes green, but the servo just doesn't move.

I've tried plugging the servo into all the different channels.
I've also tried sending a "baud rate indication byte" as mentioned here: http://www.pololu.com/docs/0J40/5.c - don't really know what it's for, but I figured it was worth a try

If you have any other suggestions, feel free to let me know.
Otherwise, thanks again for the help you've already given me

At least I know who to give the servo controller to now, if I give up trying to make it work myself



 
n/a

Codemonster

Administrator
Klik & Play Expert

Registered
  03/08/2008
Points
  133

I am an April Fool
27th April, 2010 at 19:18:23 -

You can find people at the various Hire-A-Coder web sites. They are usually able to work for pretty cheap ($100-$300)

 
--
Jesse J
   

Post Reply



 



Advertisement

Worth A Click