02-17-2014 04:59 AM
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.
02-17-2014 07:26 AM
Show us (with a VI, not a picture of one) what you have so far, and someone can help you from there.
Cameron
02-17-2014 03:59 PM
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.
02-17-2014 06:03 PM
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
02-17-2014 06:30 PM
02-17-2014 08:19 PM
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