SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By dkulinski
#141265
Actually the data looks good in both. Just remove the one line. And yes, putty will automatically append to a file if you don't change the name. LOTS of data in here. Will break it down on my lunch break.

Dan
By Mee_n_Mac
#141272
dkulinski wrote:Well a quick dive into the data still looks really noisy to me. I'll leave it to Mee_n_Mac to apply his wizardry to it.
Dan
Some plots to peruse. I see a strong component at the expected frequency (the cycle rate) now. So it would seem at first there really is a deep dip in current every (or nearly so) cycle. That's good but I'm lost as to what causes it.

These are for the 1'st set of data in the most recent collection.
Slide1.JPG
Zooming in ...
Slide2.JPG
And the FFT (from data btw 3-4 secs) ...
Slide3.JPG
You do not have the required permissions to view the files attached to this post.
Last edited by Mee_n_Mac on Fri Mar 16, 2012 12:17 pm, edited 1 time in total.
By Mee_n_Mac
#141273
So looking at the zoomed in time domain plot ... there's lots of "other" dips in the current that happen at faster than the cycle rate (also seen in the FFT). The implication is that it might be hard to reliably detect a cycle based on a "dip". Cycle rate of 22 Hz gives a cycle period of about 45.5 msec.
Last edited by Mee_n_Mac on Fri Mar 16, 2012 12:14 pm, edited 1 time in total.
By StaticDet5
#141284
Good lord, gang! I wish I had this kind of support when I was a LEO. You folks are doing great work with this.

I'm really sore today, so I have not been working on this. The little girl at PT kicked my butt.

The signal looks noisy as hell. My limits in signal analysis stop at ultrasound cardiac waveforms on $30,000 terminals...

What can we do to clean up the signal? Is there a way to isolate the motor more? I've got a cap and a diode across the motor terminals.
I've got the current sensor on the positive lead of the battery, before it feeds anything else in the circuit. Would it help to put it on the motor terminal?
By dkulinski
#141288
You have to be careful with decoupling capacitors. I was thinking removing the PWM setup may be good but I don't think that is actually going to help as you are driving at 100% duty cycle. This is the equivalent to a constant 5V signal on the PWM pin. As I was thinking about it you can actually decrease the PWM value to get more readings per cycle. Yes you are going to introduce some noise but that should be able to be compensated for. We can always average the values and find general trends. My only worry is that PWM may cut out enough torque you can't fully compress the spring?

Very exciting stuff. I hope you recover quickly from your PT sessions. Also, the little girls at PT are mean, much more mean than the big burly men, beware!

Dan
By Mee_n_Mac
#141291
The question is what's causing the "noise" ? Is the current really doing that or is that pickup from ... something. The current sensor has a very wide bandwidth, limited by the filtering on the board. I've yet to figure out what the filtering is. It might well be you're seeing the commutation of the brushed DC motor. Do you know how many poles it is and what the gear ratio is in the gearbox ? That is how many motor RPMs to 1 gearbox cycle. The filter on the current sensor can be adjusted down to reduce any commutation components but you don't want to reduce so much any gearbox dependant variation is removed.

But looking at the larger picture ... say all the ugly dips/spikes got filtered out. They all look to be similar in their duration to my first glance. What then will be left ? Is there a cyclic variation to the current ? The FFT says so but ...

ps - I've been assuming there's been no PWM during all this.
By StaticDet5
#141292
OK, here's another log file, logfile3, with the PWM at 220.
I pulled another one with the PWM at 200 (logfile4). I made the decreases dis-similar on purpose.
With the PWM at 200, PuTTY registers an error reading from the serial device. The gearbox fired two shots, and then stopped at the same time the error was generated on the computer screen.
You do not have the required permissions to view the files attached to this post.
By StaticDet5
#141295
My understanding is that a PWM cycle of 255 is 100% duty, no gaps.

However, I can switch the software over to digital driving tomorrow.

Here's the 4th logfile.
You do not have the required permissions to view the files attached to this post.
By dkulinski
#141296
Please test your Arduino disconnected from the system. I am wondering if the spring could have reversed the current enough on the motor to give your setup a power spike. I know there is a non-reversing gear stop, but if this failed or didn't engage quickly enough it could have spiked.

Dan
By dkulinski
#141298
So I looked at samples between 1488 and 1788. This is actually pretty clean! The period seems to be all wrong though.

Check out the quick graph:
chart.png
Dan
You do not have the required permissions to view the files attached to this post.
  • 1
  • 10
  • 11
  • 12
  • 13
  • 14
  • 32