Model Boat Mayhem - Forum

Please login or register.

Login with username, password and session length.
Pages: 1 2 3 [4] 5 6 7   Go Down

Author Topic: ARDUINO any one?  (Read 40285 times)

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #75 on: February 03, 2016, 09:11:58 AM »

Jonathan and C-3PO


Let me do some experiments with and without the Arduino - if I can. Before the Arduino I had a Servomorph in circuit to slow the movement and limit the travel. I'll get back to you, although today I have other priorities ok2


My servotester will have three functions - manually swing the servo using a Pot. Continuously sweep the servo through 180, and finally display the output from a Tx/Rx . Not really much of a challenge to an Arduino, and probably not cost effective given the price of these things on eBay. I do already have a simple tester and an Action device which does all these things, but I wanted to use the Arduino and this seemed a good project.

Barrie
Logged

NoNuFink

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 93
  • Model Boat Mayhem is Great!
  • Location: Hemel Hempstead
Re: ARDUINO any one?
« Reply #76 on: February 03, 2016, 03:45:00 PM »

You might like to add an additional function for a servo tester.
I have, several times, had a faulty servo in which the motor would not start if stopped in a certain position.
They would run OK but sometimes would only start if 'helped' by hand.  Presumably the cause was with one faulty/dirty commutator segment.

I suggest a non-continuous sweep from end to end. I.E. make a very small step, wait for the servo to move and come to rest and then step again.  If there is a motor start problem the servo will just stop .  You can't pin it down to any particular servo arm position because of the gear ratio, the failure being dependent on the motor position.

Just a suggestion  Hope it helps

NNF
Logged

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #77 on: February 03, 2016, 06:03:35 PM »

That should be quite easy to incorporate. One of the options on the servo write instruction is to wait for the servo to move to its directed position before continuing. Which effectively means it is a start-stop movement. I will experiment, although I don't have a sticking servo to test it properly %)


Barrie
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 827
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #78 on: February 06, 2016, 09:36:13 AM »

Hi johnredearth
Your submarine challenge sounds interesting. Do you know why the servos jitter on power Up?


Seen some of your YouTube videos - they are brilliant - I even found myself reaching for a glass of red!


Regards
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #79 on: February 06, 2016, 10:26:46 AM »

Hi there.  I have no idea about the jitter.  I have loaded them with capacitors but to no avail.  I finally got the idea to power them up through a relay as soon as the arduino boots up.  That way there are no issues at all.  I am now thinking of extending this with the extend / retract servo.  Playing as we speak.

Most of what I do is achieved by copying, shifting and then trying to think with a clear head.  It is logic after all!  Red helps though.

Cheers

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 827
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #80 on: February 06, 2016, 06:12:42 PM »

Brainstorm re servo jitter:
  • Always use a seperate power supply for servo and Arduino
  • Always connect negative servo supply to Arduino ground
  • Investigate use of ferrite ring on servo lead (2or 3 turns)
  • Investigate use of capacitor close to servo as possible
  • Investigate servotimer2 library - interrupts could be ( almost certainly will be) causing PWM problems with standard servo library
  • Control the servos with an external board using i2c - more kit but this is my preference. this is a great way if you have space as the external board handles the Pwm stuff freeing up Arduino resources
If you have a program that causes jitter especially on startup I'd love to see the code ( perhaps send by PM) it would be very interesting to hook the pwm signal to a scope and understand more about what is going on


C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #81 on: February 06, 2016, 09:12:21 PM »

C 3PO

Your response is very C 3PO like.  I have got a sep power source etc.  The jitter is 'only' on boot up for me.  BTW got my retract script working on the bench last night.  Once it is ready I will reveal all as any contributions from people with much more experience than I would be soo  good.  Reaching fer the celebratory wine.

John

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 827
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #82 on: February 06, 2016, 09:42:01 PM »

John,


that was quick with your submarine solution!



Do you have a pull down resistor ( 10k between each pwm pin and gnd)  on the pwm lines?


From memory (which is always dangerous!) the pwm line goes high low high as the Arduino boots. Adding the pull down resistor makes the pwm pin stops this. This also applies to barriew and his misbehaving servo on bootup
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #83 on: February 07, 2016, 06:18:29 AM »

From memory (which is always dangerous!) the pwm line goes high low high as the Arduino boots. Adding the pull down resistor makes the pwm pin stops this. This also applies to barriew and his misbehaving servo on bootup
C-3PO


I hope to e able to clear my bench sometime Monday to do some testing on my Ramp Mover. I'll report back after that.


Barrie
Logged

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one? - Servo problem
« Reply #84 on: February 09, 2016, 03:00:03 PM »

I believe I have solved the problem. :-))  The ramp needs the full range of a channel to operate so I use the aircraft throttle channel as that is the one without a centring spring. Of course for an aircraft you want the throttle to start at the minimum don't you %) %) . Because of the constraint in mounting the servo, the channel needs to be reversed, hence the ramp drops to its maximum extent. O0


The answer is to use a separate power supply to the servo an use the Arduino to control a relay to supply that power.


Thanks to those who showed an interest in my problem.


Barrie
Logged

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,146
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #85 on: February 09, 2016, 03:43:17 PM »

I wasted the last 3 evenings just sodding about with mine, seeing what I could make it do  :embarrassed:
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,146
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #86 on: February 09, 2016, 06:37:56 PM »

I wasted the last 3 evenings just sodding about with mine, seeing what I could make it do  :embarrassed:


And the answer is "quite a lot" once I figured out it was the included stepper motor that was faulty and not my wiring lol
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #87 on: February 09, 2016, 07:09:05 PM »

Yes - I've not had much success with the stepper. Not that I'm too worried as I can't at the moment see a use for it. %)


Barrie
Logged

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,146
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #88 on: February 09, 2016, 08:13:39 PM »

Yes - I've not had much success with the stepper. Not that I'm too worried as I can't at the moment see a use for it. %)


Barrie


I can, and they are the reason for my dabbling with Arduino.
The one that came with my set was faulty (looks to be mis wired)
I bought another couple as I had plans and all of those work


What I am finding is that arduinoing (my new word for it) is a consumer of free time of the worst order  {-)  but satisfying all the same
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,872
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: ARDUINO any one?
« Reply #89 on: February 10, 2016, 01:01:04 AM »

What I am finding is that arduinoing (my new word for it) is a consumer of free time of the worst order  {-)

Yup.  :-))

But here are some ideas on the programming side...

1/ Before you program, write down what you want to happen. If there are multiple inputs, write down what you want the end results to be in every circumstance. Programs are logical, we are not. Writing down can (and should) include sketch graphs of input-versus-output. If-then and logical maps are extremely useful.

2/ If you're copying and pasting program lines from third party sources, try to understand what these lines are doing. Don't work blind. You'll then get a grip of what each and every instruction is. Maybe you don't need/have to amend parts of it?

3/ Test the program in small chunks. Does a chunk behave the way you expect it to? If not, why not? If it does, move on...

4/ Programs longer than (in my professional experience) six to ten screens of code with, particularly, subroutines and branching become mentally unmanageable. You can't hope to grok it in one. It's like juggling jelly. Stop for tea and you've lost something.

This is why // and /* ... */ become essential. Note: I used pink in Actionscript for comments years ago, and I've hardwired myself to read anything in this colour as a comment, and nothing else. Your colour may vary. Comments are ignored by the processor, take just a little room, but allow you to tell yourself (and others) what a section of code actually does. For programs beyond the mentally unmanageable, a comment might be a lifeline after just a few days of programming.

My favorite example is // Andy, trust me, this works that after two days on a complicated ongoing project, meant that I could incorporate the routine that followed it without having to re-understand what the hell I'd written. A year later, I nodded at my then confidence and could move on!

There is nothing worse than looking at old code that you wish to adapt, code that you yourself have written, that no longer makes any sense, because there are no comments in it.

5/ When everything's written, and everything works, save your code. Save it all over the place. Print it out. Spend a while writing down what the code does and how it works, line by line. You will need this information at some point in the future.

Andy

Logged
Enjoying every minute sailing W9465 Mertensia

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,146
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #90 on: February 10, 2016, 08:12:00 AM »

Having done VB programming in the past I have to agree wholeheartedly with adding comments


Lots of the scripts I have done in VB have comments like "this routine works but could be tidied"
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

rickles23

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 516
  • Location: Port Macquarie, NSW, Australia
    • Royal Navy Commandos
Re: ARDUINO any one?
« Reply #91 on: February 10, 2016, 01:58:31 PM »

Hi,

Firstly I know little about computers and even less about Arduino.

If there is something I need to find out I will ask those better informed than I.

On a model ship I need music, shouted commands and various gun fire sounds.

Space and battery power are no problem as I use batteries for ballast.

I need a timer so that after an interval the various sounds can play one after the other but with a gap between them of a few minutes.

Would this be in the realms of Arduino or do I need to find another option.

Regards
Logged

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,146
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #92 on: February 10, 2016, 04:18:22 PM »

Hi,

Firstly I know little about computers and even less about Arduino.

If there is something I need to find out I will ask those better informed than I.

On a model ship I need music, shouted commands and various gun fire sounds.

Space and battery power are no problem as I use batteries for ballast.

I need a timer so that after an interval the various sounds can play one after the other but with a gap between them of a few minutes.

Would this be in the realms of Arduino or do I need to find another option.

Regards


That would be pretty straight forward, you could even have the sounds set to play at random at a flick of a switch on your TX
probably cost less that 20.00 to build as well:-


Arduino Nano (the main processing bit) 3.50
MP3 Module loads the sounds from a memory card 3.50
some kind of Amplifier & Speaker 5.00-20.00
Smart box to fit it all in 2-5


The code wouldn't be that difficult either

Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,943
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #93 on: February 10, 2016, 04:50:35 PM »

Rickles

3 links on using arduino to play audio files
 
Complete how-to project . . .
http://www.instructables.com/id/Playing-Wave-file-using-arduino/

Another complete example but will need a bit of work.
https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer

Sample hardware - would need investigating as to exact capabilities.
http://www.highqualitybuy.com/audio-player-mini-sd-card-sound-module-wtv020-sd-20s-wtv020-sd-16p-for-arduino-BI00734.html?currency=GBP&gclid=CPal6_LP7coCFQITwwodz4QD4g

You would need to convert each of your sounds into a .wav file, store it on the SD card, and then the arduino control
program would control which sounds are played and when.

Richard
Logged
Senior member of the OGG (Order of the Grumpy Gits)
Membership Number : 002

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 827
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #94 on: February 10, 2016, 05:14:48 PM »

The Rolls Royce of sound (wav file) trigger boards for Arduino

http://robertsonics.com/wav-trigger/

The sound out of this is truly remarkable ( almost HiFi like!) - 14 wav files can be played at the same time, I seem to remember each with their own adjustable (as they play) volume.

You can even pitch bend the output - sadly only the combined output.

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

rickles23

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 516
  • Location: Port Macquarie, NSW, Australia
    • Royal Navy Commandos
Re: ARDUINO any one?
« Reply #95 on: February 11, 2016, 06:08:27 AM »

Hi,

Thank you for all your replies.

I now know more about Arduino.

I now have a lot of reading to do and a visit to my local Jaycar store.

Regards
Logged

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #96 on: February 16, 2016, 07:23:43 AM »

Hi

I have been working on a small video about boats and arduino.   I really want to get people into this.  Does this work for you??
https://youtu.be/_cJs9mqJWvI

Cheers

tsenecal

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 331
  • Location: Arvada, Colorado, USA
Re: ARDUINO any one?
« Reply #97 on: February 16, 2016, 11:30:17 AM »

I have added a little bit of code on a thread at two different submarine websites

it started at subcommittee.com, where a member started a discussion about using an arduino to create a Robbe multi-switch decoder:

http://subcommittee.com/forum/showthread.php?32808-Multiswitch-de-Robbe-y-Arduino

my newest sketch starts at post #24


and it has been replicated at subpirates.com

http://www.subpirates.com/showthread.php?5285-Arduino-based-Robbe-multi-prop-decoder

as it sits, i have a fully functional replacement for a multi-prop or multi-switch decoder, with complete access to the source code for future enhancements and upgrades...
Logged

barriew

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 2,009
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #98 on: February 20, 2016, 03:12:12 PM »

I have at last finished my Arduino based Servo and Transmitter Test and Calibrate unit. The difficulty was getting it to fit into the box I made for it. %)





I realise that these can be bought very cheaply from China or ebay, but this wasn't expensive and I made it myself :-))


I have also, thanks to an Instructable on making an Arduino Uno on Veroboard, worked out how to complete my Ramp Mover project and eliminate the unwanted drop of the ramp as soon as power is applied. I will order the parts when I return from holiday.


Barrie
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 827
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #99 on: February 20, 2016, 05:31:28 PM »

Barrie, re Servo Tester
Wow - that looks pretty professional - sure this must have given you a real sense of achievement - lots of learning and a really useful piece of good looking kit as the outcome.

Well done that man!

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...
Pages: 1 2 3 [4] 5 6 7   Go Up