Show Posts
Pages: [1]
1  Topics / Robotics / 3dmicro: CONTROL ARDUINO INDEPENDENTLY THROUGH LABVIEW! its finally here! on: August 03, 2012, 02:17:21 pm
For those that dont know about 3dmicro, its a toolkit designed specifically for labview, which is an extensive visual programmer developed by National Instruments. Lately, the only way to control an arduino board through labview was to use the arduino addon for labview. This addon has limitations, however, the most significant being the fact that you have to be connected to labview at all times for the addon to work.

THIS IS NO LONGER THE CASE! smiley-grin

3dmicro has recently released a beta version of their newest extension: 3dmicro arduino expansion! With this toolkit, developed specifically for labview, you can now visually program your arduino board and independent upload code to it. What does this mean? it means that YOU CAN RUN ARDUINO PROGRAM WITHOUT HAVING TO CONNECT TO LABVIEW! This is an amazing opportunity for those who are more experienced in visual programming(like me) to independently control arduino and not need a constant connection to do so.

There are other software programs that are completely dedicated to visually programming arduino, like modkit, but none are even remotely as extensive to use as labview. Im not trying to say that these programs are no good; in fact, they are very helpful for simple education purposes in visual programming, and will definitely have a significant impact on helping younger students explore the world of programming. For the more experienced visual progammers, however, these programs offer a very limited amount of options. Ive tried other visual programmers as well, but none are quite as easy to use and as extensive as labview. now that the 3dmicro arduino extension is finally coming out, extensive visual programming of arduino is finally possible!

For those who are interested in 3dmicro arduino expansion, you can request the beta software by filling out this simple application:

http://www.3d-svs.com/3dmicro-toolkit/beta-testing-arduino-expansion

the application is very simple to fill out, and you should receive a response pretty quickly.
if you have any questions, you should check out the 3d-svs site for more information: www.3d-svs.com
2  Development / Suggestions for the Arduino Project / Re: ARDUINO VISUAL STUDIO (an arduino based VPL thats better than LIFA for labview) on: July 17, 2012, 04:24:53 pm
unfortunately im no where near advanced enough to write such a code, although im pretty sure any one would a decent education would find it to be more than possible to make. Other than creating a visual interface, the code should be somewhat simplistic, as you're basically substituting icons for code. Although it might be harder than that, as im still a beginner.
3  Using Arduino / LEDs and Multiplexing / Re: 3-phase sine wave generator(pwm)---finished design on: July 14, 2012, 11:17:06 am
i'm pretty sure it should work on brushless dc motors. in fact, its for this very reason i created this code. i havent tested it out on a dc motor yet, but i have tested it out on led's, which seem to work exactly as they would from a 3 phase pwm sine wave.

just remember to hook up each of the 3 motor inputs with a low pass filter, which should smooth up the operation a little.
4  Using Arduino / LEDs and Multiplexing / 3-phase sine wave generator(pwm)---finished design on: July 14, 2012, 10:56:12 am
This topic is not a request for help on my project, im simply posting code for my most recent project.

Any one having trouble creating (or are looking for) code to make a muliphase sine wave generators? I know i was, and thanks to the help of tmd3, my design is finally finished. Anyone who needs such code feel free to download it, and once again, THANK YOU tmd3 for all your help! this woud've never been possible without your help! so thanks!

The generator has 3 outputs: out1, out2, out3. It also has 2 inputs: enable (pin smiley-cool, and freqpin (pin A0). the enable pin (pin smiley-cool, enables the generator whenever its value is HIGH. Remember to connect this pin to a resistor connected to gnd, or the board wont be able to tell if the input is HIGH or LOW. The freqpin (pin A0) is connected to the center(second) pin of a pot, which has its first pin connected to 5v and the 3rd to gnd.

anyway, feel free to download the code for your own projects! also, make sure you compile the code before uploading it to your board, as i compiled this code to upload to my arduino leonardo. Uploading to other boards should still work, just make sure you compile it to upload to your board.

READ THIS IF YOU WANT TO MODIFY THE CODE:

-The frequency of the generator is controlled by a pot. The specific code for that is the delay in the loop, which should come up as delay(freqpin). If the pot isnt making the generator operate at a high enough frequency, change delay(freqpin) to delay(freqpin/#) the number of course being an integer. the greater the integer, the higher the frequency. The same thing applies to lowing the frequency, only instead of dividing by #, you muliply, and the greater the number for that, the lower the frequency.

-The resolution of the sine wave is controlled by const float y = pi/30. I RECOMMEND THAT YOU DO NOT TAMPER WITH THIS VALUE. if you want to change the resolution, however, MAKE SURE THE EQUATION IS AS FOLLOWS: const flat y = (#1)*pi/3*(#2). The greater the value of #1 is, or the lower the value of #2 is(NOT COUNTING 0), the lower the sine wave resolution will be. To increase the resolution, increase the value of #2 and decrease the value of #1(NOT COUNTING 0). Make sure that #1 and #2 are POSITIVE WHOLE NUMBERS.
5  Development / Suggestions for the Arduino Project / ARDUINO VISUAL STUDIO (an arduino based VPL thats better than LIFA for labview) on: July 14, 2012, 10:36:08 am
Writing code takes a lot of skill to do, yet even with some experience, more complex codes can still prove to be a problem to write out and compile. There is a module in labview for interfacing with arduino, and its called LIFA(labview interface for arduino). Although this module can prove useful for complex coding, anything designed on it cant be uploaded to the arduino board and instead has to be controlled directly from labview.

Arduino visual studio would fix that problem. It would be a completely independant VPL designed specifically for uploading code to an arduino board. Basically, its icons would be somewhat similar to the basic programming icons on labview, such as arithmetic operations and loops. The difference, however, would be that these icons are all visual references to the code found on the arduino references page. This way, visually created code could be uploaded to the arduino board directly, instead of having to use a separate program to control the arduino's actions al-together. The functions on the arduino visual studio would greatly improve the simplicity of making more complex codes, yet still be much easier to use than labview. In addition to that, people wouldnt have to spend over $3000 for the labview program.

The first versions of arduino visual studio would probobly consist of basic functions referenced on the arduino reference page, but, if successful, could eventually grow to include actual simulation of the programs, and even have the ability to create and upload code from one giant program into several arduino microcontrollers for larger projects. There are lots of people who like to do things visually, but there isn't much visual programming software out there that allows the user to upload code onto microcontrollers. Any software that does, however, is usually extremely extensive and complicated, negating the significance of using a VPL to upload code to a microcontroller. With the arduino visual studio, the VPL would be focused solely on working with arduino's and similar microcontrollers, thus significantly simplifying the visual programming process. Such benefits would greatly increase arduino productivity and sales, thereby being a significant benefit to both Arduino.cc and its users.

This is only an idea, but with support it could become a reality.
6  Development / Suggestions for the Arduino Project / copy and paste board(to make writing code faster+easier) on: July 14, 2012, 10:17:02 am
Has anyone ever used the copy and paste board on microsoft word? basically, every cut and copy you make is stored on a table for future use. Something like that on the arduino compiler would be nice, as well as having the option to assign hotkeys for pasting certain code. Since a lot of code is usually repeated, it would make writing a program a lot faster and easier.
7  Using Arduino / Project Guidance / Re: 3-phase sine wave generator(pwm)---need help with code on: July 14, 2012, 10:12:50 am
Thank you so much for your help! i've re-written the code according to your advice, and the led's seem to do exactly what i want them to. here is the revised code for the 3-phase sine wave generator:

int led1 = 11;
int led2 = 10;
int led3 = 9;
const float pi = 3.1415;
float x = 0;
int enable = 8;
int freqpin = A0;
unsigned char p1 = 0;
unsigned char pp1 = 0;
unsigned char pp2 = 0;
unsigned char pp3 = 0;
unsigned char p2 = 0;
unsigned char p3 = 0;
const float y = pi/30;
const float ph1 = 2*pi/3;
const float ph2 = 4*pi/3;
const float ph3 = 2*pi;

void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(enable, INPUT);
  pinMode(freqpin, INPUT);
}

void loop()  {
 while(digitalRead(enable) == HIGH) {
  x = x + y;
  analogWrite(led1, p1);
  analogWrite(led2, p2);
  analogWrite(led3, p3);
  pp1 = 126*sin(x+ph1);
  p1 = pp1+128;
  pp2 = 126*sin(x+ph2);
  p2 = pp2+128;
  pp3 = 126*sin(x+ph3);
  p3 = pp3+128;
  if(x >= 2*pi) x = 0;
  delay(freqpin);
}
analogWrite(led1, 0);
analogWrite(led2, 0);
analogWrite(led3, 0);
x = 0;
}


thanks again for your help! smiley-lol
8  Using Arduino / Project Guidance / 3-phase sine wave generator(pwm)---need help with code on: July 13, 2012, 09:02:23 pm
I'm usually used to using the labview interface for arduino, but lately i've been trying to write my own code on the arduino compiler/uploader. I've already been able to use labview build a working 3-phase sine wave generator using the pwm outputs of my arduino uno, and the code i wrote works on relatively the same basis as the one on labview. here is how it's supposed to work:

upon pressing an external push-button, the code should enter a loop where 3 outputs are constantly updated at a rate proportional to a pot. the dead time of each of the 3 outputs is controlled by a sine function which outputs a value from 0-255, and each output has its separate equation for determining its dead-time. each sine function uses the variable x, which is supposed be the value of a counter, which  by increases by pi/120 each cycle, and resetting to 0 when x=2*pi. im using 3.14 for pi. when the button is released, the 3 outputs are all supposed to go to LOW, and x is supposed to reset to 0. unfortunately, writing code for a counter is a lot harder to make than on labview, and the counter is essential for x to increase.

anyway, here is the code(the outputs are labeled led1, led2, led3, since i'm first going to test the sine wave output on LED's):


int led1 = 11;
int led2 = 10;
int led3 = 9;
const double pi = 3.14;
int x = 0;
int enable = 8;
int freqpin = A0;
double p1 = 0;
double p2 = 0;
double p3 = 0;
const int y = 1;

void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(enable, INPUT);
  pinMode(freqpin, INPUT);
}

void loop()  {
 while(digitalRead(enable) == HIGH) {
  x = x + y;
  analogWrite(led1, p1);
  analogWrite(led2, p2);
  analogWrite(led3, p3);
  p1 = 127.5*sin(x+(2*pi/3))+127.5;
  p2 = 127.5*sin(x+(4*pi/3))+127.5;
  p3 = 127.5*sin(x+(2*pi))+127.5;
  if(x = 2*pi) x = 0;
  delay(freqpin/10);
}
analogWrite(led1, 0);
analogWrite(led2, 0);
analogWrite(led3, 0);
x = 0;
}


anyway, when i upload the code and press the button, the 3 led's light up, each one at a difference brightness, as expected, but they all stay that way. the brightness on each led doesn't change, which leads me to conclude that the counter isnt working.

what changes(if any) should i make to the code to make it work?
9  Using Arduino / Installation & Troubleshooting / Re: Arduino leonardo uploading board problem (Rx stuck on) on: July 11, 2012, 06:22:03 am
FIXED THE PROBLEM--READ BELOW IF YOU HAVE THE SAME PROBLEM

for those who have the same problem, go to this thread and read the 2nd to last post posted by mellis.
http://arduino.cc/forum/index.php/topic,110103.0.html
10  Using Arduino / Installation & Troubleshooting / Arduino leonardo uploading board problem (Rx stuck on) on: July 10, 2012, 07:42:52 pm
ive recently been starting to work with my arduino leonardo board, and everything was working well until i uploaded code for a sine wave generater i found online. the program started uploading, but never finished. i decided to try disconnecting and then reconnecting the device to try again, but it wont upload. the Rx led stays on whenever i connect the board to my pc via the usb connection. if i connect it to an external power supply instead, the Rx led doesnt light up. the board still give 5v and 3.3v in the designated pins, which seems to indicate that the chip isnt fried.

what exactly is wrong? how can i fix this problem?
Pages: [1]