Libert Basic and Pololu jrk 21v3

I’m considering purchasing the JRK21V3 to control a DC Gear Motor but I am terrified of C and want to avoid the complications of its installation if at all possible. I know BASIC fairly well and am using Liberty Basic to control my current Motor drive board (Known as a MotorBee) via the .DLL that came with the board. (I don’t really get .DLL calls, but the good people at the Liberty Basic forum helped me enough that I was able to make the motor go left/right when needed.) Can anybody tell me if they have used Liberty Basic to control a motor through the JRK21V3. My current board can only supply 600mA and I need to find something that can handle more current. The JTK21V3 looks ideal, but I’m worried about my ability to integrate it into my software routine. Thanks in a dvance for the help.

Hello,

In the future, please do not post to the forum without mentioning that you have separately emailed us and posting a summary of what we talked about - otherwise you are definitely going to waste the time of whoever responds to this. Something like “I understand that I am supposed to open a connection to a COM port, but I do not understand how to send binary data in Liberty Basic” would be helpful. That way, they do not have to start by telling you what you already know.

Also, I really doubt that there is anyone out there who has used Liberty Basic with the jrk, so you should probably post a much more general question about binary data to the Liberty Basic forum and link to that post from here for completeness.

In any case, if you do learn how to do it, please post your code!

-Paul

Excuse me, but I was under the impression that the forum was user-manned and wasn’t expecting to only be speaking to the forum administrator. I was looking for help for my question from a broader audience. I cerainly didn’t wan to waste anbody’s time. You, of course, always have the option of ignoring posts you don’t feel are worthy.

Hello,

Of course I understand that you are not trying to waste anyone’s time, and I really want you to get your help, so I am not going to ignore your post. (Besides, it takes a coordinated effort on our part to “ignore” something, and it only makes us look unhelpful.)

The point I was trying to make is that if you want help with something, you should summarize the other help you have received so far. This lets you ask your questions more specifically and avoids wasting the time of whoever helps you. Otherwise, someone who knows what I know might see your question and tell you exactly what I told you already, whether it is a Pololu employee or someone from the community.

-Paul

I did as you suggested and posted a request for assistance on the Libert Basic forum and was able to get the motor to respond from Liberty Basic. The toughest part was trying to figure out how to express “magnitude” from the descriptions in your documentation. (It would be perhaps helpful to add an example to the E1 and E0 command documentation.) After some trial and error I was able to move the motor in direction A with E1,7F and in the other direction with E0,7F. Everything seems to be working as advertised except I haven’t been able to figure out the current settings. I have nothing (no load) attached to the motor and have the Max Current set for 1A and if I set an Error property to enable if Max Current is exceeded it fires as soon as I try to energize the motor. I’ll fiddle with it some more, but it’s hard to believe the startup surge could be going over 1A for such a little motor. If I’m interpreting something wrong please holler back. Thanks.

Great, I am glad you got it working. Here is a link to the thread in case other people are interested in this question. In the documentation we say that the magnitude can be from 0 to 127 and that in speed control mode, “a magnitude of 127 will set the duty cycle target to full-speed forward (+600), while a magnitude of zero will make the motor stop.” What other examples do you want us to add?

Have you tried looking at the graph of current in the Jrk Configuration Utility, and do you have any other way of measuring it? Your motor might take 1 amp (I have not seen it, so it is easy for me to imagine), and your current could be miscalibrated. However, in general, a motor will draw its full stall current if you set it instantly to full speed, since it will not instantly start turning. So to use a current limit effectively you should probably also be limiting acceleration, either in your software or in the jrk configuration.

-Paul

Actually you do show an example of E17F for setting the Target to 4080, but it’s back on page 27 and I had jumped forward to “Motor Commands”. Then, in attempting to compute “magnitude” as described near the bottom of page 30 I got thrown off (I’m using no feedback) by the “Target=2048+(600/127)xmagnitude”. The way I did the math to set the Target to 4080 (or 2048+2032) would require a magnitude value of 430. (2032=4.7244094*430). Although I did pretty good in Algebra, I’m sure I’m the only one who doesn’t understand why 127 is actually the correct answer to set the Target to 4080. Thanks for the explanation of the motor current. I have never really understood the current demands of these motors, but I am using a 2A motor (one of yours) so knowing that it instantly draws stall current under a no-load startup is very helpful.The documentation is perfect - don’t change a thing.

Hello,

I think that your math is fine but you are misunderstanding the meaning of a target setting in no feedback mode. The PWM values go from -600 (full reverse) to +600 (full forward), which we represent as numbers from 2048-600 to 2048+600. So a target of 2648 is full forward, not 4080. Does that make sense?

It is a bit confusing, I agree!

-Paul