Hello all,
I'm new here and also new to Arduino board, so hopping you could help.
I have a Arduino diecimila and a Dc servo Driver G320 from Geckdrive. I want to use Wiimote to run this servo motor, would anyone be interested in writing this code?
The G320 accepts an Active Low step and direction signal with a step pulse width of 2uS.
I have thought about doing this also, but have a few other projects i want to get out the way before i even contemplate buying the hardware! when i get round i'll let you know what i get. but it wont be for a few months.
Todbot uses hobby servos which from what you say above does not use the same protocol as the G320. Have search to see if you can find any Arduino G320 code. If not, read through the G320 manual to understand how to control it. If you are just starting out with Arduino, it is probably easier to break your project into two tasks: get some simple wiimote code working. Then get a simple test sketch to control your G320. When both are working separately it will be easier to get them working together.
To Pwillard: the link you showed is a wiimote contolling RC servo, this is different to DC brushed servo. I managed to Control RC servo via wiimote from the code provided in Arduino page.
To Phill: It would be very greatful if you could share the code,
To MEM: About G320, I wrote an email to Geckodrive about G320 + microcontroller, and the reply was "The G320 accepts an Active Low step and direction signal with a step pulse width of 2uS".
Here's a link of the G320 Manual: http://www.geckodrive.com/upload/G320-REV-7-Manual.pdf
I'll see what I can find more about Arduino G320 code.
Thanks Mem.
I have questions:
The code you provided, is only for 1 servo driver, right?, would it be difficult to write a code of 6 axes for nunchuck?, eg. each servo driver for each axis, X,Y,Z,A,B,C....
Ok,emm...I tried to insert an image but don't know how.....after clicking 'insert image' what should I do then?
From my quick look at the G320 it seems you need to provide the servo feeback loop in software using rotary encoders. If that is the case then it will not be an easy thing to do. Is there a reason you are not using hobby servos - they have the feedback in hardware so they are much easier to drive.
Hi Mem.
Yes it has to be DC servo motor, because It is a Robot hand, I'm making the controller for it and the wiimote will be the device that controls the diretion of the Robot Arm.
Hoping you or anyone who has the ability of writing code could help me complete my project.
I know if a step pulse is sent to the driver's 'STEP' terminal and a LOW or High (0v or 5v) at the 'DIR' terminal of G320 should make the motor run. Like you said, the G320 is almost the same as Stepper driver, the difference is the motor. Have a look at this link: http://hades.mech.northwestern.edu/wiki/index.php/Unipolar_Stepper_Motor_Driver_Circuit.
I need a code where wiimote X,Y,Z, Roll, Yaw and Pitch, each axis correspond to 1 servo driver with '+' and '-' direction for each axis.
If you are using that board with a conventional DC motor then you need some kind of positional feedback mechanism. The datasheet suggests using an optical encoder, is that what you have in mind? I am surprised you are even thinking of using that board instead of some appropriately hefty hobby servos.
Mem,
I graduated in London, Product design Engineering, and I have been playing around with Desktop cnc since year 2002, I build my own desktop cnc machines and also familiar with stepper driver + DC brushed servo driver but not good at programming. I know a littlet bit of Basic (parallax Basic Stamp 1).
There are encoders mounted at the end of the motors (encoder: +5v, 0V, A, B) and I had no problem wiring the motors with encoder to the G320, the only problem I have is programming the Arduino, that's all. Hobby servo are for small scale robots, I'm more interested in Industrial Robot, much more fun.
The code you provided earlier, do you thik you could add a few more code for other axes?
Does the G320 handle the encoder output or do you need to do this on the Arduino? The quick look I had indicates that you will need to write your own servo feedback code for each of your servos.
It will help if you clarify the functionality you want Arduino to provide. In particular, how many servos you want to use and if the Arduino sketch needs to explicitly handle the feedback from rotary encoder inputs.
hello mem,
I thought the g320 will handle the encoders feedback, is it not?, let me test your code in 3 days time and will let you know if it works.
I sent an email to Geckodrive about this and waiting for their answer.
I skimmed through the manual a little more carefully and it does do the servo control on the board. I am not sure how it knows the actual physical position of the motor when the system is powered up but I am sure you can figure that out from the manual.
I think there is a good chance the code I posted will drive the motor. One you get that going you can start thinking about generating the stepping pulses from the wiimote instead of from the serial port.
Hi mem,
I got an email back from Geckodrive and below is what Marcus replied:
"The G320 runs all of the encoder signals. The PID loop is closed internally and will not see anything but the G320. All you have to do is send step and direction signals to the G320 and it will take care of the rest."
Mem, I think your code should work will try this as soon as my work studio is setup. Will let you know soon.
I look forward do hearing how you get on. After you have the motor moving under program control you may need to think about how you can calibrate the position when the program starts. Unless your motors are always in the same place when power is applied you wont know where they are. Perhaps you could move your motors towards a switch or sensor when you start so you can associate steps with actual physical positions.
Hello Mem,
I'm back. I compiled the code successfully to arduino, and I was trying to upload a picture of the wiring, but failed, could any one guide me how to upload a picture??
You need to copy the picture to a public site like flickr and then place a the link here between the [img /img] tags (use the 'insert image' icon to get the tags, its the third icon from the left in the reply toolbar)
Nunchuck : Red = 5v, Black = GND,
Green = ?? (Analog) and Yellow = ?? (Analog).
I need to know which pin numbers should they be assigned to at the Analog?