Problems with the Rockbot.

I’ve been having some intermittent skipping issues on the Y-axis on my Rockbot and I wanted to go over some of my settings on my polulos..  My table is very smooth running, although in hind site it’s inertial mass is probably a little more than it should be.

Going back through my notes, I have this motor

and this driver

If memory serves me, I sorted calibrated by feel and sound..  It probably should be dialed in a little better.

Anyway, I found this guide.

So According to this it looks like my limiter is the A4988 Driver..  It looks like they only want  me to drive 1 amp with air cooling only…  My motors can handle up to 1.5 amps.

The magic formula’s are here

Another way to set the current limit is to measure the voltage on the “ref” pin and to calculate the resulting current limit (the current sense resistors are 0.05Ω). The ref pin voltage is accessible on a via that is circled on the bottom silkscreen of the circuit board. The current limit relates to the reference voltage as follows:

Current Limit = VREF × 2.5

So, for example, if the reference voltage is 0.3 V, the current limit is 0.75 A. As mentioned above, in full step mode, the current through the coils is limited to 70% of the current limit, so to get a full-step coil current of 1 A, the current limit should be 1 A/0.7=1.4 A, which corresponds to a VREF of 1.4 A/2.5=0.56 V. See the A4988 datasheet for more information.

So  I measured a reference voltage of  .156 Volts X 2.5   = 0.39 amps…
Yikes.  It looks like I’m stalling out the motor versus triggering the thermal shut off for the motors.

So seems like I want to crank this up to 1/2.5 = .4 Volts.  Something for tomorrow.





Posted in Uncategorized | Tagged | Leave a comment

More refactoring with the polyline.

I haven’t much time lately for playing around with pencil2d.   Work as well as other life commitments haven’t left much gas in the tank for me to pursue fun stuff like this.  Currently I’m having a rare quiet Sunday morning moment more or less where I can take a 50k foot view to see what I’m trying to do and hopefully break things down into some manageable bites that I can squeeze in between the chaotic moments of life.  This is going to a train of thought post that probably won’t be of any interest to anyone but me, so read at your own risk.

So far I managed to separate the bezier from the polyline in the code.  There was a desire by the pencil2d developers to have the polyline function in both the bitmap and vector modes.   This dual functionality requirement is giving me some headache at the moment.  In bitmap mode lines are stored as a bitmap.    Trying to maintain this dual functionality at the moment is just slowing me down.

But.. Some of the design requirements are…

Polyline saved as a bitmap can never be edited as a polyline.
As new polyline can be either a bitmap or vector.

Another requirement, that will need to be implemented at some point.
Need to know in the mouse movements we’re dragging a point to move a line(s) or if we’re creating a new line from an existing point.

Rather than stripping bitmap out of the polyline code completely I think I should treat it as a non-implemented feature.  I think once I get the main functionality implemented for vector mode shouldn’t be that hard to implement for bitmap.

In addition, the way the polyline data structure is going to change as well.  If memory serves me it appears the app assumes that a line will be drawn point to point… In essence there is no line object… A line object needs to be implemented.  This also means that container objects will also need to be designed etc… etc.. blah blah blah…

Also, I noticed(working from memory) that when qt renders lines it is using a 3 dimensional data to project on a 2d plane.    The pencil2d  polyline points should be 3 dimensional as opposed to planar. (This doesn’t mean we’re going to use the z at this point, but I think since qt can handle it, why not lay the foundation to have a 3d polyline so it can eventually be implemented…)   Ultimately I could see  some type vector tool of a  a constrained stick figure that could be manipulated  frame to frame in 3d space but proect on a 2d plan.,  This would give the animator a stick figure to place and  could draw around it.  Seems like that would be pretty cool to do.

As with anything all great journeys being with a single step…
Hopefully  I can map out some small additional steps as well that I can knock off on something other that a quiet Sunday.

Anyway…..  Next steps(more or less)

Research how best practise for handling non-implemented features so I get a break when debugging through the IDE, but doesn’t throw an exception when the IDE is running.

Refactor Code to polyline.cpp (et all?) that bitmap mode is a non implemented feature.

(?Need to add code that editing an existing object is a non implemented feature?)

(?Need to add code that saving an existing object is a non implemented feature?)

Create a line object.

modify the container objects to accommodate both lines and points.
(When I get this point, I need to break down a bunch of small digestible steps)

Sub goal. Draw the polyline out with a point to point line using the line object.

Get the polyline object to save.
(More sub steps to detail)
Get object to retrieve
(More sub steps to detail)

Get this working with bitmap mode.

(Need to break down additional steps)

When I get this point, the new polyline should mimic the currently existing polyline both in bitmap and vector mode. I would say that would be the point where we’re saying we’re done with that phase of the project.

That’s not to say we’re done, done… but at least it gives me a hard edge to strive for..
The next project after that would be do be able to drag a point and have the lines follow it.

Posted in Uncategorized | Leave a comment

Refactoring the polyline in pencil2d

So I’ve managed to get myself deep into the rabbit hole now.

The way things are structured in pencil2d is that a polyline would be drawn in bitmap mode and  a bezier would be drawn in vector mode.  In my mind these are two very distinct ways of doing things and it makes no sense to me that they should be combined in the same class.
So….  I created a branch called polylineRefactor and  basically copied bezier.cpp into a separate class called \graphics\vector\polyline.cpp and commented out anything that looked like it had something to do with a bezier as well as anything else that keeps the program from building and running.

I left bezier.cpp intact for the most part for now and tried disconnecting it from pencil.  I think at some point it will need refactoring as well and at some point there should be a bezier icon on the pencil2d sight.
Anyway… At this point, the polyline tool is totally unusable.   If I do a mousedown I get a line starting at the start of the screen and the line drawing to the current  mouse position.   This is both vector and bitmap.
So… I’m thinking next steps.

Get the start of the line to appear at mouse down event.
Get the end of the line and new line to start and the second mouse down event.
Don’t have much time this weekend, but if I could get this done it would be a good start.Fun fun fun…. 😉

Posted in Uncategorized | Tagged | Leave a comment

Converting a Ogv to Avi in youtube in ubuntu 14.04

Sometime Linux can really be annoying(I still like like it though).
So I’ve been trying to use recordmydesktop to record which saves natively in OGV.   Unfortunately youtube doesn’t like OGV you need to convert to AVI.

So I tried the magical incantation that google seems to say and this happened:

So memcoder isn’t working.  And FFmpeg doesn’t seem to be loaded in 14.04 for some reason or another…  But I did find some instructions to get it loaded.

So looking for the magical incantation:

So  I tried this:

Ok… Now I found this:

This incantation seems to work.

Hoo… Hoo… Success.


Posted in Uncategorized | Leave a comment

Just some quick notes on enabling/Disabling stuff in qt

I’m a little to tired to work on this at the moment,  but I had some links that I want to look at



Posted in Uncategorized | Tagged | Leave a comment

Pencil2d Initial thoughts on the Copy paste within a frame bugs #414

I’ve been looking at the code and playing with the app  figure out how to replicate this
It seems that the selection/move tool by themselves are working pretty good.

I was playing the the move tool and noticed a couple of features that are pretty cool.  If you use the move tool with a shift enter, the object gets moved along the x-y and the hold the control down will rotated the selection, you can scale the selected bitmap….All  pretty cool… but that’s not our bug.

I’ve been trying to come up with a consistent way to generate the bug for testing.  I can’t seem I can seem to find it at the moment.  One thing that I’m observing multiple times but I can’t do it intentionally, is that a copy based occurs if I draw on the original, the copy also updates. (I’m assuming this is a bug and not a feature.)

Also if I do a file new, I’m seeming a invisible selection that blanks out what ever I’m drawing.  This seems to be happens only after the weird copy occurs.  My suspicion root cause is some combination of mouse clicks, key-strokes that you would normally never do, but are allowed.

One thing that does seem strange to me is that cut- copy and paste from the command from the pull down are enabled at all times.   It seems me that the business rule should be if you perform any of these actions the selection box should be displayed.   The corollary would be if the selection box is not displayed the copy-cut-paste should not be enabled,  If ctrl-x ctrl-v, ctrl-c is attempted with no selection box is displayed, a modal message pops saying that you can’t do that from the pop-up menu.

Now in my mind when a paste if performed via a ctrl-v the copy should be placed where the mouse cursor resides (upper left corner)
If we don’t want to give an error message when some does  a edit-paste it seems to me that when some does a edit->paste the copy should be placed in the middle of the screen, the selection is switched to the copy.

My current thinking is that if a ctrl-v is pressed (after initial ctrl-c) the selection could move to the copy (and in the background perform a new copy to the selection.  This should enable you to keep hitting ctrl-V to get multiple copies.

Whenever the selection is not visible, the clipboard is cleared.

In my mind, the next step should be only to allow Edit=>copy, Edit=>Paste,Edit=>cut, Ctrl-C, Ctrl-V,Ctrl-X only if the selection grid.   Before, I invest the time in doing that, I think I should get the ok from Matt to go for it.

I was just looking at this post..   That might just mess up my perfect plan..  Could we want to paste images from outside pencil2d?  I suppose that could be a Edit-Past-Special(with behavior the same as Edit-Paste?





Posted in Uncategorized | 2 Comments

Exploring the pencil2d F6

So one of thing I’m starting to  taking a look at this:

Playing around with the app, it looks like the F6 duplicate frame in combination with a pencil draw, F6 is yielded correct results.  (I’m thinking it might be worth understanding what’s happening on something that’s working correctly, for when I deal with the stuff that’s broke.
So… I wanted follow the trail on what’s going on with the F6 key..  I was thinking it was going to be sometype of keypress event, but I think I found the link here:

I guess  kb.ini file is some type of initialization file.
Anyway it’s referenced here:



So the magic search term at the moment is

I think we’re getting close

Okkk… Now I think I found it.


I just did some testing and everything within this routine is functioning properly.

(This seemed like more work than it should have been)
My think the next step is to see where pasting is occuring.   The critters are laying in there some where.
(Well the morning is blown and nothing really fixed yet.)
I think my next steps are probably to isolate the wacko behavior and put a break point on paste() so I can see what’s going on.


Posted in Uncategorized | Tagged | Leave a comment

Messing around with Pencil2d. Exploring the selection tool.

Over the holidays, my daughter had expressed an interest in learning animation.  I did a little googling an I found a open source package called pencil2d.   She downloaded and tried using it and found it too buggy.  I uses C++/QT which is something I’m familiar with my dabbling with freecad so, I figured what the heck and I downloaded the source from git..
My understanding is that the original developer of pencil dropped the project and it basically forked. Pencil2d is a merge and enhancement effort.
I don’t have a lot of open bandwidth these days, but I’m hoping that contribute a bit to this project and get it to a point, where my daughter can make some use full animations.

From late December to today, it seems like things have improved quite a bit with pencil.   One very annoying thing at the moment is the selection tool.. It seems to be misbehaving…

Basically when copy pasting with the selection tool very bizarre things occur.  It’s sort of hard to explain.  At this point I just want to see if can get a 30K foot understanding of how things are supposed to work.
So I think the problem has to do with thinks interacting  with the selection tool versus the selection tool itself. git activity around selecttool.h has been quite.. (last change 25 days ago..) So, need to see how this object is used.
So.. Looking for reference to the SelectTool we get this:


So the selecttool seems to interact with the world with the toolmanager..




So.. It looks like SelectTool object is stored in mToolSetHash.







QHash looks alot to me like a Dictionary in C#  which contains a key and a value.
The key is an enumeration called ToolType and Value is a pointer to the BaseClass definition of the tools..
Ok.. So the enumeration ToolType is defined here:

Ok.. This is very understandable to me… So.. to figure out where the selectTool object is interacting with the rest of pencil2d we need to search on the Enumeration SELECT  (good thing that we’re not doing SQL in this app)
We need to find the references to the enumeration SELECT






This seems like its doing something with rotation? (I’ve heard this mentioned)


Ok.. I think this is fired to select the gui tool (this might be worth looking at later

Ok.. it looks like we’re just selecting the  Selection tool to be the default object here.


I can see putting some break points to get a look at the call stack at a few stops at some point


Can’t see anything be an issue here with what I’m working on.


This is interesting and I think will need disection at some point.


This is a virtual functions defined in the baseclasstool and overwritten in


The enumeration which defines SELECT.

Basically.. I just want to how the select object is use… I’m not trying to fix anything yet.

There’s a lot going on here and hopefully this will save me a little time later on.
One thing that I need to study is the copy paste mechanism…
(One thing that I notice is the duplicate frame F6 has a behavior that is weird at first but essenetially correct when you think about it.(Well maybe) When you hit f6 you get the image put into the new frame with the selection box around it.   If you draw on the frame and hit F6 the new stuff you just drew doesn’t copy over…  you need to hit escape and then F6… (I’m thinking this will come in handy at some point)


Posted in Uncategorized | Tagged | Leave a comment

Nice little git reference.

I seem to gotten back on the git thing..  Anyway, I found this nice concise guide on forking and pushing changes…   Kind of nice so I wanting to leave myself a note….

Posted in Uncategorized | Tagged | Leave a comment

First dabbles with Android-Studio

A while back I was dabbling with App-Inventor to get my hexy the hexapod working on my Nexus tablet.  It was a fun project.   Poor hexy is in pieces now, stripped for her servo’s.    So.. for a variety of reasons, I sort of have an itch for looking at android programming again.

Doing a fair amount of googling, It looks like the thing to try is Android- Studio…  Ok.
So I ran across setting up a android-studio on ubuntu via a PPA here:

It took me a few minutes to figure out how to fire the darn thing up.

jonasthomas@JTLapTop:~$ /opt/android-studio/bin/

So you think I be ready to fly….. nope.

JDK Required: ‘tools.jar’ seems to be not in Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.

Ok…  So an interesting post on here
JDK = JRE + Development tools.

JRE = JVM + Libraries

JDK = {JVM + Libraries} + Development tools.

On the Tools.Jar I found a nice post here:

jonasthomas@JTLapTop:~$ java -version
java version “1.7.0_79”
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
jonasthomas@JTLapTop:~$ java -version
java version “1.7.0_79”
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Ok.. I have OpenJDK installed (Possibly when I installed Eclipse-Arduino)  This seems to be working ok.. So I don’t want to hose that up.
Soo.. The previous post pointed me to here:

jonasthomas@JTLapTop:~$ update-alternatives –config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                            Priority   Status
* 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
1            /usr/bin/gij-4.8                                 1048      manual mode
2            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
3            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode

Press enter to keep the current choice[*], or type selection number:

Ok.. I think all I need to do is to a Path to

Soo.. I added this to the top:
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

Well that didn’t work.
Some talked about just doing this.

Ok… So that did it…
Its a bit strange that seems to have worked.  I thought that I had the jdk already installed, but when I did the installed it didn’t give me a message back that it was installed already and libraries started loading up.. Go figure.

Posted in Uncategorized | Leave a comment