Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / Re: PID signal to SERVO signal conversion. on: January 16, 2014, 07:00:53 pm
Quote
You really don't need to map anything. The library also has a function to set output low and high limit values so if you just set them to 0 and 180 those will be the only value range that you call the servo write function with. The PID will handle the rest.

I see, thank you.
2  Using Arduino / Programming Questions / Re: PID signal to SERVO signal conversion. on: January 15, 2014, 11:15:36 pm
Well, after analyzing the PID library some more I've extracted the following "concept".

Code:

error = setpoint - input;
I_term += error;
D_term = (input - last_input);

output = kp * error + I_term - kd * D_term;


With this simple code I should get an output that can go either positive or negative.. Then all I have to do is map that properly to the Servo position.

So far I've implemented the P_term (error) part of it with a potentiometer as the Kp adjustment and it's seems to be working.... I'm in the process of adding the I_term now and eventually the D_term.

My problem has been the output format in the library.
3  Using Arduino / Programming Questions / Re: PID signal to SERVO signal conversion. on: January 14, 2014, 08:00:05 pm
Thank you PaulS and MarkT for your valuable input.

I've talked with a few other engineers about this PID to Servo issue and after hearing all this input including from you two here's what I'll do:

I'm digging around the PID library and I'll just take the most essential math algorithm part of it and focus on the P term only.

Then figure out the translation between Error Difference and RPM and Servo position.

I think if I can get that much going the rest is all down hill.

Thank you.
4  Using Arduino / Programming Questions / PID signal to SERVO signal conversion. on: January 13, 2014, 08:23:20 pm
Hi all.

I'm using <PID_v1.h> on a servo controlled throttle body. The Arduino gets a Hall sensor signal from a flywheel of a generator, this is the INPUT of the PID.. The user defines the RPM with a pot, this is the SET POINT. And the OUTPUT of the PID is a signal that is meant for a heater element or an Air Conditioning, but I want to convert that signal into a Servo signal that regulates a Throttle body..

Any clues? I basically have everything build up and working except this last major step.. I've been scratching my head over this problem for a few weeks now and could really use a hint or two.

And I'm processing all my output and input signals directly with Hardware Timers so all my signals are very accurate... Just need to convert that PID heater signal to a Servo signal.

Thanks.
5  Using Arduino / Project Guidance / Re: legal implications. on: March 27, 2013, 10:50:21 pm
Thanks for all the AMAZING advice....

I realised after reading all this that I'm simply making custom R&D tools which will not see the public eye for now..... However maybe some time in the future there might be talk of releasing some version of these tools...

Thanks again.
6  Using Arduino / Project Guidance / Re: legal implications. on: March 23, 2013, 05:53:39 pm
Quote
Quote from: k7michal on Today at 08:08:39 PM
Knowing that Arduino is all open source how does this affect the Agreement?

You need to hire a lawyer for that question.  I suggest doing it sooner rather than later.  The Arduino API is licensed under LGPL.  I believe you can find the exact version in the source files.

Yes, thank you I'll look into it.

Quote
Quote
I imagine that ultimately the code cannot be copy written...

The code you develop?

yes the code that I write.


Quote
Your code is yours to do with whatever pleases you.
Aren't you going to run your program on a standalone Atmega chip anyway?

yes it's a standalone project.

7  Using Arduino / Project Guidance / legal implications. on: March 23, 2013, 03:08:39 pm
Sorry I don't know where else to post this, so please redirect this topic if you know where it belongs.

I'm an Arduino programmer and I access the Atmega328 on the hardware register level, so in a way I'm going beyond the standard Arduino language. I'm also creating projects for a company and they want me to sign a legal Agreement which talks about "Intellectual Property" and ownership.

Knowing that Arduino is all open source how does this affect the Agreement? Where is the distinction between regular programming practices and Propriotery methods?

I imagine that ultimately the code cannot be copy written and the Intellectual Property is in the specific approach to the project..

Any info is appreciated.

M.
8  Using Arduino / Microcontrollers / Re: no serial output on "Arduino MICRO". on: February 25, 2013, 11:13:40 pm
yes.... I got a little confused with the new pinout...

Alas, all my issues stemmed from improper coding, pin assignments, and improper hardware wiring of the encoder....

Serial.print works like a charm even though Arduino IDE says the com port is busy or whatever....

Thank you for being available.
9  Using Arduino / Microcontrollers / Re: no serial output on "Arduino MICRO". on: February 25, 2013, 10:21:08 pm
Thanks James.

I tried the Terminal commands and got something like this:

Code:

k7michal$-MacBook-Pro:~ k7michal$ lsof | grep /dev/tty
bash      4051 k7michal    0u     CHR               16,0  0t124817     855 /dev/ttys000
bash      4051 k7michal    1u     CHR               16,0  0t124817     855 /dev/ttys000
bash      4051 k7michal    2u     CHR               16,0  0t124817     855 /dev/ttys000
bash      4051 k7michal  255u     CHR               16,0  0t124817     855 /dev/ttys000
lsof      4069 k7michal    0u     CHR               16,0  0t124817     855 /dev/ttys000
lsof      4069 k7michal    2u     CHR               16,0  0t124817     855 /dev/ttys000
grep      4070 k7michal    1u     CHR               16,0  0t124817     855 /dev/ttys000
grep      4070 k7michal    2u     CHR               16,0  0t124817     855 /dev/ttys000

That's the only time I got a response for the Terminal....

I don't know man, I'm getting some funny operation with the Serial Monitor.. sometimes while compiling Arduino IDE tells me the serial port is busy, and sometimes it isn't....

I'm testing out a rotary encoder with INT2,3 on the MICRO and I usually I'm getting the initial Serial.println("Goodnight moon") in the set up, but after that it's not working.... this leads me to believe that there is an issue with my test code, amongst other things.... not to mention the MICRO handles serial com a little different... I'm just gonna keep on isolating the bugs..

here's what I'm testing:

Code:
int pulses, A_SIG=0, B_SIG=1;

void setup()
{
  attachInterrupt(2, A_RISE, RISING);
  attachInterrupt(3, B_RISE, RISING);

   Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.println("Goodnight moon!");

}

void loop()
{
}

void A_RISE()
{
  detachInterrupt(2);
  A_SIG=1;
 
  if(B_SIG==0)
  pulses++;
  if(B_SIG==1)
  pulses--;
  Serial.println(pulses);
  attachInterrupt(2, A_FALL, FALLING);
}

void A_FALL()
{
  detachInterrupt(2);
  A_SIG=0;
 
  if(B_SIG==1)
  pulses++;
  if(B_SIG==0)
  pulses--;
  Serial.println(pulses);
  attachInterrupt(2, A_RISE, RISING);
}

void B_RISE()
{
  detachInterrupt(3);
  B_SIG=1;
 
  if(A_SIG==1)
  pulses--;
  Serial.println(pulses);
  attachInterrupt(3, B_FALL, FALLING);
}

void B_FALL()
{
  detachInterrupt(3);
  B_SIG=0;
 
  if(A_SIG==0);
  pulses++;
  if(A_SIG==1)
  pulses--;
  Serial.println(pulses);
  attachInterrupt(3, B_RISE, RISING);
}




10  Using Arduino / Microcontrollers / Re: no serial output on "Arduino MICRO". on: February 25, 2013, 03:26:38 am
there is nothing else connected!

I even made sure the hardware was using INT2 and INT3 so as to not interfere with any serial port.
11  Using Arduino / Microcontrollers / Re: no serial output on "Arduino MICRO". on: February 24, 2013, 05:09:17 pm
yes thank you!

I eventually found this and another reference:

http://arduino.cc/en/Main/ArduinoBoardMicro

and I tried using serial1 and that hasn't produced anything.... so far the only thing that worked for me on the Serial Monitor was the "softwareserial" library, and it doesn't even work that well. I get what seem like 64byte dumps once in a while.

http://www.arduino.cc/en/Reference/SoftwareSerial
12  Using Arduino / Microcontrollers / no serial output on "Arduino MICRO". on: February 24, 2013, 05:16:57 am
I am running Arduino 1.0.3 on Mac OSX 10.6.8.

I've managed to upload a program on the MICRO board and trying to read the serial signal but nothing happens. However I get this statement while compiling:

Code:

processing.app.SerialException: Serial port '/dev/cu.usbmodemfa131' already in use. Try quitting any programs that may be using it.
at processing.app.Serial.touchPort(Serial.java:119)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:201)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1682)
at processing.app.Sketch.exportApplet(Sketch.java:1627)
at processing.app.Sketch.exportApplet(Sketch.java:1599)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2492)
at java.lang.Thread.run(Thread.java:680)


I couldn't find the supporting documentation on this site about the MICRO board... I know it's there and I've seen it but I haven't saved the URL And it's hard to find it again...

Thank you for reading!
13  Using Arduino / Programming Questions / Re: LCD BackLight help, please! on: February 20, 2013, 08:26:10 am
never mind... if I could delete my post I would.
14  Using Arduino / Programming Questions / LCD BackLight help, please! on: February 20, 2013, 07:54:49 am
I've been having lots of success with my LCD screens and I've been using the LCD backpack exclusively. Everything all good there...

until, something happened in my project and the screen wasn't displaying properly.... I compared it against another LCD with backpack and turns out my original BackPack burned out... So then I connected the original LCD the classic way and it's displaying info properly however the back light does not shine!!

I tested the Backlight LED with my meter and it slightly turns on with the DMM set to Diode test...

I know that in the LiquidTWI.h you have to specify for the Backlight to turn on... but in the classic set up I don't see anything like this?

Did I not get the memo? Or is it most likely the LCD screen?

Thanks in advance.

15  Using Arduino / Programming Questions / Re: how to access "Input Capture Interrupt", Atmega328, USB Boarduino on: February 02, 2013, 09:49:23 am
Silly ME!! instead of redundantly Enabling the timer I disabled it!!

here's the fix

Code:
  sbi(TIMSK1,ICIE1);  // Input Capture interrupt enable
  cbi(PRR,PRTIM1);    //enable Timer/Counter1 (extra redundancy) <<<<<<<----------
  sei();                     //activate global interrupts (redundancy)
Pages: [1] 2 3