Thread Tools
Apr 10, 2014, 11:38 AM
Jack
jackerbes's Avatar
Thread OP
Quote:
Originally Posted by Tom Harper
Jackerbes,

Neat set up. The sled is a good solution, but it does require a hanging scale and you are stuck with the manufacturers 'features'.

Does the elogger scroll with the input or will it hold a reading?

Are your 25%, 50% etc inputs the percent of max PWM?

Tom
The eLogger is recording V/A/W/RPM and one or two temperatures. And it will record for as long as there is memory left. I think the V4, in this setup, is good for more than an hour of data. I note the PWM values and thrust from the scale in a testing notebook.

And when I get done, I massage the data in the eLogger's Data Recorder app and add the thrust values for when the data is posted at flybrushless.com or for adding notes to screen shot images that summarize the testing.

The HJ Servo tester displays the PWM rate. It will display a range from 800 to 2200 microseconds. As I'm sure you know, in theory, 0 throttle is at 1000 and full throttle at 1500.

When I calibrate my Phoenix 80 ESC at startup I wind up with all motors starting at 980 and topping out (no further acceleration) at 1456. So for my setup, the range is 1456 - 980 or 476 and I use 0%, 25%, 50%, and 75% of that range as the reported throttle percentage.

I think every TX and it's various settings and features (throttle curves, endpoints, etc.) and every ESC and it's calibration routine can render my percentages as less than right on. But they should be close enough for most purposes.

I get very consistent starts and stops by the PWM display and have a simple look up chart so that I know that, by the display on the servo tester, 1099 = 25%, 1218 = 50%, 1337=75%, and 1456=100%.

And the Phoenix 80 has a red LED that comes on to signal arrival at full throttle for me too.

Jack
Sign up now
to remove ads between posts
Apr 10, 2014, 11:52 AM
Lift is cheap - Drag sucks
Tom Harper's Avatar
I just bought a 1KG load cell and an HX711 board. Delivery will take a while.

Tom
Apr 10, 2014, 05:23 PM
Jack
jackerbes's Avatar
Thread OP
I got my HX711 board and the DF Robot branded 1602 Keypad LCD from NY Platform via eBay.

I also bought a Freaduino V1.8.2 UNO board there but it had a bad mini-USB connector, it was quickly replaced with another Freaduino UNO board and that also stopped working right shortly after I got it. So I don't recommend the Freaduino UNO boards...

As a Arduino shopping opportunities deprived resident of rural Maine, I then bought another UNO board on eBay. It is called the UNO R3 ATmega328P ATmega16U2 board and that one came out of the package working (the Blink sketch was pre-loaded) and it has worked faultlessly since (knocking on wood).

The U.S. seller I bought the UNO R3 board from is a Arduino user and his listings inspire confidence and even have links to using things, getting libraries, and the like. Imagine if you will, it looks to me like eBay seller kbellenterprises is a fellow hobbyist and knows his merchandise. There may be a small savings in buying from the guys in China but from here on I'll go with a U.S. seller who knows his stuff, pay a few Bucks more for doing that, and get much faster shipping.

Jack
Apr 10, 2014, 07:39 PM
Jack
jackerbes's Avatar
Thread OP
I have found a Arduino library and a sample sketch that looks to have a lot of potential for this project. That may be gibberish to some but the library and sketch are both two of the components of any Arduino project. These are the two things that I am talking about:

HX711 library - HX711 library - https://github.com/bogde/HX711

Here is a document that explains the library, why it was written, and what it can do:

https://github.com/bogde/HX711/blob/master/README.md

And here is the HX711 Arduino sketch that was written to put the project to work:

http://github.com/bogde/HX711/blob/m...X711Serial.ino

When I instaalled the library and loaded and ran the sketch, it sends the stuff seen in the image to a serial port. I had another, much simpler sketch I had been messing with but after looking at this one I think I need to change direction and use something similar to and based on the HX711Serial.ino effort.

I think the key value to me is the averaging of the values from the HX711 before they are sent to the serial port or displayed (that sketch does not display on a LCD, only sends to a serial port).

When I have been messing with my hardware and sketches, I had a nagging impression of there being a lack of consistency as weight was added and removed from the beam and I think that is evident in the data in the image.

I think the reading to reading variations are such that, when one is single reading is captured, it can vary widely from the last reading. But when 10 readings are averaged and that is displayed I see a much smoother and logical rise and fall in the average values.

I also like the rate of display from that program, it plots a new line about every two seconds (actually a little less than that).

If I were seeing those values displayed as I tested a motor, I would glance at the LCD and either take the last or next reading and use that as the reading that relates to the current RPM.

So I think the speed of the results and the results themselves are a good thing to pursue.

So now I am going to study that sketch, simplify it as far as how much it displays (I don't think I want to need the preliminary info, nor do I need the single readings sent to the serial port. I'll settle for just the averaged readings at a rate of every 1.5 to 2 seconds or so. For now anyway.

Jack
Apr 11, 2014, 09:35 AM
Lift is cheap - Drag sucks
Tom Harper's Avatar

HX711 Specification


I Googled around until I finally found the complete specification.

The serial interface is a simple Microwire/SPI affair. It can be clocked as slow as 50us per bit, so might be a good Arduino learning project.

At the end of the spec there is a program for reading data.

Tom
Last edited by Tom Harper; Apr 11, 2014 at 09:42 AM.
Apr 11, 2014, 11:59 AM
Jack
jackerbes's Avatar
Thread OP
I worked on editing that last sketch that does the averaging a little and now have it displaying on the LCD. That can be seen here:

Arduino thrust 01 (1 min 23 sec)


The sketch is in the attached file and, of course, it still needs some work. The way it is now, it reads and averages and sends it to the serial port, then repeats that for the LCD. So the numbers are different.

I need to figure out how to tell the sketch to read and average 10 times, then save that value to a variable, then send the variable to be printed on the serial port and the LCD. That will get the same value in both places.

And then I want to experiment with it some more. The display actually much easier to read in the real world than it is in the video, the image shows that more clearly.

If anyone has a suggestion on how to do the display, I am open to that...

Here is my sketch as of now:

/*
0410 - working on LCD to display weights seen on serial monitor

*/

#include "HX711.h"

// include the library code
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);

// parameter "gain" is ommited; the default value 128 is used by the library
HX711 scale(A3, A2);

void setup()
{

// set up the LCD's number of columns and rows:
lcd.begin(16, 2);

// reset the LCD to 0
scale.tare();

// Print label to the LCD.
lcd.print("Thrust:");

Serial.begin(57600);

// this value is obtained by calibrating the scale with known weights
scale.set_scale(391.f);


// print column heading on serial
Serial.println("Thrust: ");

// prints carriage return on serial for blank line
Serial.println("");

}

void loop() {

// print the average of 20 readings from the ADC
// Serial.println(scale.read_average(20));

Serial.println(scale.get_units(), 1);

lcd.print(scale.get_units(), 1);

// delay(20);

// reset the scale to 0
scale.tare();

}

Jack
Apr 11, 2014, 12:21 PM
Lift is cheap - Drag sucks
Tom Harper's Avatar
Jack,

You have quickly become an Arduino programmer!

Sparkfun has an Arduino to USB device that would allow you to use your PC for the display.

Tom



Tom
Apr 11, 2014, 01:23 PM
Don L.
Jack,

Try this:


#include "HX711.h"

// include the library code
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);

// parameter "gain" is ommited; the default value 128 is used by the library
HX711 scale(A3, A2);

float thrust;

void setup()
{

// set up the LCD's number of columns and rows:
lcd.begin(16, 2);

// reset the LCD to 0
scale.tare();

// Print label to the LCD.
lcd.print("Thrust:");

Serial.begin(57600);

// this value is obtained by calibrating the scale with known weights
scale.set_scale(391.f);


// print column heading on serial
Serial.println("Thrust: ");

// prints carriage return on serial for blank line
Serial.println("");

}

void loop() {

// print the average of 20 readings from the ADC
// Serial.println(scale.read_average(20));

thrust = scale.get_units();

//Serial.println(scale.get_units(), 1);
Serial.println(thrust, 1);

//lcd.print(scale.get_units(), 1);
lcd.print(thrust, 1);

// delay(20);

// reset the scale to 0
scale.tare();

}

-Don
Apr 11, 2014, 01:46 PM
Jack
jackerbes's Avatar
Thread OP
Quote:
Originally Posted by Tom Harper
Jack,

You have quickly become an Arduino programmer!

Sparkfun has an Arduino to USB device that would allow you to use your PC for the display.

Tom
And last week I couldn't even spell it!

Actually, I am a self admitted borrower or thief of code. If I can find it working and use it, that is my style!

Methinks that dleroi is the programmer, and I'll be giving his suggested changes a try soon.

Thanks, Don!

Jack
Apr 11, 2014, 02:17 PM
Lift is cheap - Drag sucks
Tom Harper's Avatar
Whatever it takes - that's the way you learn.

Tom
Apr 11, 2014, 05:12 PM
Lift is cheap - Drag sucks
Tom Harper's Avatar
Jack,

Where did you get the thrust sled? I can't find it on-line.

Tom
Apr 11, 2014, 05:28 PM
Registered User
Tom,
Check out the first line in post 11 for the link to the sled.
Alan

added later: http://www.r2hobbies.com/rc-motor-wo...g-station.html
Last edited by Al Offt; Apr 11, 2014 at 05:36 PM.
Apr 11, 2014, 05:47 PM
Lift is cheap - Drag sucks
Tom Harper's Avatar
Thanks!

Tom
Apr 11, 2014, 06:18 PM
Jack
jackerbes's Avatar
Thread OP
Quote:
Originally Posted by Tom Harper
Jack,

Where did you get the thrust sled? I can't find it on-line.

Tom
That's it, Al remembered! I had bought a battery from them and it died almost immediately so they gave me a credit balance. So I added a couple of Bucks and got that sled on a whim.

I have since put some small (2-56?) Tee-nuts in the back of the firewall and now attached the motors to a square plate made from 1/8" aluminum and then attach the plate to the firewall. That was done to accommodate more sizes of motors and mounting patterns. The 3mm countersunk screws (usually provided with the motors) hold the plate to the motor back and then the plate is attached to that firewall face.

I also put two thinwall brass tubes through the sled (to ride on the two rods the sled moves on) to get a lower friction/easier sliding sled. I'll post some photos of that so you can see what I did. It was not exactly a "turn key" operation...

Geezers tolerate having to tinker, I'll have to admit that...

Jack
Apr 11, 2014, 06:20 PM
Registered User
benedict's Avatar
Hey, back when I was in college I took some computer science courses. (I later switched to astronomy.) Anyway, one of the things they drummed into our noggins was the concept of "code re-use". Every class the teacher recited the litany: "Be sure to write re-usable code!"

So I think what you've done is computer science at its very finest, Jack: Find code that works, and re-use it!

It's so cool to see you making such strides on this project. Awesome!

Tom


Quick Reply
Message:

Thread Tools