This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Simple solution for motor control?

Other Parts Discussed in Thread: ENERGIA

After much trial and error with the stellaris launchpad I was able to get 2-3 servo's working with basic functionality using a xbox controller connected to my laptop.

This worked but on the other hand wasn't really that versatile enough for what I'm looking to do, I just recently acquired 2x tiva C launchpads and to my understanding they include hardware for pwm so it should be easier to get motor's up and running. What I've been trying to do for the last year since I found out about the TI launchpads is control a few servo's to make a tracking or gamepad controlled telescope mount. Does anyone know how to implement arduino coding if I could find a library to do this (there is one for using a ps2 controller and i'm sure there are a million servo libraries) or any gui around that would simplify this? I basically just want to make a few axis mount and then have a webcam connected to the back of the telescope so I can track objects and take long exposure shots for clarity, maybe use blender software to lay an image down as a map and have the servo/stepper motors control position and If thats not working then a gamepad so I don't have to break my neck looking through the view finder. Any help would be greatly appreciated as I've been trying to accomplish this for far longer than it should take me.

 

This is really similar to what I want to do!

http://hackaday.com/...ith-blender-3d/

  • Hi James

    Have you taken a look at Energia? It is an open-source platform that brings the Arduino framework to the TI LaunchPad systems.

    I'm not sure of its capabilities, but it is probably worth taking a look at. Both the Stellaris and Tiva C LaunchPads are supported by Energia.

    -David

  • Yeah I supposed I would seeing how there is probably a million servo control libraries. I wish someone that knew a resource for implementation could chime in or ill just need to figure it out and then post back with my results! I have an old ps2 controller I was looking at yesterday and a wired xbox 360 thats plug and play with a pc so if there was a gui that could let me set the length of pulse and then give it direction i'd be good to go.

  • Do you know much of the difference between the tiva c and stellaris? Supposedly the stellaris didn't have PWM function hardware implemented but I was able to get two servo's working with a terminal and basic coding but that wasn't really going to suit my needs as I need to be able to control 4+ servo's with various button presses from a gamepad to control anything from telescope pointing location (pan, tilt), Zoom, Lens change and if I incorporate a IR laser for night time viewing it would need to have a lens with adjustable zoom.

  • The major differences are that the Tiva C LaunchPad added hardware PWMs and USB Host and OTG (the Stellaris is only USB Device).

  • Do you mind explaining further? Such as what the hardware on board for pwm is and functionality, what is USB host function and OTG? Thank you very much so far you have been a lot of help!

  • "Hardware PWM" refers to the microcontroller itself having a PWM peripheral module internal to the chip.

    Based on what you described before, you probably selected an output pin and turned it high for your servo pulse time and then low again for the remaining time. This is one form of a software PWM, the waveform is controlled by software.

    The PWM peripheral inside the microcontroller has the ability to take configuration parameters set by your software and control an output pin on its own, in hardware. Kind of a "set it and forget it." This is beneficial when you want to do more than wiggle IO pins with your software. Any delays or interrupts in your code can cause jitter in your software PWM signal. 

    There are two major types of USB "things" - USB Devices and USB Hosts. USB Hosts are like your computer. They are the host to other USB devices. USB Devices talk to the host, like your mouse or keyboard. Devices can't normally talk to other devices without going through a host. USB On-the-go (OTG) is a way for a device to switch from being a Host or Device on the fly. This allows two USB OTG devices to talk to each other, like a camera and a printer.

    A quick Google search will do a much better job of explaining than I can.

  • Stellaris David said:

    A quick Google search will do a much better job of explaining than I can.

    Don't be so sure - our group really liked the tech depth & "spirit" of your writing.  We wondered how (even if) you'd handle this.  Very well done!    (We'll clap as soon as our SW PWM signal escapes its jitter...)

  • I See so basically you described the debug function on the mini board attached to a section of the MC. Alot of that is common sense and I should have figured but   is correct, now-a-days you would be hard pressed to find real information related to what your search query is and, unfortunately, Its like google used to bring you to a room with a magic book with all the knowledge you could want in it, almost within the first 5 results. Now with all the advertising and privacy blocking its like taking you to a room full of box's and in one of those box's is a bunch of unorganized papers containing what you want... I think you are correct as far as moving those servos yet, it wasn't my coding and although it was basic such as using the "+ and "-" key to control speed(pulse rate in ms), "8numpad" and "2numpad" to select which pin (or servo connected to that pin) and a few other commends surprisingly there was not a whole lot of jitters in the motion  or noise for that matter!   you couldn't use a hv cap in the line to smooth out the signal? Maybe that and a diode on the positive pin.


  • @ James,

    Active w/some regularity - this forum - similar others - thought that David did very nice job - re: your issue. 

    PWM signal referenced was substantially, "poetic license" - and would likely transition only between 0V and 3V3.  Cap - unless charge/discharge R's were well chosen - would likely skew and/or otherwise alter our signal...

  • Assuming for \TI staff and other members is somewhat magnanimous of you. I apologize if my post sounded condescending and I understand what most of the functionality of this board. My question must have been misunderstood as I'm more or less looking for a gui/plugin based solution like energia/teriminal/xpadder to control a diy tracking mount for a telescope... If it was so simple I would haven't have posted on a forum where I purchased the product itself. Regardless thanks for the help so far guys!

  • Okay so I found a temporary solution and If anyone is looking for something similar here's what I did:

    Used an example code by emklaus on stellarisiti  forum: http://forum.stellarisiti.com/topic/496-hobby-servo-motor-project-tutorial/

    Commit it to the board with Code Composer studio debug function. Then open up terminal and set the baud and comm port to the specifications in the read me file included in the download (FYI you can find the com port stellaris is connected to in device manager).

    Then use pins pf1-pf3 to connect servo's (you will need an external power supply for 5v).

    Then if you have an xbox controller I used:  http://xpadder.com/ to set button presses to keyboard functions like X,A,B buttons to select servo's and the D-pad to increase or decrease speed of movement.

    Works for now but very limited and hard to adjust without keeping an eye on your terminal.