Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 07:45:25 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Need help to generate a sine wave
Pages: 1   Go Down
Print
Author Topic: Need help to generate a sine wave  (Read 247 times)
0 Members and 2 Guests are viewing this topic.
jonolilley
Active Member

Offline Offline

Posts: 2


View Profile
« on: December 08, 2010, 07:45:07 AM »

I am running mach 3 to control two stepper motors in the x and y planes. I have calibrated and am now trying to input a sine wave on one axis at a time.

I am not sure how to do this, would a while loop within a subroutine be the best way....?, i am having difficulty with the syntax and not really getting anywhere.

Ideally i want a loop that has variables defined so i can alter the frequency and amplitude of the wave input.

So how can i input for example

Maximum wave amplitude x sin(wave frequency x t)

so i can change these parameters and loop them.

I am a complete noob, and using mach for a university project.

Thanks in advance
 
Jono
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #1 on: December 08, 2010, 07:56:58 AM »

The best way is to write it as VB macro and save it as an M code so you can call it from g-code.

Search the forum there are many examples of creating macros.

Graham
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
jonolilley
Active Member

Offline Offline

Posts: 2


View Profile
« Reply #2 on: December 08, 2010, 08:01:09 AM »

Thanks for your speedy response!!

I will give that a go.

Jono
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!