LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a signal in real-time, number by number

I'm looking for the simplest way to generate a sine wave and send the values to a servo motor.

 

The only thing I can think of now is to generate a signal and then use a loop comparing time stamps and increment to the next value in the array.

 

Are there any VIs that will return the current waveform value at runtime?  If the VI loops several times it could possibly return the same value until the next sample is due to be generated?

 

I want to be able to generate a single cycle of a sinewave on demand and feed those values to a servo motor.  This motor will be holding a Nintendo Wii remote and movements will cause the Wii remote's gyro and accelerometer to control game play.

0 Kudos
Message 1 of 6
(2,954 Views)

Show us (with a VI, not a picture of one) what you have so far, and someone can help you from there.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 2 of 6
(2,934 Views)

I had a really messy playground going for experimentation, so I cleaned it up.  I haven't started programming the main application yet.  I have been making all of the components work separately (motors, 3D VRML, etc)

 

This works, and I don't care about jitter because my motors and the Wiimote wouldn't care about a few ms anyway.  I was hoping there would be a better way.

0 Kudos
Message 3 of 6
(2,905 Views)

FYI, I was wrong about the jitter not mattering.  The results were a lot more inconsistent than I thought!  I have a new version of the code that uses a timed loop instead of the stopwatch wait function.  It runs the motor much smoother.

 

Same idea as the posted code segment, but replace the for loop with a timed loop.

 

Is this the best way to get what I want?

 

Thanks,

Grant

0 Kudos
Message 4 of 6
(2,896 Views)
What sort of hardware are you using?
0 Kudos
Message 5 of 6
(2,892 Views)

Dynamixel RX-24F, MX-28, MX-64 servo motors and a Windows 7 computer.

 

The RX-24F motor doesn't have acceleration or deceleration values, only speed,  so a sine wave will smooth it out rather than giving it a position target,

 

There is a wii game where you hit little ground animals on the head with a mallet.  This is the kind of motion that the motor will be emulating with the wii controller.

 

If my dad's head isn't strong enough to nod fast enough to stomp the little animal, then I want to make a button for him that will stomp the animal.  I've uploaded a short youtube movie of the 9 axis IMU controlling a yaw/pitch actuator built out of RX-24F motors.  In this movie the animal is stomped with the pitch output of the IMU.  I want to be able to either trigger the stomp at a specific pitch angle or use a physical button.

 

My dad has ALS (what Steven hawking has) and currently can't move his hands very much.  We will be mounting the IMU to his head.  I'll also include a movie of the IMU input and visualization routine that is driving the two motors in this case.

 

The final actuator will have 5 motors:

-High resolution slow speed yaw (mouse screen)

-Low resolution high speed yaw (game play)

-Pitch

-Theta (steering games, ice cream balancing style games, mouse screen)

-Roll (flipping upside down for calibrations, rotating for mouse mode, some game play)

 

And it won't involve packaging tape.  : )

 

http://www.youtube.com/watch?v=13cWH2Z91aA&feature=youtu.be

 

IMU thread:  http://forums.ni.com/t5/LabVIEW/VRML-import-center-and-rotate-critique/m-p/2737316#M809313

0 Kudos
Message 6 of 6
(2,871 Views)