PoMoCo on MBP

Hello everybody, first of all thank you for your awesome work!! I’ve received my Hexy a few days ago and it’s now fully assembled and servos (I hope) are centered.

I’m very happy about my new hexapod, but I’m having issues with PoMoCo, your position and motion controller. I’ve installed pySerial-2.6 on my MacBook Pro, everything seems to be working fine during the installation, but when I launch PoMoCo I get the GUI to show up, but usually clicking on any of the buttons don’t do anything and and I have to kill the application.

I’ve read of someone on this forum having this issue, but apparently it was because he was running the older version of the software, while I’m pretty sure I’ve downloaded the latest version.

Thank you in advance for your help and your time, greetings from Italy :wink:

When pomoco first launches does it recognize the COM you are using? At times pomoco would not recognize my port which would in turn make the GUI not work. I noticed that pomoco lags a lot but once I made sure I had my Servitor32 at a 115200 baud rate it fixed the lag issue the GUI was having. The servos on hexy were still twitchy when i would choose a command that would make hexy walk. While a command like “wave” and “type” work perfectly.

Thank you for your answer,

this is what I get when I run PoMoCo from terminal

Attempting to connect to Servotor
Connect Successful! Connected on port: /dev/tty.usbmodemfa131
initilizing servos
servos initalizied
Killing all servos

so apparently it recognizes Servotor, by the way I have no idea what “/dev/tty.usbmodemfa131” represents, in fact I was assuming pySerial was causing troubles

I’ve also tried to take a look at PoMoCo’s source code, but I’m not a Python programmer :blush:

I also have another question, how do I use the Arduino IDE serial monitor?

Thank you :smiley:

Looks like you are connecting fine to pomoco. I think “/dev/tty.usbmodemfa131” represents the USB/Serial Port port you are using. I assume that you want to take a peek at the Servotor32 firmware correct? A Ctrl+Shift+M in the Arduino IDE should open the Serial Monitor or Tools->Serial Monitor. After the serial monitor opens make sure you set the BAUD rate to 115200, which should be the baud rate the Servotor32 firmware is set to. Type a command in small box next to the SEND button. Once you type out the command press SEND.

How did you make sure the Servitor32 was at 115200 baud rate? I see that in the Servator32_1v5 firmware that it sets the serial ports to that rate.

For example, I see:

//setup PC serial port
Serial.begin(115200);
Serial1.begin(115200);

Is that all that’s needed?

What kind of “command” do I have to use? Is there a list of available commands or something like that?

Also, I’ve downloaded the sketch from github and tried to load it with the Arduino IDE, I’ve already installed the latest version of the firmware, but Hexy isn’ t still moving :cry:

Once again, thank you for your answer :slight_smile:

EDIT: I’m having a new issue: Arduino, when loading a sketch, says that the port is already in use, how is that possible? And what does the red led on the board represents? While loading, it twinkles and then turns off

How did you make sure the Servitor32 was at 115200 baud rate? I see that in the Servator32_1v5 firmware that it sets the serial ports to that rate.

For example, I see:

//setup PC serial port
Serial.begin(115200);
Serial1.begin(115200);

Is that all that’s needed?[/quote]

What I mean by that was that when you look under “Devices and Printers” in Windows 7 Servotor32 or Arduino Leonardo should show up in that list. I right click to go into the Servotor32/Leonardo properties and I changed the default config from 9600 to 115200. I want to be clear that there was no issue with pomoco communicating with hexy but it was the pomoco program acting “sluggish” and “laggy”. Once I set the properties on Servitor to 115200 to be default the pomoco gui was not acting sluggish or feel like it was resource heavy. Maybe it is a Windows 7 64 bit issue, i don’t know.[quote=“andrea”]

What kind of “command” do I have to use? Is there a list of available commands or something like that?[/quote]
If you look into the firmware of Servotor32 it has a command like ‘C’ to center a servo.

Make sure that you do not have anything open that is using that port while the Arduino IDE is trying to load firmware into the board. For example, make sure pomoco is not running in the background while loading firmware using the IDE. That would be my guess on to what is going on. I think the red LED is there as indicator, it blinks when you power up your board and maybe when you try to load firmware too. I honestly don’t remember if it blinks when you load firmware I was not paying too much attention when i loaded firmware onto the board lol I was looking at the IDE.

Hopefully this will be my last question, how do I know if servos are centered? I’ve read the assembly guide, so legs’servos are centered, but what about the remainig? What position do they have to assume when all servos are centered?

The firmware calibrates the servos to the center position using PWM once you plug in the servo into the boards headers. Not sure what you mean by remaining servos?

flickr.com/photos/68797310@N05/8148017635/

I waa talking about the servos connected with ports 7, 11, 15, 24, 20 ,16

PoMoCo, by the way, still freeze, but I was able to make it work under Windows, so I assume it’s a Mac problem :cry:

We identified this as a problem with how often the GUI was being updated. Turns out that Windows can handle much faster refresh than OSX can with tKinter (the GUI library we currently use). We slowed down the refresh rate, and now it seems to work. We’ll have this update in the next version of pomoco, or you can open pomoco.py and change

to

That changes the refresh rate from 50 times per second to 10.

I really have to thank you for your work, I’m not a programmer except for basical notions of C and Java, so python kinda scared me :smiley:

Thanks from Italy!!

I’m also having trouble with this. PoMoCo.py launches and the GUI loads, but 90% of the time when I click on anything the GUI freezes. When the program launches I see this in a console:

Attempting to connect to Servotor Connect Successful! Connected on port: /dev/tty.usbmodemfa131 initilizing servos servos initalizied Killing all servos

When I press CTRL+C in the console while the GUI is frozen I get a KeyboardInterrupt as follows:

^CTraceback (most recent call last): File "PoMoCo.py", line 677, in <module> root.mainloop() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1017, in mainloop self.tk.mainloop(n) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1405, in __call__ def __call__(self, *args): KeyboardInterrupt

I then killall python and try again. Every few tries, I get a single click to not freeze the program, such as clicking one checkbox to enable a servo. But the next click then freezes it.

While I’m doing all this, occasionally some of the servos will center, particularly the head.

I have uploaded the v1.5 firmware to my servotor32 board using the arduino IDE, no change in the above behavior.

Before you assemble each place where a servo connects to a horn, connect that servo to channel 0-3 of a powered-up Servotor32 board. That will cause the servo to turn and stay at its centered position. Then, while it’s still powered (so it can’t be twisted), assemble the piece pointing straight.

I am also having an issue running PoMoCo on my Mac. I run it in Windows under boot camp and it seems to be ok.

But when I run it on my mac it freezes when I click anything.

Looks like changing the self.master.after stuff may have fixed it. Will give it a try with the bot tomorrow.

The newly posted PoMoCo incorporates this fix, so try that out first.

Downloaded it. Works great! Thanks! Merry Christmas!