Hey guys, im looking at this here:
http://www.robotshop.com/ca/en/net-gadgeteer-servo-motor-expansion.html
Its a servo thing for gadgeteer, but it is not made by GHI. Would anyone be able to help me program it here, or would I need to bug their community to help?
Also, with the netduino not being Uber-Realtime, would it work with controlling servos well?
What type of help are you looking for?
That is almost an analog for this: https://www.ghielectronics.com/catalog/product/405
Cool, do those ship with cables or not?
Without.
I think thatâs the DHRobot servo module:
Unfortunately, it doesnât look like thereâs much by way of documentation other than the wiki:
And it doesnât look like they supply a driver, so youâd probably need to write some code to make it work.
As @ iamin noted, this is similar to a breakout, the difference being the convenience of being able to provide a separate power supply voltage for the servos via the screw terminals, where with a breakout youâd need to use a breadboard or perfboard to do that.
In terms of running the servos, if you want to try with a breakout module or extender module, I posted some code here that might help as a starting point:
https://www.ghielectronics.com/community/codeshare/entry/343
Itâs a couple years old, so itâs likely that some of the namespaces and/or APIs may have changed, but you can get started with some of the concepts, at least.
I believe thatâs definitely the DFRobot module.
Itâs also very close to Justinâs ServoTidy module. I wrote a quick driver for it not long ago but I think Justin may have one also but it doesnât show up in his downloads currently. But, this would be a good starting point for you.
I think it is important to realize/mention that the âservo expansionâ module doesnât give you any extra PWM/servos. Itâs essentially a glorified header, more than an âexpansion.â You just have the ability to connect separate power, with a switch, and your servo(s) to whichever pin or pins are being used by the socket you choose⌠but thats it. If your socket has one PWM pin, you can use one servo⌠just like you could if you used a generic socket breakout.
I bought one a few months ago without looking closely at it. I didnât realize that it didnt provide any actual âexpansionâ - so it sits unused in a drawer, ready to be thrown in my next ebay auction lot of regretted purchases.
I suppose it might be useful on socket 18 of the raptor - at least it would expose 3 of the raptorâs 4 PWM pins. But a standard gadgeteer extender or socket breakout would be just as useful really.
@ mtylerjr - Very good point. Just having the 3-pin headers that you can plug the standard servo plug into is good enough reason to keep one around, though. It takes a little more hackery to make it work with the Breakout module. âRapidâ prototyping is what Gadgeteer is all about. If you have to stop and solder to a Breakout then the gain is lost.
Iâve been thinking about this and built a âmoduleâ that drives 3 servos using the DFRobot servo expansion module. All you do is plug in your servos, configure them as needed (min/max frequencies etc) and away you go as code is as easy to do as
servoMotorExpansion.Servos[0].Center();
servoMotorExpansion.Servos[1].Center();
servoMotorExpansion.Servos[2].Center();
for example or
servoMotorExpansion.Servos[0].TurnPercent§;
servoMotorExpansion.Servos[1].TurnPercent§;
servoMotorExpansion.Servos[2].TurnPercent§;
I ordered some Continuous Rotation Servos tonight to see just how generic I can make this âmoduleâ. I also wanted to try indexing items as I know someone who like doing things that way.
Once Iâm done Iâll post my driver/module and hopefully it makes it easy for someone else to start playing around with servos as its the joy of âexpansionâ modules, they can become anything you want them to be and with Gadgeteer we can share those easily.
So given this module can control up to 3 servos, how would you like to reference them? Like this:
servoMotorExpansion.Servos[0].TurnPercent§;
servoMotorExpansion.Servos[1].TurnPercent§;
servoMotorExpansion.Servos[2].TurnPercent§;
or like this
servoMotorExpansion.Servo1.TurnPercent§;
servoMotorExpansion.Servo2.TurnPercent§;
servoMotorExpansion.Servo3.TurnPercent§;
or some other way?
Movement wise I have:
Center()
MaxClockWise()
MaxCounterClockWise()
TurnToFrequency(uint hightime)
TurnToPercent(double percent)
TurnToAngle(double angle)
and incremental movements
TurnAngle(double angle)
TurnPercent(double percent)
anything else?
If I were picking, I would choose the second reference method. I understand why arrays start a zero, but Iâve never liked it.
I would prefer the zero-based array approach, where the Length property returns the max number of servos. In my opinion, the array approach makes it easier to visit each servo in a loop, without hard-coding the individual servo names (e.g., to center them all).
What?
Blasphemy!
1-based arrays are bad and you should feel bad!
[dont take me too seriously]
Agreed!
Also, you might add a .Move(direction) function for continuous-rotation servos where you might want it to just keep moving without having to continually tell it to take small turns.
If thereâs a continuous rotation Move method, then a Stop method would be handy.
@ mtylerjr - Iâm an old COBOL developer with emphasis on the old.
@ rileysuit -
Wonât hold that against you. Ancient assembly language, Pascal, and Fortran programmer over here.