Model Boat Mayhem

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 61219 times)

Tug-Kenny RIP

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 7,625
  • Location: Newport. S Wales
Re: ARDUINO any one?
« Reply #50 on: December 28, 2015, 10:39:22 am »


http://cdn.sparkfun.com/datasheets/Kits/SFE03-0012-SIK.Guide-300dpi-01.pdf



Thank you for that.  All very interesting.     :-))

ken
Logged
Despite the high cost of living   .......... It remains popular

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #51 on: December 28, 2015, 10:51:19 am »

This is a great sets of Videos by the "genius" Jeremy Blum (1.4 Million views)

Not RC specific but really stunning background info

https://www.youtube.com/watch?v=fCxzA9_kg6s

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

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #52 on: December 31, 2015, 03:41:04 pm »

Mine arrived yesterday and I had a little play


The servo swinger code worked perfectly.


A bit of research shows how to create a radar system, so my next project is to make a tracking turret.  :-))

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)

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: ARDUINO any one?
« Reply #53 on: January 01, 2016, 12:29:50 pm »

That would save having lots of channels. You could even slave the turrets to a director! Imagine having miniature model Phalanxes tracking passers by!

What are the laws regarding radar transmission? Are there any??
Logged
Pond weed is your enemy

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #54 on: January 01, 2016, 01:52:21 pm »

That would save having lots of channels. You could even slave the turrets to a director! Imagine having miniature model Phalanxes tracking passers by!

What are the laws regarding radar transmission? Are there any??


This one is not real radar but looks cool and could be used to track and object
https://www.youtube.com/watch?v=kQRYIH2HwfY
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)

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #55 on: January 01, 2016, 02:04:22 pm »

Why not go the whole way - this is a pretty cool extension of the concept

https://www.youtube.com/watch?v=0YFD6SyEma4#t=66

The Ultrasonic sensor's are less than £2 delivered

C-3PO

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

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,941
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #56 on: January 01, 2016, 07:13:15 pm »

essex2visuvesi
have a look at the SRF01 Rangefinder - does the same job as the commonly used HCSR04 but much more compact.
(range 0 to 6metres - I think!)



Info nicked from the robot-electronics.co.uk website

SRF01 Rangefinder
The SRF01 uses a single pin for both serial input and output. By using a software serial port, we can make the Arduino do serial
input and output on a single pin as well. You can have up to 16 SRF01's connected to a single pin on the Arduino.
The Range is displayed on an LCD03 module.

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

barriew

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 2,111
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #57 on: January 01, 2016, 07:18:51 pm »

Ramp Door operator
I have now finished the code to operate the ramp on my Calmac Ferry. At the moment it uses the non-centring channel so that I can stop the ramp before the ferry arrives at the slipway, and then complete the movement to drop the flap when the ramp is grounded. The servo is driven through an Action Servo Morph.
My new code will automatically lower the ramp only just by moving the control off the endpoint. Further movement will drop the flap. The code also slows the movement.
The development was done using a Servo Tester and a random value for the midway stop, so the next step is to hook up to the receiver and servo to find the actual point (in degrees) and also work out the correct speed. I may also have to restrict the travel.  Once that is done I will make up a system with a Nano.
I had lots of problems getting this to work, mainly understanding the operation of  "If...else".  I found that quite a lot of the literature on Arduino.cc has not been updated for the latest version of Arduino IDE. There are some very conflicting examples around. It wasn't helped either by finding that my servo tester would randomly output rubbish.
The next project is a servo tester. I know I can buy one for  a couple of pounds, but that is the price of a Nano. :} There are plenty of examples of code to move a servo by potentiometer or do a sweep. I want to try and combine them.
Barrie


The Ramp code is available should anyone be interested.
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #58 on: January 02, 2016, 09:19:10 am »

barriew,

It sounds like you are refining your ramp door solution...

A servo tester would be a great use for an Arduino - one quirk with the Arduino code you should be aware of depending which commands you decide to use (degrees vs. microseconds) many people have lost hours with this one!, is do not use option 1 below when you declare a servo if you want it to be 100% accurate. You need to use the 2nd command which declares the pin number and the minimum and maximum pulse width parameters in microseconds.
e.g. servo3.attach(5, 1000, 2000);

  • servo.attach(pin)
  • servo.attach(pin, min, max)

See this article - it explains it all  http://makezine.com/2014/04/23/arduinos-servo-library-angles-microseconds-and-optional-command-parameters/

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

barriew

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 2,111
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #59 on: January 02, 2016, 09:56:32 am »


C-3PO

So far I have converted the pulse to degrees and it seems to work OK, although as I say I have to find out what a real receiver is putting out, and also work out the half way stop point. That means taking the laptop and Arduino into the workshop, where I have just started building a new boat. I will check out the article - all relevant info greatly appreciated. There is so much out there its sometimes difficult to find the bit you want. O0
My idea for the servo tester is for a three function device - test using a pot., sweep to exercise a servo or ESC, and display of some kind to monitor the output from a Tx/Rx combo, particularly the mid-point. I have an ACTION R/C Master which sort of does those things, but it isn't very reliable.
I have ordered one Nano so far, if this works out I will order another. I think I managed to blow up my range finder so am waiting for another to come so I can progress my parking aid. I looked at the one Richald suggested but its a bit expensive compared to the HC-SR04, although it could be useful for a collision avoidance system as it would be easier to conceal.


Barrie
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #60 on: January 02, 2016, 10:12:07 am »

barriew,

When you read the RX signal it might be easier to use microseconds as the unit. Mid point will be 1500us.

Code below should read signal from your RX and output value in microseconds in Serial Monitor

Quote
int receiverPin = 9; // connect receiver channel to pin 9 on Arduino
unsigned long duration; // create the variable to store the length of our PWM signal in microseconds

 // >>>>> Start of setup configuration
 void setup()
 {
   
   pinMode(receiverPin, INPUT); // configure Ardunio pin to be INPUT
   Serial.begin(9600); // start the serial link so we can view details (print) in the Serial Monitor
 }
// <<<<< End of setup configuration

  void loop(){
  duration = pulseIn(receiverPin, HIGH); // read PWM signal from the receiver pin and assign PWM value in microseconds to variable "duration"
  Serial.println(duration); // print duration value to serial monitor   
           
 } // end of loop

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

barriew

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 2,111
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #61 on: January 02, 2016, 12:51:08 pm »

C-3PO


Further to my PM, I have now read the article. I will be taking note - when I find the limits of the setup ;)


Barrie
Logged

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,941
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #62 on: January 14, 2016, 12:52:55 pm »

Interesting Arduino Link - Lists 25 Arduino Shields
(basically a shield is an Arduino dedicated I/O card)


http://randomnerdtutorials.com/25-arduino-shields/

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

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #63 on: February 02, 2016, 12:16:20 pm »

Hi all

Love this topic about uses for Arduino.  I am starting a new build which has arduino at its core.  This vid (links) not finished yet but you get the drift.  I have the sketch on my website for my uboat.  This video describes what an arduino does without talking about arduino much.

https://youtu.be/pZ_MRMHgFDo

Here is another one.  Having auto control to keep to a compass bearing

https://youtu.be/l0VmTwCunBM

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,941
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #64 on: February 02, 2016, 01:38:28 pm »

John,

I am very interested in your compass guided tug Scuffy.

I have followed the link mentioned in your video to the resources section
but when I download the .rar file from "Scuffy sketch / code:  scuffy" I only get the circuit diagram
the circuit diagram is (correctly) available under the "Scuffy circuit diagram  scuffy diagram" link.

Is it possible to fix the sketch code link please ?

Richard

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

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #65 on: February 02, 2016, 10:22:14 pm »

Hi there

Yes there was a mistake on my page.  Thanks for noting it and the 'scuffy' code is there.

I started a discussion btis on the Model Boats magazine and got a bit of mauling from some.  Fun to read though.

http://www.modelboats.co.uk/forums/postings.asp?th=112583

Cheers

johnredearth

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 33
  • Scratch building obsession
  • Location: Australia
    • ScratchbuildwithJohn
Re: ARDUINO any one?
« Reply #66 on: February 02, 2016, 10:32:34 pm »

 On this great theme:
I want to add to my sub code some stuff which will allow me to raise the bow planes on a sub.
My thought thus far are to have two servos, one for the plane as per normal and the other to raise and lock it into the side.
To use a channel to trigger the movement or routine which will then:
 
  • ·         Cause the plane to return to 90 degrees (flat).
  • ·         Turn the power off to it.
  • ·         Turn the power on to the retract servo.
  • ·         Cause the retract servo to slowly raise it to a specific position
  • ·         turn the power off to that servo.
When the trigger channel makes the appropriate signal:
 
  • ·         Turn on the retract servo
  • ·         lower the plane to a specific position
  • ·         Turn off the retract servo
  • ·         Turn on the hydroplane servo.
The idea of turning off the power is about saving current and also fixing the relative positions with NO juddering. 
I currently use that in my submarine anyway as I found the hydro servo, which runs through the Arduino judders during boot up.  So I have a relay to keep the power off the servo and the first thing the Arduino does is turn on the power to the servo
So, I am about to start to write the code and if anyone wants to help, you are very welcome!
 

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #67 on: February 02, 2016, 10:39:56 pm »

Hello John,

You have some great ideas and achievements with Arduino and RC boats/subs and I am a fan from having watched your YouTube vids :)

Do you get your emails from your scratch build site email address?

I would love to compare notes etc..

I don't think you can PM on Mayhem until you have 5 or may be more posts - could be wrong

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 #68 on: February 03, 2016, 03:27:10 am »

HI

Yes use my website contact.  I am still getting things together.  I have been into arduino now for a year I guess.  Started writing code for the sub back then and got into all sorts of trouble. The only place to go was the arduino forum where I was treated a bit like the village idiot.  I really mean that!  It would have been nice to compare notes with someone who is at the same stage of un-certainty.  I guess the issue is that it is cheap, not hard and very satisfying.   It's a bit like electronic scratch building.  I have taken bits of code from all over the place to make the scripts work.  Sometimes I find I am cutting and pasting the order of events in scripts just waiting for the time it all works.  I am really that bad!

Cheers

Brian60

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,315
  • Location: Hull,UK-but currently residing in Los Martinez, Spain.
Re: ARDUINO any one?
« Reply #69 on: February 03, 2016, 04:38:56 am »

Just read the first couple of pages from the other site John. Seems nothing changes over there, a lot of the membership are blind to advances in technology, and as was pointed out to you, some consider soldering black magic. Just like the magazine of the same name seems to have devolved over the last few years ( been dumbed down) now caters for 10 year olds entering the model scene with no real attempt to cater to the more advanced modeller.

I know I'll get flack for that statement especially from the one or two main contributors that also frequent this forum, but even the most blinkered can see that the same few people use it as a 'closed shop' good luck to them. I prefer even at my age, to encompass anything that I can learn from or become more informed.

g6swj

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 313
  • Short Wave Jammer! -.-
  • Location: Northamptonshire, UK
Re: ARDUINO any one?
« Reply #70 on: February 03, 2016, 06:45:41 am »

Hello John,

Are you able to PM me an email address so I can email you?

Regards
Jonathan
Logged

barriew

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 2,111
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #71 on: February 03, 2016, 06:56:22 am »

  The idea of turning off the power is about saving current and also fixing the relative positions with NO juddering. 
I currently use that in my submarine anyway as I found the hydro servo, which runs through the Arduino judders during boot up.  So I have a relay to keep the power off the servo and the first thing the Arduino does is turn on the power to the servo
So, I am about to start to write the code and if anyone wants to help, you are very welcome!
Hi John

Thanks for that idea :-))  I have a problem with my Arduino routine controlling the ramp on my ferry. As soon as power is applied, the ramp drops to its full extent, and then returns home at full speed. I was trying to think of a way of stopping the servo moving until the Rx and Arduino had fully booted. Seems like I need to incorporate a relay somehow ok2
As for cutting and pasting code on a trial and error basis, isn't that how all programmes are written %% %% {-) {-)


Barrie
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #72 on: February 03, 2016, 08:41:32 am »

Barrie,

If you take the Arduino out of the equation does the servo still move on power-on? Do you use a separate power supply for the Arduino and servo? - if not worth a try.

Try using a pull-up or pull-down on the signal line to your servo. 10k is ok, the resistor eliminates the initial jerk.

Let me know if that works.

Without seeing the code I'm working in the dark - however to track down what's causing the movement try adding a delay at the beginning of the loop for example delay(2000); which is overkill and for debug purposes only but it would be interesting to see if this has an effect on the power-up movement.

My brain isn't engaged yet so I'll reflect on this to see if I can think of other obvious things.

Let us know the outcome as I am sure we can all learn from this.

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

barriew

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 2,111
  • Location: Thaxted, Essex
Re: ARDUINO any one?
« Reply #73 on: February 03, 2016, 08:53:53 am »

Hi C-3PO


Yes - I it used to move before the Arduino. Spektrum Rxs can take several seconds to recognise the Tx and output a signal, which I believe is the cause of the problem. I did try a Delay at the beginning of the loop - it might be still there - but it has no effect. The servo is powered from the Rx at the moment, but I have some small relays which I can use for experiment. Powering direct from the battery via a relay should fix it.


Thanks for your interest - its not a big deal, but would be better if it didn't do it.


I hope to finally complete my servo tester today - the electronics have been ready for a while waiting for a suitable case which I started yesterday and should finish today.


Barrie
Logged

g6swj

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 313
  • Short Wave Jammer! -.-
  • Location: Northamptonshire, UK
Re: ARDUINO any one?
« Reply #74 on: February 03, 2016, 09:00:18 am »

Hello Barrie,

Servo tester sounds interesting.

Re your servo I can understand an initial movement on power up that brings the servo in line with the PWM signal the Arduino is supplying as it first boots. So if at position of the servo is say at 90 degree and when the Arduino  powers on it is outputting 180 degree PWM signal you would expect to see movement but this would only be in one direction. If the servo goes both ways on power up something else is happening.

Regards
Jonathan

Logged
Pages: 1 2 [3] 4 5 6 7   Go Up
 

Page created in 0.12 seconds with 22 queries.