Go Down

Topic: Don't know where to start (Read 672 times) previous topic - next topic

CodeCruncher

I am trying to build a remote controlled 48" mower with a Turnigy 9Xv2 remote talking to a Turnigy 9X8Cv2 receiver. From there I plan to run the output into a Arduino Mega 2560 clone for some kind of throttle / ramp control. From there it will plug into a Sabertooth 2x60 Amp controller.

I have absolutely no experience with remote controls, or the C programming language, so I am a little stuck in getting started. I have been programming in VB for a number of years and think once I get going I will be able to add to the code.

Hopefully someone has done something close to what I am trying to do and can kindly provide some starter code to get me going.

Paul_KD7HB

Did your searches of the forum not turn up anything?

Paul

Groove

Quote
I am trying to build a remote controlled 48" mower
Quote
I have absolutely no experience with remote controls,
{{{sound of alarm bells}}}
Per Arduino ad Astra

spycatcher2k

Quote
can kindly provide some starter code to get me going.
Sure
Code: [Select]

void setup()
{
}

void loop()
{
}


Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design & Assembly work undertaken - Arduino repairs & testing - PM for details. PM me for non repair or testing, 1 to 1 support and I will charge you - beware!

Paul_KD7HB

If you haven't got it by now, no one can help you until you have read all the many forum posts on remote controlled lawn mowers, until you have gone through the many program examples on the Arduino programming IDE, and until you have tried the program examples using the various boards you are going to be using.

Paul

jremington

#5
Mar 19, 2017, 05:17 pm Last Edit: Mar 19, 2017, 05:18 pm by jremington
We recommend that beginners start with the simple examples provided with the Arduino IDE, to learn about the hardware and special features of the Arduino programming language.

There are very important lessons to be learned from even the simplest examples, for example, "blink without delay", which are required for real time control of machinery.

I hope that you do not want children to be mowed down by a machine, as a result of your inexperience in programming.

Robin2

I am trying to build a remote controlled 48" mower with a Turnigy 9Xv2 remote talking to a Turnigy 9X8Cv2 receiver. From there I plan to run the output into a Arduino Mega 2560 clone for some kind of throttle / ramp control.
Seems to me it would be a whole lot easier to use a wireless system that works directly with an Arduino such as the nRF24L01+ modules. Have a look at this Simple nRF24L01+ Tutorial

If you insist on using the Turnigy devices then please post a link to the receiver datasheet or user manual.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

CodeCruncher

#7
Mar 20, 2017, 02:15 am Last Edit: Mar 20, 2017, 02:47 am by CodeCruncher
We recommend that beginners start with the simple examples provided with the Arduino IDE, to learn about the hardware and special features of the Arduino programming language.

There are very important lessons to be learned from even the simplest examples, for example, "blink without delay", which are required for real time control of machinery.

I hope that you do not want children to be mowed down by a machine, as a result of your inexperience in programming.
Hey jremington, I have got the Arduino program working, and have uploaded and understand how a few of the inbuilt sample bits of codes work (got the onboard LED to flash) But I am trying to input from one device and output to another device with no real way of monitoring if it is performing the desired outcome, and all the breadboard and array of LEDs in the world are not really going to tell me if the motors connected to the controller are doing what they are supposed to do.

I don't want to reinvent the wheel if someone has a far more elegant solution already made, there is so much more work to do beyond what I have mentioned, so I was just looking for some starter code to get the motors working smoothly. I don't know where you got the impression that I am an inexperienced programmer, I have been programming on and off in VB for nearly 20 years, I just never delved into C before (bought the book but never read it), and while things like loops, for and if statements all perform the same function as VB, it is always easier to dissect someone else's thinking.

I have already part simulated the code I want in VB using timers to represent acceleration of the remote joystick movement and another timer to control the ramp rate (for a safe and jerkless take off), with code to not allow the joystick movement to exceed or be less than the ramp rate. But just like the Arduino running a blink example on itself, it is a no brainer to get it to perform a simple function on it's own hardware.

I am working with unknown outputs and inputs, and if someone has been there before (which is highly likely) it would cut down development time massively. I know the receiver uses an output of between 1000ms and 2000 ms with 1500ms being neutral, but beyond that I know very little about it with no documentation to be found.

The other thing is I can't just write the code VB and transfer it to C because the Arduino uses an extremely cut down version of C that may not have all the functionality of VB. Even the timers that come inbuilt in VB don't seem to be all that consistent, so I can't expect the Arduino ones to be any better, and then there is correction code needed to ensure everything is within an acceptable scope.

Note from the attached picture how the timer intervals on the far right are not evenly spaced, and quite often will run at very different intervals from other timers. These are all problems to overcome.

CodeCruncher

#8
Mar 20, 2017, 02:28 am Last Edit: Mar 20, 2017, 02:37 am by CodeCruncher
Seems to me it would be a whole lot easier to use a wireless system that works directly with an Arduino such as the nRF24L01+ modules. Have a look at this Simple nRF24L01+ Tutorial

If you insist on using the Turnigy devices then please post a link to the receiver datasheet or user manual.

...R
Oh wouldn't that be nice... I contacted Hobby King to do exactly that and I got next to no help from them. Turnigy appears to be an internal brand and from what I can understand there is next to no information available on them in the form of a datasheet. I contacted HobbyKing online help when I was watching conflicting YouTube videos on how to even pair the receiver and this is what they linked me to.

https://hobbyking.com/media/file/967288036X1102364X36.txt

How to Bind Turnigy 9X Radio to the 9X Receiver
-----------------------------------------------
by Red.13

1. Have the 9X Radio turned OFF.

2. Insert the Bind plug into the last set of 3 pins marked as Bind on the Receiver.

3. Power up the Receiver. You will see the red LED, inside the Receiver, flashing at a pretty fast rate.

4. Press and hold the Bind button on the back of the 9X Radio.

5. Turn the 9X Radio ON. The LED inside the receiver will go solid ON indicating the Radio and Receiver are now bound together.

6. Release the Bind button on the 9X Radio and remove the Bind plug from the Receiver.

Test all channels. You are ready to fly.

While I would probably be able to pick up bits and pieces on forums, any real datasheet on the 9x controller and 9x8c receiver is just a vague hope.

Edit:
Although I do have one valuable piece of information. The Turnigy 9xC8v2 receiver does apparently connect directly to the Sabertooth 2x60 amp motor controller (don't know the wiring), so that would suggest that the output of the receiver is compatible with the input of the motor controller from a signal perspective. I just want to put the Arduino in between the two to smooth out the acceleration and deceleration ramps (plus various other safety systems like proximity slowing)

I have also seen YouTube videos with people having done what I am trying to do, so I know it is possible, but how effective their code is anybody's guess.

CodeCruncher

{{{sound of alarm bells}}}
Didn't know the first thing about CNC machines all that long ago either, but seem to have got the basics down...

Boardburner2

I am trying to build a remote controlled 48" mower with a Turnigy 9Xv2 remote talking to a Turnigy 9X8Cv2 receiver.
The whole fun of a 48 in mower is riding on it.
Why do you want remote control ?

Running down grannies ? Death race 2000. ? :)

CodeCruncher

The whole fun of a 48 in mower is riding on it.
Why do you want remote control ?

Running down grannies ? Death race 2000. ? :)
I don't want to imply that I'm lazy (regardless of how true it is) but eventually I want to be running cameras on it, and be sitting in front of the TV with a beer in my hand doing the lawn.

CodeCruncher

Think I am off and running Basic connection need to assemble a few wires to give it a try.

Boardburner2

y I want to be running cameras on it, and be sitting in front of the TV with a beer in my hand doing the lawn.
I have done FPV with model cars , it is not easy and requires both hands.
Now if you steer with your knees you can hold a beer in both hands. :)
Also less risk of the mower coming towards your feet when having one too many or falling asleep.

Automating it with an electrical fence would probably be a more practical approach.

Robin2

Oh wouldn't that be nice... I contacted Hobby King to do exactly that and I got next to no help from them.
So don't use the Turnigy stuff. The nRF24L01+ modules are only about £2 each.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy