Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: Help with guiding a tractor on: February 01, 2013, 07:45:26 am


I was being serious; this is the standard way that it is done professionally, albeit with more complex foam generating equipment.

Sorry no disrespect intended i just had this image of a tractor racing around the field with a foam party behind it!
that looks like a good idea havin the foam things at the end of our spray booms...

The foam markers are a common and standard way to prevent overspray for tractor spray rigs (as well as most truck mounted systems).

The other method farmers use is GPS but not a standard uncorrected unit. The professional units use corrections from a variety of external sources such as WAAS, Omnistar, Starfire, etc.

For greater accuracy (<2cm) you can use RTK GPS which uses corrections from a second GPS unit. This second unit may be purchased by the farmer and hosted on his property (costs an extra >$15,000). The other way is to subscribe to companies that provide a subscription service where the corrections are sent to your GPS receiver by mobile phone or radio network.

To do it on the cheap, try using a 'normal' GPS module (without corrections) and put the output through a Kalman filter and see how much deviation you get over a few days.



Thanks Lemming i was thinking about using a Kalman on the GPS and seeing what the deviation would be over different times.
Also to use the mag to filter out any wayward readings from the GPS.  this could increase accuracy yes?

i looked at GLONASS looks interesting and will read some more smiley
 
I think the GPS + Mag wil increase the streightness of the lines already as at the moment the tractors drive from person to person by eyeball smiley-grin
if i could get a reliable way for the tractor to start at the same places then it will work perfect smiley

w
2  Using Arduino / Project Guidance / Re: Help with guiding a tractor on: February 01, 2013, 02:07:11 am
I was wondering if anyone could think of any other ways of doing this? without GPS?
3  Using Arduino / Project Guidance / Re: Help with guiding a tractor on: January 31, 2013, 11:40:59 am
The low budget approach would be to use a "foam marker". You just need an air compressor, a small fuel tank, and some soapy water. The compressor bubbles air into the soapy mixture and forces blobs of foam out that you use as a reference to see where you've been.

ROFL!!!!!!!!!!!
i have to say this made my night!!!

im reading about GPSes and looks like 3m is about the closest i could get im of to my frend now to disscuss with him if that would be an acceptable tollerance.

from what ive read about GPS protocolls ... i think with a 3m "possible" error and a magnometer it could actually work.. maybe!
4  Using Arduino / Project Guidance / Re: Help with guiding a tractor on: January 31, 2013, 09:36:08 am
Thanks WildBill,

only prob im in Zambia so don't have the the land based transmitters to use with a differential GPS.

So i read that the GPS is accurate to 5m. i also have an idea of how the gps works but does anyone know what tipe of accuracy i will get with a moving tractor? could i expect to get the tractor to follow a line within like 2 meters? or 3?  if i make way points 7 meters apart will that mean the way point can move like 5 meters more?? or could it be pretty stable?

plz anyone with some experience help smiley

regads
w
5  Using Arduino / Project Guidance / Help with guiding a tractor on: January 31, 2013, 05:25:21 am
Hey guys,

i was approached by a friend of mine to help with his tractors, what he needs is me to make him something that can show the driver where to go,
how it works currently is that his whole field is sprayed/seeded etc by having some people stand on one side of the field and then also on the other and the tractor needs to drive from one person to the other person, needless to say this is very inefficient as the people don't measure correct and the tractor sometimes doesn't really drive straight to them and misses large pieces..

so im thinking before i think of connecting a stepper or something to the wheel to start is to do a LED strip that has red on the outer edges then yellow then green LED in the middle. the Arduino will read form a GPS and magnetometer to establish position speed and heading, and then light the LEDs to show the driver which way to turn to stay on course.

can anyone tell me if this could keep the tractor within about a meter of a designated track?(what distance error can i expect from a GPS ) where can i find a GPS that's accurate to within a meter?
Will the magnetometer be necessary?

ill save some way points on a SD card and have him work them in order....

anyone have any ideas on how to make it nice and simple? dont think a LCD will work so well in the sun.. maybe a servo with a arrow to show the way??

any ideas welcomed!

Willie

6  Using Arduino / Programming Questions / Re: crc16 supplied code on: January 07, 2013, 03:15:41 pm
Quote
(dont you just hate buts!)
depends, if the first sentence before the but is negative ....
smiley-razz agreed
Quote

Quote
so how can i calculate the LSB-CRC16 ?
int x = do_crc-16();
byte lsb = x & 0xFF;
byte msb = x >> 8;

Quote
or am i wrong and i just do the crc calc on Len, Adr , Cmd and Data[] ?
this one

Thank you Rob, ill be doing most of the code i can for the menus ect to try and be as finished as i can when my converters come

if anyone has i idea which menu lib works with the TM1638 module feel free to save me a lot of work trying to make my own smiley-wink

Thanks again for everyone's help !!!

Willie
7  Using Arduino / Programming Questions / Re: crc16 supplied code on: January 07, 2013, 02:52:37 pm
EDIT: Thanks Rob you posted while i was writing this smiley
EDIT2: oh just remembered i cant test if the crc works right with the reader as im still waiting for my serial -TTL converters...
oh but its fun when your a blond!!!

Hey Guys ,

Just an update.. its working!!!!!!!!

tried it with this card number : 07 00 EE 00 29 15 6E BD

used a buffer (just hard coded to see if it works):

Code:
   buffer[0]=0x07;
   buffer[1]=0x00;
   buffer[2]=0xEE;
   buffer[3]=0x00;
   buffer[4]=0x29;
   buffer[5]=0x15;
   buffer[6]=0x6E; // is this the LSB crc16 ?????

and got a crc of BD6E which is the last two bytes of the card number backwards (as i believe it should be) swaped is 6E and BD.
Which is GREAT smiley-grin
..
but
..(dont you just hate buts!)

maybe im understanding the documentation incorrectly (English is not my native tongue)
the documentation says when sending ill need something like:
Code:
command:
Len , Adr ,  Cmd , Data[] , LSB-CRC16 , MSB-CRC16.

response is :
Len , Adr , reCmd , Status , Data[] , LSB-CRC16 , MSB-CRC16
so how can i calculate the LSB-CRC16 ? as i used that in to do the crc calculation?

or am i wrong and i just do the crc calc on Len, Adr , Cmd and Data[] ?
i think that should give me 2 bytes and use them as the last 2 bytes to be sent?
 
Im guessing im wrong so will start sending data to the reader to see if it works smiley-roll-sweat

Again any insight is happily received.

Thanks
Willie
8  Using Arduino / Programming Questions / Re: crc16 supplied code on: January 07, 2013, 01:08:24 pm
Thanks Guys for the fast responses,

im happy the code is right i actually tried sending a array must have done something stupid (as usual).....

Thanks mark i agree your code looks better and easier to read smiley


You are trying to set a variable of char * type to 7.  7 is an integer, not a pointer-to-char.

Why not something like
Code:
void whatever ()
{
  unsigned char buffer [BUFLEN] ;
  .. put stuff in buffer
  unsigned int reply = uiCrc16Cal (buffer, BUFLEN) ;
  .. use the crc...

In Arduino you don't need to say "short" as ints are already 16 bit.


Personally I'm not a fan of verbose coding style with types encoded in the variable names, and that
function is probably a lot easier to understand rewritten more concisely with better var names:
Code:
unsigned int uiCrc16Cal (byte * buf, byte len)
{
  unsigned int crc = PRESET_VALUE ;
  for (byte i = 0; i < len; i++)
  {
    crc ^= buf [i] ;
    for (byte j = 0; j < 8; j++)
    {
      unsigned int feedback = (crc & 0x0001) == 0 ? 0 : POLYNOMIAL ;
      crc = (crc >> 1) ^ feedback ;
    }
  }
  return crc ;
}

ok sorry i know i read in some books i must put it in "" totally slipped my mind thank you!!
Quote
Code:
unsigned char const * cardno = 7;

Do you mean:

Code:
unsigned char const * cardno = "7";

Your code had the address of a pointer to who-knows-what at address 7.

Thank you Rob, i have looked at that and i wasnt sure if that is the same as this(or would compute the same  smiley-eek-blue
Quote
ok now to get working again smiley

Thanks everyone ill report back how it goes smiley-grin

regards
Willie
9  Using Arduino / Programming Questions / crc16 supplied code on: January 06, 2013, 03:16:40 pm
hey guys,

i started a project a little while ago with some UHFreaders which im using to get into Arduino...
Ive run into a few problems but slowly im working my way thru them.

at the moment im having trouble grasping the crc16 check sum that i have to send and receive every time i communicate with the reader.
Here is the code from the protocol manual:
Code:
#define PRESET_VALUE 0xFFFF
#define POLYNOMIAL 0x8408
unsigned int uiCrc16Cal(unsigned char const * pucY, unsigned char ucX)
{
  unsigned char ucI,ucJ;
  unsigned short int uiCrcValue = PRESET_VALUE;
  for(ucI = 0; ucI < ucX; ucI++)
  {
    uiCrcValue = uiCrcValue ^ *(pucY + ucI);
    for(ucJ = 0; ucJ < 8; ucJ++)
    {
      if(uiCrcValue & 0x0001)
      {
        uiCrcValue = (uiCrcValue >> 1) ^ POLYNOMIAL;
      }
      else
      {
        uiCrcValue = (uiCrcValue >> 1);
      }
    }
  }
  return uiCrcValue;
}

Which i can paste into arduino and it compiles. But when i try and call the function i cant compile:

Code:
unsigned char const * cardno = 7;
   unsigned short int reply = uiCrc16Cal(cardno,6); //here im guessing its the dataarray and length that i need to send???

the card number i have is 07 00 EE 00 A2 B4 89 61
(just a breakdown 07 is the length , 00 reader address , EE is tht command , 00 is status , A2 and B4 is the data , 89 and 61 are the CRC16 check sums LSB-CRC16 and MSB-CRC16. so i can use this to double check my crc calculations...

ive read for more than a week while doing my lcd,rtc and sd card code all which ive managed smiley-grin but the reader communication is killing my last braincells/...

oh on the LCD i have a tm1638 and its working great, but what would be the best way of making a menu structure? ive looked into menwiz but doesnt look like it will support the tm1638. at the moment i just have a bunch of strings in an array but that is very heavy on ram(from what ive read) any ideas?

any help is appreciated .

thanks
W
10  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 30, 2012, 04:40:51 am
out of pure curiosity dont i need someting like a max232 chip to talk to the reader?
dont have a clue why im getting these values.

im starting to write code to send info to the reader and then read the reply to see if that works.
at the moment im reading about crc16 check but not understanding the code very well will try some more then post if i get it working or if i donr smiley-wink


im also seriously considering moving interface to wiegand and see if that would be better?

cheers
W
11  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 23, 2012, 03:17:58 am
Just some more info,

in the protocol manual it says:
Quote
The reader communicates with host (MCU,MPU,Controller) using serial communication interface RS232 or
RS485 and complete corresponding operation according to the host command. The communication parameter is
57600bps 1 start bit, 8 data bits, 1 stop bit without parity check bit. In the process of serial communication, the
least significant bit of one byte is transmitted first and the least significant byte of command data sequence is
transmitted first.

But i cant find any mention of what that starting bit will be.

im so  smiley-yell i dont know what is going on.

Really hoping someone has some good guesses?
12  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 20, 2012, 12:59:46 am
Morning smiley-grin

yes it comes with source but uses a DLL for all functions and communication.

there is a protocol.PDF that explains how the reader communicates but doesn't really help me as maybe im not interpreting it correctly....

they all can be found at :
http://www.rfidshop.com.hk/uhf10.html
the protocol file is in the SDK.

Im thinking that im also missing something on receiving BYTES from the reader, im reading up on it and trying everything i read! haha!

the biggest problem is the fact that i cant find a starting byte, which is making life very difficult!

Thanks again for the help!!!
Willie
13  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 18, 2012, 12:48:04 pm
Hey Rob

Ok i did a putty serial and got :
Code:
î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½î{½
I set the baud-rate right so its not a erroneous reading.  smiley-sad-blue
i really dont know anymore, the readings are consistent but just dont match up to the Demo.
The demo gets the returns a byte array like this:
This happens everytime a timer ticks to get the reader scan:
Code:
        Dim ScanModeData(40960) As Byte
        Dim ValidDatalength, i As Integer
        Dim temp, temps As String
        ValidDatalength = 0
fCmdRet = StaticClassReaderB.ReadActiveModeData(ScanModeData, ValidDatalength, frmcomportindex)
        If (fCmdRet = 0) Then
            temp = ""
            temps = ByteArrayToHexString(ScanModeData)
            For i = 0 To ValidDatalength - 1
                temp = temp + temps.Substring(i * 2, 2) + " "
            Next i
            listBox3.Items.Add(temp)
            listBox3.SelectedIndex = listBox3.Items.Count - 1

does this mean i need to send that command the the reader every loop?
and why then would it give data on serial if thats required>?
i would have thought it needs to be setup once and then it will work without a query sent every loop??


thanks again
willie

14  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 16, 2012, 01:38:55 pm
Thank you Rob,

yes sorry i didnt say, i have done the reading with a lot of different read lengths, i just did the 10 to make sure i dont miss anything....

below is the info from the reader protocols which should be relevant to this question:

Quote
8.2.2 Read Data
The command is used to read part or all of a Tag’s Password, EPC, TID, or User memory. To the word as a
unit, start to read data from the designated address.
15
Command:
Len   > Adr  > Cmd > Data[] > CRC-16
0xXX > 0xXX > 0x02 > ——     >LSB MSB
Data as follows:
Data[]
ENum > EPC     > Mem > WordPtr > Num > Pwd   > MaskAdr > MaskLen
0xXX > Variable > 0xXX > 0xXX     > 0xXX > 4Byte > 0xXX      > 0xXX
Parameter Connect:
ENum: EPC length,in word units. The length of EPC is less than 15 words, can be 0 or 15. Otherwise, it
returns the parameters error message.
EPC: Be operated tag’s EPC number. EPC length according to the decision of the EPC number, EPC
numbers in word units, and must be an integer number of lengths. High word first, the high byte of each word first.
Requirement given here is a complete EPC number.
Mem: One byte. It specifies whether the Read accesses Password, EPC, TID, or User memory. 0x00:
Password memory; 0x01: EPC memory; 0x02; TID memory; 0x03: User memory. Other values reserved. Other
value when error occurred.
WordPtr: One byte. It specifies the starting word address for the memory read. For example, WordPtr = 00h
specifies the first 16-bit memory word, WordPtr = 01h specifies the second 16-bit memory word, etc.
Num: One byte. It specifies the number of 16-bit words to be read. The value is less then 120, can not be 0.
Otherwise, it returns the parameters error message.
Pwd: Four bytes, they are Access Password. The most significant word of Access Password is first, the most
significant byte of word is first. The first bit of 32-bit access password is left, and the last bit of 32-bit access
password is right. Only done the memory set to lock and the Tag’s Access Password is not zero, it needs right Pwd.
In other cases, Pwd can be zero.
MaskAdr: One byte, it specifies the starting byte address for the memory mask. For example, MaskAdr =
0x00 specifies the first EPC bytes, MaskAdr = 0x01 specifies the second EPC bytes, etc.
MaskLen: One byte, it is the mask length. That a Tag compares against the memory location that begins at
MaskAdr and ends MaskLen bytes later. MaskAdr + MaskLen must be less the length of ECP number.
Otherwise, it returns the parameters error message.
Notes: That a tag compares against complete EPC number when the MaskAdr and MaskLen vacant.
Respond:
Len   > Adr   > reCmd > Status > Data[]                > CRC-16
0xXX > 0xXX > 0x02    > 0x00   > Word1,Word2,… > LSB MSB


So the reader returns the Len (of data) , adr( of the reader which is 0x00) , reCmd > Status > Data[]> Checksum.

but there is no defined starting bit that i can look for smiley-sad

the structure of that return is however the same as the Demo program gave:
07 . 00 . EE . 00 . 94 . 7B . 00 . BD

but not the same as im reading from arduino :'(

i even tried deducting 48 off the incoming byte to see if its not ascii but didnt work.

any advice is greatly appreciated smiley
15  Topics / Science and Measurement / Re: UHF-RW-MP-232-V1 - UHF tag reader help. on: December 16, 2012, 08:04:22 am
You check if there is at least one byte and you start reading 10.

Check for available >=10  iso >0



Thanks Robtillaart,
yes i check to see if there is a byte with the
Code:
if (mySerialPort.available() > 0) {

I read 10 just coz i know its less, no other reason..

i dont understand iso>0 im googling it now.

any other ideas why the two reads are different?

thanks guys smiley-wink
Willie
Pages: [1] 2