Closed dfarrell07 closed 10 years ago
Thanks for the kind words!!
On your points:
So, yes, you basically understand the code, except for the confusion on the PID modes.
As far as the timeline for the Python interface, I got sidetracked on working on the PRU (Programmable Realtime Unit) code on the Beaglebone in order to read the iGaging DRO scales to CNC convert my manual lathe (see my blog at http://exadler.blogspot.com/). The PRU seems to be needed because of random delays in Angstrom Linux that stretches out the pulse every so often (I was seeing it about 4% of the time). However, if you need the Python interface now, I can get back to finishing up the rest of the methods in the next week or so.
I'm glad you are thinking of using it for a robotics project, as that's what I had originally intending this board to be used for, and I would love to see pictures of your robot in action!
However, you can change direction of the motors by simply giving setMotor a negative number (positive numbers move it forward, negative numbers reverses the polarity).
Okay, very good to know!
In order to use it in PID mode (yeah, the code comments need to be cleaned up a bit), just call setTargetVel (for velocity PID mode)
Okay, so replacing setMotorPower(session, nMotor, nPower);
with setTargetVel(desired_vel, motor_num)
in DMCC-py.c
(and updating associated code to get desired_vel instead of nPower, of course) would result in setting motor_num motor to run at desired_vel, which it would maintain using the PID logic? How would you change the direction while using setTargetVel (since the velocity param is unsigned)? Add logic in setMotor
that calls configMotorDir
with the desired direction?
As far as the timeline for the Python interface, I got sidetracked on working on the PRU (Programmable Realtime Unit) code on the Beaglebone in order to read the iGaging DRO scales to CNC convert my manual lathe (see my blog at http://exadler.blogspot.com/).
Yeah, I saw that on your blog. We have some people working on the PRUs as well, for use with our ultrasonic sensors. We're pretty early into that work, but I'd be happy to share our codebase with you, especially once we have something useful in that domain. It's open source, but a private GitHub repo for now.
However, if you need the Python interface now, I can get back to finishing up the rest of the methods in the next week or so.
That would be awesome, if you don't mind. We'll be glad to help with development as much as we can, but we're pressed for developer bandwidth, so your support is invaluable.
I'm glad you are thinking of using it for a robotics project, as that's what I had originally intending this board to be used for, and I would love to see pictures of your robot in action!
We'll share some with you ASAP. :)
Yes, just exposing setTargetVel will result in setting motor_num motor to run at desired_vel using PID logic, and yes, you did find a bug in the code. desired_vel should be a signed int!! We'll get that fixed and tested asap.
Yes, just exposing setTargetVel will result in setting motor_num motor to run at desired_vel using PID logic
Great! That's all of the questions I have for now. Thank you so much for your awesome, very fast support! I can't commit before I hear back from the rest of the team, but my doubts about whether this is the board for our project have been assuaged.
you did find a bug in the code. desired_vel should be a signed int!! We'll get that fixed and tested asap.
Glad I could help. :)
I would like to second the thanks for awesome, fast support!
Hello!
First, this looks like an awesome project! The university robotics team I lead is considering buying three of your boards for our current robot, but we have some questions about the Python interface (our codebase is in Python). Basically, are these aspects of my understanding of the codebase correct?
setMotor
. So, for example,configMotorDir
isn't exposed, which implies that it's not possible to change the direction of the motors.setMotor
resets the PID constants to hard-coded values in its call toDMCCstart
. The ways to set the PID constants to user-defined values aresetPID.c
andsetPIDConstants
inDMCC.c
, which are not exposed by the Python interface.setMotor
usessetMotorPower
instead ofsetTargetVel
. Based on my understanding ofDMCC.c
, that implies that PID control is not actually used bysetMotor
.Do I understand the code correctly in these regards, or did I miss something?
On a related note, is there a timeline for the development of the Python interface?
Thanks again for your work on this awesome project! I hope we can work together to help it mature, both for the sake of our robot and for the development of this seemingly much-needed project.