Jump to content

Wireless winch controller


Tris Cocks

Recommended Posts

I'm with Ed - the "K&R" book is a must-have but it's not an overly friendly introduction.

The Absolute Beginners Guide To C is quite good. There are also plenty of tutorials & example code out there on the web (uni websites have some good stuff) although you should generally avoid any code you find on forums from what I've seen :ph34r:

You may want to go one level down and read up on how microprocessors actually work in order to understand what all the code is actually doing, Electronic Systems was what we used at A-level and covers most things (transistors to micros & some very basic programming) in a good style.

Link to comment
Share on other sites

One further thing, often forgotten is - Reverse Polarity Protection!

There's nothing more annoying than accidentally connecting a bit of kit the wrong way round and it going up in smoke! It's happened to me a few times.

When I build anything, I try to make it as bullet-proof as possible with the best noise immunity, protected / buffered inputs and outputs and reverse polarity protection to save it from myself! You never know what you'll do accidentally when tired, under stress or, god forbid, drunk! ;)

Si

Link to comment
Share on other sites

That's not always possible. What about when the winch is pulling you in to a step or tree-trunk? Or when you're getting to the top of a slope & it's pulling you into the slope, a little bit of drive gets you over the top? No number of snatch blocks is going to do anything other than damage. You may be right in an ideal world - but in reality-land, drive-assist is sometimes the only way.

Si

my winch gets used for recovering other vehicles, I don't do much 'off-road' driving these days, not many places in Cornwall for doing that, otherwse it's never given me any cause for concern, if I can't drive it easily, find another route or retire gracefully.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks once again for the great replies, looks like ive got some reading to do. Ive been away in Scotland for the past couple of weeks with work so i havent been able to get online, hence the lack of replies.

There have definitley been some valid points, reverse polarity protection and the current it takes to switch the solenoid. I will probably resurrect this thread once im back at uni and have had a chance to chat with the lecturer to see if he thinks the project is worth while.

Link to comment
Share on other sites

  • 1 month later...

Hi Tris, Looks like there is plenty of scope in this project...in fact there may be too much. Don't know how long you have to complete it, but be careful how much you take on at the start.

Unless you are definately going to display the battery voltage and current on the handset I suggest that bi-directional communication may not be necessary. If you select the correct RF modules at the beginning you may be able to add that functionality later, by which time you will already have a demonstrable project under your belt.

As already mentioned the safety aspect is important and I think could be catered for with a simple algorthm in both the transmitter & receiver - like a pseudo number generator or CRC that will enable you to validate the commands properly. A nice real world problem this.

I have virtually no experience of operating winches, but one of the things that I like the idea of is PWM control of the winch motor itself for slow starts etc [not even sure if this sort of thing would be handy in practice?] There are some amazing MOSFETs out there these days, and they are not very expensive. Put a 10 or so in parallel and you really can control massive currents. You will need some serious free wheel diodes too, but if you use contactors for controlling the motor direction you will only need one bank for the speed control.

'Don't take on too much' I say, but then start raving on about speed control... Sorry about that.

Hope it goes well. :)

Link to comment
Share on other sites

There are many parts to this, you could do your entire project on any one of them regardless of the system as a whole (there are plenty of books written on each).

If it were me, I'd be inclined to build a very basic setup first, for example using a Maplin RF module & a couple of FETs to trigger the existing solenoids. That gets a very quick proof of concept but with plenty of things that you can then point to as being in need of improvement, either for performance or safety reasons. You can then attack that list as time allows and/or your interest takes you.

Not only does that make the project "expandable" but it's closer to a lot of real-life product development so might even help you get a job at the end of it.

Link to comment
Share on other sites

  • 2 weeks later...

Some food for thought here:

http://science.slashdot.org/story/11/10/14/1211257/scientists-build-wireless-bicycle-brakes?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Slashdot%2Fslashdot+%28Slashdot%29

"Computer scientists at a German university have built a set of brakes controlled using a small motor for a braking mechanism and a wireless signaling device to tell it when to brake and how hard. 'Making a popular set of bike brakes wasn't really the point of the project,' says blogger Kevin Fogarty. 'The project was to find out how to make the wireless connections between two components of a system that has to operate in real time – with milliseconds of difference between success and failure (PDF) – more reliable than systems that are normally connected by a wire.'"
Link to comment
Share on other sites

Thats Definitely along the lines of what i am trying to achieve but controlling a motor in one direction on another. Ive been speaking to a coupe of lecturers and they have reccomended using an Arduino Protype board - Here which for about 20 quid is easily programmable and there is a fair amount of support with online forums etc. However im not really too sure how it can be linked up to a link (whether it be fm / bluetooth etc) It has got a Tx and Rx led on the board that can been see on page 2 of the Data Sheet but from my understanding of it The LEDs just show if data is being transfered via USB

Serial: 0 (RX) and 1 (TX).

Used to receive (RX) and transmit (TX) TTL serial data. TThese pins are

connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .

Would i be right in saying that i would need to use one of the 14 digital data outputs to send data to a bluetooth module for example and then have another Arduino board on the other end to control the solenoids?

Or alternatively i have found out that Arduino do a Bluetooth Board Can i pair two of these boards together and use them to transfer the data from the vehicle to the controller?

Another point which the lecture has raised is that there should be some kind of sensor to monitor the amount of rope left on the drum, I quickly dismissed his first idea of an optical sensor pointing out that it woudnt work well when the winch is burried in mud and water. The idea that we have come up with is using reed switches or similar to count the number of rotation of the drum and work out how many turns the it takes to go from a full drum to a drum with four turns left on it (assuming an ideal senario with no bunching etc). This would have to be fed back into the circuit and override the 'Winch Out' function of the controller.

Link to comment
Share on other sites

The Arduino's are great if you haven't had much experience programming, however once you get down to the nitty-gritty they're incredibly bloated. Wouldn't really matter for this project but if you try and do anything remotely fast then you need to pay attention to how you code - or do what I did - rip out the Arduino libraries and write my own.

You're kind of correct in how you interface - it completely depends on what transceiver you're talking to. The one thing to note is that Serial0 on the Arduino's are usually interfaced to the USB transceiver so you can use them but then you lose a useful debug port. Most transceivers I've come across tend to operate either over I2C, SPI or Serial so depending on which interface will dictate which pins you use.

Re: your switches - unless you get some highly specced switches they're going to suffer from the mud as well.

Link to comment
Share on other sites

As you have probably worked out I dont know much about programming so i am leaning towards using the Arduino boards. I have ruled out the Bluetooth Arduino boards as i have had reports that they kind of work at a distance of 10m and anything over that ive got to be 'one of the lucky ones', and also they are almost £100 each!

What i am hoping to use instead is an Alpha FM Transceiver Module that has a range of up to 300m which is more than i will need and they cost less than a tenth of the price. The interface is SPI so they should be compatable with the Arduino boards (hopefully). Does all of this sounds feasable or am i barking up the wrong tree?

While looking into the switches i have come across Rotary Encoders that would replace the job of using multiple reed switches, but once again they could suffer when it comes to the mud! Althought realistically as long as i can demonstrate it in the lab thats all i need to do.

Link to comment
Share on other sites

My robot fish has an external on-off switch. A rotating brass rod with two 'o' ring grooves around it slips into a brass tube in the body. The switch on the inside isn't even splash proof! Same tech for the tail drives with tendon cables in the water and servos in the dry body cavity. And as you say, no need to build this part for a lab demo, just some sketches of various waterproofing solutions :)

Link to comment
Share on other sites

As you have probably worked out I dont know much about programming so i am leaning towards using the Arduino boards. I have ruled out the Bluetooth Arduino boards as i have had reports that they kind of work at a distance of 10m and anything over that ive got to be 'one of the lucky ones', and also they are almost £100 each! What i am hoping to use instead is an Alpha FM Transceiver Module that has a range of up to 300m which is more than i will need and they cost less than a tenth of the price. The interface is SPI so they should be compatable with the Arduino boards (hopefully). Does all of this sounds feasable or am i barking up the wrong tree? While looking into the switches i have come across Rotary Encoders that would replace the job of using multiple reed switches, but once again they could suffer when it comes to the mud! Althought realistically as long as i can demonstrate it in the lab thats all i need to do.

Interfacing SPI with the Arduino boards is dead simple - I did it for my final year project when I built an OBD-II simulator for part of the project. The Arduino (Mega in this case) communicated with a Microchip SPI CAN-bus transceiver.

Pay attention to the quoted "range", I suspect for 300m you're going to need an aerial (not just that board) and it's surprising how much aerials cost (they're not expensive but more than you'd think for what is essentially a tuned piece of wire). Again it's "up to" 300m so chances are it'll need to be line of sight and with a decent aerial attached. Not an issue here but do pay attention to the current demands of any electronics - beefier transceivers may not be able to be powered directly off the Arduino (that one should manage at a guess) and therefore you'd need to factor in the cost of building some form of voltage regulation.

Similarly - when you have the choice of using a break-out board for prototyping use it! (Ask me how I know that!) Once another member of one of my groups ordered just the camera (not the breakout version). Thankfully using some ingenious methods which involved a candle and mini blow-torch at one point one of the technicians managed to mount it. When it came to using a gyroscope for my final year project because it was automotive rated and therefore stupidly expensive (region of £70 for just the chip) we opted to pay the extra £20 and get it pre-mounted on a breakout. After all bugger up attempting to solder it on once and that's £50 loss compared to buying the breakout board.

Link to comment
Share on other sites

As I've said before, you need to work out which bit you're most interested in - it's fairly clear you're not big on programming, and starting with an arduino is no more practical as a proof-of-concept than getting two laptops with WiFi cards and setting up Yahoo Messenger between them to say "winch in", "winch out", "stop, lol!"*. If you're buying RF modules anyway you can do the whole thing without a microcontroller using a cheap eBay/Maplin wireless module & a bit of logic to act as the safety cutoff, the challenge then being to work out the safety modes and work out the practicalities of switching the power side reliably.

If learning programming is not a requirement then it will be a massive drain on your time which could be much better spent, if it *is* a requirement then the arduino is not a shining beacon of competence to add to your CV.

If you want to monitor the winch drum you could use a VR sensor, robust automotive ones are available for peanuts (look in the megasquirt forum) and a notch on the drum. You don't need the resolution of rotary encoders etc. and they are fragile & expensive. Ultimately though, counting turns could be problematic as winch rope doesn't play nice and lay in nice neat rows on the drum, motors can over-run (you need to know which way the drum is going, not just how many turns it's made). Perhaps you could use some sort of marker attached to the rope at a pre-set point so it's detected when it passes through the fairlead.

If you want any sort of range then you'll not only need an antenna, but decent hardware and the correct choice of band/protocol. If memory serves, Bluetooth is limited by design (timing etc.) such that it's physically unable to operate over distances much further than 100 yards no matter how much power you put behind it.

I still think you should start by just buying something like this:

http://www.maplin.co.uk/three-channel-wireless-remote-control-kit-46974

That gives you three on/off outputs to play with, and works out of the box, so you can then very easily work out a safety setup like "these two buttons must be pushed for it to work" using very basic logic (no programming required). From there you can add the other stuff like cutoffs, make the system more physically and electrically robust, up the switching current, make the keyfob easier to use (replace fiddly buttons with big chunky ones etc.), add hard-wired controls for the driver (who gets priority when both want different things, how can you make the safety cutoff work from multiple sources to stop the driver winching the bitch's hand off, etc...).

* = As in neither will fit into a hand-held keyfob, both will use more power than is practical for battery-powered operation, and both are overkill for the application.

Link to comment
Share on other sites

  • 2 weeks later...

If you want to monitor the winch drum you could use a VR sensor, robust automotive ones are available for peanuts (look in the megasquirt forum) and a notch on the drum. You don't need the resolution of rotary encoders etc.

Im assuming that by a VR Sensor you mean a Variable Reluctance sensor? what type of circuitry will be needed to detect the signal as (if i understand correctly) they give out a sine wave output? I havnt been able to find any information on whether they dectect the number of turns in both directions?

Programming hasnt got to be a big part of the project (althought im aware that my project is becoming based around it) the project is more about being able to make engineering decisions and managing time to get a working unit and meeting all the critera deadlines etc. Due to this i am probably leaning towards the arduino boards with the aim of adding more 'wow factor' once have got everything link up and working together

I have had a look at the link which says about programming using the ATmega chip, even thought this would give me a better speed the lecturer that I have been allocated with as a project supervisor has advised me against it as he is more familliar with the arduino boards and feels he is able to provide more support to me if i choose the Arduino board.

With the range that is quotes from the transcievers, realistically as long as i can demonstrate that the 6 feet away on the project open day that is all thats required.

Thanks for the advice about the breakout board, i will remember that when i come to ordering the components which should hopefully be within a few weeks.

Link to comment
Share on other sites

Regarding the ATmega vs. Arduino - they are effectively one and the same. The ATmega is just the processor whilst the Arduino adds a defined hardware platform and a software library on top of that. The Arduino platform basically consists of a small micro-controller which provides USB <-> UART translation whilst also simulating the STK programming protocol which can be used for ICP (In-Circuit Programming) of the Arduino. There is then the main processor which on the Arduino Mega 1280 and 2560 is one of the ATmega series, on other boards it's a less capable processor.

The software aspect of Arduinos consist of the "IDE" (if you can call it that) and a set of libraries which abstracts the hardware. Basically it creates a (slow and in-efficient) abstraction layer which means that you can say pinMode(...) rather than interacting with specific registers on the processor.

What I was indirectly referring to with the previous posts were that the hardware for the Arduinos are actually fairly well designed and capable bits of hardware. It's the software libraries on top that limit things but those can be re-written and you can therefore utilise the full capabilities of the AVR processors. So my advice start with the Arduino because they're well supported, however if (unlikely in your project I would imagine) you do find that you need more processing power then you can just re-write the libraries. Or there are a couple available - such as mhvlib (makehackvoid.com if I remember correctly) which basically move runtime decisions which never change into compile-time macros.

Link to comment
Share on other sites

Im assuming that by a VR Sensor you mean a Variable Reluctance sensor? what type of circuitry will be needed to detect the signal as (if i understand correctly) they give out a sine wave output? I havnt been able to find any information on whether they dectect the number of turns in both directions?

A VR sensor just detects a metal thing passing by it, a bit like a microphone. Stuff like counting pulses (hence turns) or figuring out direction is down to your circuitry / microcontroller interpreting what it sees. Usually to work out direction you need two sensors with an offset (called quadrature or bi-phase) to work it out.

VR sensors are used in EDIS, also most ABS systems so plenty of rugged reliable automotive sensors out there.

Link to comment
Share on other sites

The arduino system is intended to get people into using microcontrollers and basic programming as an easy introduction. Whilst this will make a lot of the parts of your project easier, most of the electronics industry tends to design bespoke circuits for the application. You probably need to think carefully about the goals of your project before making any decision (and not just the written out defined goals). Arduino bypasses quite a bit of the basic hardware development you would need, but you might find you learn a lot more about hardware design and software skills by working from scratch. These skills are arguably more useful to you in the long term if you want to pursue an electronics career.

Just a thought!

Link to comment
Share on other sites

  • 3 weeks later...

I have now got all of the parts that i require to start building the project, I have decided to go with the arduino board as i have not got the experience and knowledge to create a board from scratch, if i can get the project to work i will then attepmt to use the ATmega chip as the basis for a stand alone circuit without the use of the arduino board - however the important thing is to have a working circuit.

currently my biggest issue is trying to get the boards to talk to each other, ive got two of these boards - http://arduino.cc/en/Main/ArduinoBoardUno with two 433MHz rf transcievers - http://www.rfsolutions.co.uk/acatalog/DS-ALPHA-TRX-5.pdf, both of these work with an SPI interface

The Arduino website says "SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library" so im assuming that it takes four inputs from the transciever, however from looking at the RF Transciever datasheet it only mentions two ports used for the SPI interface

"Pin 12 SDI DI SPI data input

Pin 13 SCK DI SPI clock input"

How would i go about connecting these together?

Cheers

Tris

Link to comment
Share on other sites

I have now got all of the parts that i require to start building the project, I have decided to go with the arduino board as i have not got the experience and knowledge to create a board from scratch, if i can get the project to work i will then attepmt to use the ATmega chip as the basis for a stand alone circuit without the use of the arduino board - however the important thing is to have a working circuit.

currently my biggest issue is trying to get the boards to talk to each other, ive got two of these boards - http://arduino.cc/en...ArduinoBoardUno with two 433MHz rf transcievers - http://www.rfsolutio...ALPHA-TRX-5.pdf, both of these work with an SPI interface

The Arduino website says "SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library" so im assuming that it takes four inputs from the transciever, however from looking at the RF Transciever datasheet it only mentions two ports used for the SPI interface

"Pin 12 SDI DI SPI data input

Pin 13 SCK DI SPI clock input"

How would i go about connecting these together?

Cheers

Tris

You are missing pin 1 SDO and pin 14 nSEL

MOSI means Master Out Slave In and MISO the opposite.

So MOSI pin 11 Goes to SDI pin 12 and

MISO pin 12 goes to SDO pin 1,

SCK pin 13 to SCK Pin 13, and

SS (Slave Select) pin 10 to nSEL pin 14.

I think

Oh and obviously GND and VCC will need connecting :)

Link to comment
Share on other sites

You are missing pin 1 SDO and pin 14 nSEL

MOSI means Master Out Slave In and MISO the opposite.

So MOSI pin 11 Goes to SDI pin 12 and

MISO pin 12 goes to SDO pin 1,

SCK pin 13 to SCK Pin 13, and

SS (Slave Select) pin 10 to nSEL pin 14.

I think

Oh and obviously GND and VCC will need connecting :)

Thanks, thats a great help, i was starting to panic thinking that i had ordered the wrong bits and that they were not compatible together, Now you have explained it its clear. I was looking for pins that had the same name - :blush:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy