Shop OBEX P1 Docs P2 Docs Learn Events
Got a new project for work — Parallax Forums

Got a new project for work

jsaddictionjsaddiction Posts: 84
edited 2012-11-06 17:11 in Propeller 1
Ok i have been tasked with designing a simulator/tester for a gyrocompass converter. This gear will accept a wide gamut of input signals from an old analogue gyro and convert it to NEMA0183 data for use in various navigational equipment. What i started doing was working with the step-by-step portion of the inputs. The system under test will accept a signal between 20v to 100vdc. This happens on three wires with one extra wire for GND (S1, S2, S3, REF) I figure an optoisolator and a common emmiter set up would be sufficient to take the 3.3vdc from the prop to the required input voltage. Current draw on the inputs is unknown at this point but i wouldn't imagine it would be much. The signals are as follows:

step # S1 S2 S3
1 H L L
2 H H L
3 L H L
4 L H H
5 L L H
6 H L H

This is all set up in a DAT table using byte sized binary and using a repeat loop it seams to light up the lights on my Prop BOE pretty well and in order.
DAT
states    byte  %100, %110, %010, %011, %001, %101

Here is the issue: The unit under test requires a 36X step by step meaning all 6 steps will be cycled through before you increase by one degree. 216 steps in total. I am trying to display a mathematicaly calculated "current Heading" and compare it with the unit under test's heading. I need this to be accurate to the 1ths of a degree. The math doesn't seem so simple as each step = .00629 degrees??? how can i do this?
«1

Comments

  • JonnyMacJonnyMac Posts: 9,108
    edited 2012-09-30 11:36
    This is where the size of 32-bit values are helpful. You could use a floating point library, or do it with fixed point like this:
    tdegrees := nsteps * 629 / 10_000
    


    This with give you tenths of degrees. Note that the maximum number of steps is going to be 3,414,123 ( 2^31 / 629).
  • kwinnkwinn Posts: 8,697
    edited 2012-09-30 11:40
    If each step represents 0.00629 degrees then 360 degrees would have approximately 57233.70429252782 steps, and one degree would be approximately 158.9825119236884 steps. Multiply by a power of 10 to get the desired precision and use 32 bit integer math, then do the testing in units of steps. At the end convert the 32 bit result to degrees.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-09-30 12:55
    What i am trying to do is increment by whatever i need to and be able to keep up with the current heading. Here is a peice of code used to increment the step and update my headding variables. This code uses the "decCurHead" as a step# from 1 to 216
    steps := degree * stepType * 6                        'Calculate steps needed to shift heading
    
      if dir == 1                                           'Coming right                                           
        repeat x from 0 to steps                            'Loop cycles the steps necissary to shift head to desired head. Changes current head
          outa[0..2] := states[i]                           'Looks up data table for next state and outputs it to pins
          states ++                                         'increments to next state
          if states > 6                                     'cycles state count to 0 if states are more than 6
            states := 0
          decCurHead ++                                     'increment decimal heading
          if decCurHead > 216
            decCurHead := 1
            currentHead ++
            if currentHead > 359
              currentHead := 0
          pst.str(string("Current Head is:  "))
          pst.dec(currentHead)
          pst.str(string("."))
          pst.dec(decCurHead)
          pst.newline  
          clk.pauseMsec(100)                                'pause used to slow program down used for slew rate
    

    i would like to replace the decCurHead ++ with some sort of function that will increas the decimal variable. I am just not sure that after 80 degrees of slewing the heading will be correct.
  • kwinnkwinn Posts: 8,697
    edited 2012-09-30 22:54
    Here is the issue: The unit under test requires a 36X step by step meaning all 6 steps will be cycled through before you increase by one degree. 216 steps in total. I am trying to display a mathematicaly calculated "current Heading" and compare it with the unit under test's heading. I need this to be accurate to the 1ths of a degree. The math doesn't seem so simple as each step = .00629 degrees??? how can i do this?

    I am not sure I understand your explanation. I am guessing that the 6 states are the drive signals for a motor. It sounds like you are saying that you have to step through the states %100, %110, %010, %011, %001, %101 thirty six times (a total of 216 steps) to turn the gyro 1 degree. Is this correct?

    If this is correct where does the 0.00629 degrees per step come from. If there are 216 steps per degree I get 0.004629629 degrees per step. Is this just a typo?
  • kwinnkwinn Posts: 8,697
    edited 2012-09-30 23:21
    The simplest way to track this might be to have a step counter that counts up to 215 and then increments a degree counter on the next step. The step counter would then be set to zero. The fractional degree could be calculated by multiplying the step counter by 0.004629629 and then added to the degree counter value to provide the current position. This would ensure there is no accumulated rounding error.

    Of course if the gyro turns in both directions this would have to be accounted for in the counting and calculations.

    After looking at your code more carefully it appears you are already doing what I suggested but you may not be taking the correct number of steps in the loops. Hard to be sure without seeing all the code.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-01 06:03
    If there are 216 steps per degree I get 0.004629629 degrees per step. Is this just a typo?

    you are correct sir. that was a typo thank you for pointing that out. also after working out some numbers i found that i could just increment my decimal value by 0.125 every 27 steps and then trunicate the value to show only the tenths place. I am going to work with that some and see what i come up with. I haven't posted the whole code yet because it is in a state of embarrasing disarray. I will try to clean it up and add the solution i am talking about. i am also going to write it so that it will use the serial terminal object for user input and to watch the numbers shift. That way people can upload it and "see" what im talking about. This problem is kinda hard to explain. You are correct and incorrect about it driving a motor. The gyrocompas converter is just a peice of equipment that converts those stepped signals to a nema HDT string. As the code moves along i will include something to watch the nema sentences and once the prop has completed the slewing process it will look at the nema sentences from the converter and return an error. Thank you for your help everyone. Please let me know if there is any more insite into this project. I have to get this up and running as soon as I can as this peice of equipment has lost any commercial repair and now i am the sole sorce for repair and the broken parts are mounting up.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-01 07:20
    Here is a quick and dirty program that shows what i understand so far as how do do this. I am not sure how to multiply a fractional number as you said earlier so this code doesn't work correctly. I still need to make a way to tell the program what heading you would like to slew to and then insert that into a degree handeler so it knows what direction to go and then the code attached needs to be fixed and implemented for the oposite direction. Kinda new at this so please excuse the ignorance. I "play around" with the prop and usually controll flashy lights or lcd screens and such. My fiirst go at generating a signal to be used as a peice of test equipment.
  • kwinnkwinn Posts: 8,697
    edited 2012-10-01 08:20
    If you are looking for one tenth degree resolution in your output there is a simple way of doing that with a case statement using the number of steps. Since there are 216 steps per degree a tenth of a degree would be 21.6 steps, so you add 0.1 to the heading if the number of steps is between 11 and 33, 0.2 if between 34 and 57, etc.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-01 08:31
    very interesting. didn't think of it that way... Time for some experimentation.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-10-01 09:04
    If I understand correctly, each degree of rotation takes 216 steps, and a complete 360 rotation would be 216 * 360 = 77760 steps. If I were you, I would keep track of the current position in units of steps, since this is a precise measurement. You can then convert from degrees to steps to determine the number of steps that you would need to reach a certain heading.

    As an example, let's say the current heading is 21300 steps. This is (21300*3600 + 77760/2)/77760 = 986 tenths of a degree, or 98.6 degrees. Now let's say you want to move to 101.3 degrees. This heading is (1013 * 77760 + 1800)/3600 = 21881 steps. So you would need to move (21881 - 21300) = 581 steps.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-06 07:40
    I appologize for the delayed response. I have been writing and rewriting code for the past few days and this thing is getting big. Anyway I wanted to thank all that helped with this and let Dave know I have went with his suggestion. I am storing the heading in the number of steps. What i am currently working on is more of a final project all of the peices work now its time to put it all together. But first I am going to write some assembly that will be running in its own cog that will take #of steps, direction, and slew rate and then make the appropriate changes to the output. My command has notified me that this project must take the front burner as the broken parts are piling up and noone else can fix them. If anyone has any ideas on how to make an efficient pasm program to do what i need please let me know I will greatly appreciate any help on this so that development stage will be quicker
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-06 12:01
    Here is what i have so far on the output driver. so far it works. I can make it initialize the outputs and then change to another by changing the steps variable in the hub ram
    DAT
                  org 0
    StepCtrl      mov     mask, S1                          'Store S1 pin to mask
                   or     mask, S2                          'Include S2 in mask
                   or     mask, S3                          'Include S3 in mask
                  mov     dira, mask                        'Make pins used outputs
    
                  mov      tmp, par                         'Load tmp with steps address
                  mov stepsadd, tmp                         'Load steps address into stepsadd
                  add      tmp, #4                          'Move pointer to next hub variable
                  mov   diradd, tmp                         'Load dir address into diradd
                  add      tmp, #4                          'Move pointer to next hub variable
                  mov  slewadd, tmp                         'Load slew address into slewadd
                  mov     outa, state5                      'Initilize outputs to starting state
    
    
    loop         rdlong Osteps, Stepsadd                    'Get Remaining steps from hub ram
                    tjz Osteps, #Loop                        'If Rsteps = 0 then jump to loop and try again
                 rdlong   Odir, diradd                      'Get Direction 
                 rdlong  Oslew, Slewadd                     'Get Rate of change
                 
                  mov     time, cnt                         'Record current system counter into time var
                  add     time, Oslew                       'Add the delay to the time var
    Steploop        tjz Osteps,#loop                        'Go back and read variables if stepping is complete
                 waitcnt  time, Oslew                       'Wait until delay has passed and setup for next wait command
    
    'some code that selects which step to go to
    'Has to store the current step
    'Has to use dir variable to know which one to go to
    
    
    step0         mov     outa, state0                      'Output state 0 to pins
                  sub   Osteps, #1                          'Decrement Ostates
                 wrlong Osteps, Stepsadd                    'Write steps remaining to hub ram
                  jmp       #Steploop
                  
    step1         mov     outa, state1
                  sub   Osteps, #1
                 wrlong Osteps, Stepsadd                     'The outa instructions here do not account for
                  jmp       #Steploop                       'the pin mask and should do so
                  
    step2         mov     outa, state2
                  sub   Osteps, #1
                 wrlong Osteps, Stepsadd
                  jmp       #Steploop
                  
    step3         mov     outa, state3
                  sub   Osteps, #1
                 wrlong Osteps, Stepsadd
                  jmp       #Steploop
                  
    step4         mov     outa, state4
                  sub   Osteps, #1
                 wrlong Osteps, Stepsadd
                  jmp       #Steploop
                  
    step5         mov     outa, state5
                  sub   Osteps, #1
                 wrlong Osteps, Stepsadd
                  jmp       #Steploop
                  
                     
                     jmp #loop                              'Jumps to Loop
    
    S1         long  |< 0                                   'Pin used for S1 output
    S2         long  |< 1                                   'Pin used for S2 output
    S3         long  |< 2                                   'Pin used for S3 output
    tmp        long  0                                      'Tmp variable used for setting up variable addresses
    Osteps     long  0                                      'Used for remaining steps
    Odir       long  0                                      'Used to dictate direction of the steps
    Oslew      long  0                                      'Used for waitcnt related to slew rate holds number of clock ticks
    Stepsadd   long  0                                      'Address of steps in hub ram
    Diradd     long  0                                      'Address of direction in hub ram
    Slewadd    long  0                                      'Address of slew rate in hub ram
    mask       long  0                                      'Used to store pin mask
    time       long  0                                      'Used in waitcnt stores system time + slew rate in clock ticks
    state0     long  %100                                   'State0 output
    state1     long  %110                                   'State1 output
    state2     long  %010                                   'State2 output
    state3     long  %011                                   'State3 output
    state4     long  %001                                   'State4 output
    state5     long  %101                                   'State5 output
    
                  FIT 492                                   'Ensures the program fits
    
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-22 17:21
    OK so the output driver is working great. I have the ability to tell it which heading i want and a slew rate and it will take the shortest turn and output the nessisary pulses. It seams to be very accurate since its all done in PASM and spin is only used to pass variables. I am pretty proud of myself at this point. After that high point i have moved onto making a user interface with it. First i extracted a quadrature encoder with a push button from an old car stereo and built a custom break out board. Once i got all of that done i started looking into reading it with the prop. I downloaded several objects from the obex and found i just could not get them to work. I attached an oscope suspecting a bad rotary switch and found that it does work however the phase shif wasn't anywhere near the optimal 90 degrees. More like 160 degrees. after finding this it was time to make another object. Since i had such a good experience with the first object i figured the second on would be even better. I set out on that venture and after a day of writing and several days of rewriting i got my next fully fledged object. This one is now my pride and joy. It allows the calling method to initialize the encoder with an upper limit a lower limit and if it will roll over when it reaches the limits or if it will just stop at the limits. experimenting with this has proven to be very successful and i can't get it to fail. haven't tried any negative limits yet though. (probably won't work as im not using any signed math) with these two objects in hand i downloaded an object for the 4 X 20 serial lcd display featured on the parallax store. Playing around with these objects while writing some code for the top object I have been pretty successfull. All this good news must come to an end however, i am currently stuck on one thing. I don't really understand strings and how i could do any conversion. I am trying to write some extra methods to the LCD object to allow me to write a decimal number to the display. Doesn't sound too hard but i need to do it in two different ways. first I need to complete the obvious. I have to pass a variable that holds a number and display that number on the screen. The second and slightly more complex (to me) write a number that is also passed from a variable but this time i need it to display with 3 digits the result should look like this on the screen.
    first way variable might hold 36. The screen should display "36"
    second way variable might hold 13. The screen should display "013" the end result is to have a heading value of something like 3264 in a variable and display "326.4" on the display and if the variable had 902 display "090.2" on the lcd.

    I know it was long and i apologize. I haven't updated this thread in a while and a lot of time has gone into this project. If interested I could post some code. I am acctually considering posting the quadrature object on the OBEX after some scrutinizing of course
  • kwinnkwinn Posts: 8,697
    edited 2012-10-22 17:38
    Take a look at the DecimalPlace object in the OBEX. I think it will do what you want.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-22 18:10
    very interesting i think i saw some code similar to that one somewhere else. anyway I understand it a little better however im not really sure how to force the array to put zeros in front of the heading if its less than 100 degrees. i e
    before    after
    953        095.3
    33         003.3
    2702       270.2
    
  • kwinnkwinn Posts: 8,697
    edited 2012-10-22 18:59
    Take a look at the "PUB dec (value)" routine in the "FullDuplexSerial" object.
  • kwinnkwinn Posts: 8,697
    edited 2012-10-22 20:40
    Sorry, after looking at it more closely I realized that's not much help. What you need to do is modify the section that now shifts the data 1 position to the right and inserts the decimal point. That's this area.
          repeat dp                 ' Shift all bytes that need shifting to the right one place
    
            dp_buffer[index --] := dp_buffer[index - 1]      ' Shift 1  place to the right     
    
          dp_buffer[index] := (".") ' Insert decimal point
    
        else                        ' 0 insertion req'd in addition to decimal point
    
          repeat numDigits          ' Shift all bytes that need shifting to the right
            dp_buffer[index-- + dp - numDigits + 1] := dp_buffer[index - 1]
          repeat (dp - numDigits)           ' Insert zeros as req'd
            dp_buffer[index--  + dp - numDigits + 1] := ("0")             
          dp_buffer[1] := (".")     ' Insert decimal point        
          dp_buffer[0] := ("0")     ' Insert leading "0"
    

    The data needs to be shifted 1 + the number of leading zeros to the right, and the decimal point and leading zeros inserted. The amount to shift can be calculated by subtracting the index (actual number of digits) from 5 (number of digits you want + decimal point). The number of leading zeros to insert is 1 less than the shift amount.
  • pgbpsupgbpsu Posts: 460
    edited 2012-10-23 07:29
    Kwinn is right that there are objects out there that do this. I suggest having a look at the FullDuplexSerial4portPlus Object. If I want to do what you're asking (print 36 as 036) I'd do it this way:
     uarts.decx(idx,4)  ' print idx value as zero-padded: 0042
    

    The relevant code looks like this:
    PUB decx(value, digits) | i
    '' Prints zero-padded, signed-decimal string
    '' -- if value is negative, field width is digits+1
      decl(value,digits,2)
    
    PUB decl(value,digits,flag) | i, x
    '' DWD Fixed with FDX 1.2 code
    
      digits := 1 #> digits <# 10
      
      x := value == NEGX                                                            'Check for max negative
      if value < 0
        value := ||(value+x)                                                        'If negative, make positive; adjust for max negative
        tx("-")                                                                     'and output sign
    
      i := 1_000_000_000
      if flag & 3
        if digits < 10                                      ' less than 10 digits?
          repeat (10 - digits)                              '   yes, adjust divisor
            i /= 10
    
      repeat digits
        if value => i
          tx(value / i + "0" + x*(i == 1))
          value //= i
          result~~
        elseif (i == 1) OR result OR (flag & 2)
          tx("0")
        elseif flag & 1
          tx(" ")
        i /= 10
    

    If you're LCD object contains a version of FullDuplexSerial, you may already have these methods. If not, you should be able to add them. I think you can also do this using the Numbers object:
    uarts.str(Num.ToStr(filesize, Num#SDEC11))  ' print filesize but pad this output string to 11 spaces
    

    I think this method is a bit more complicated but I think it has more options (space, commas, etc). Have a look at the Numbers object. It has a large table that details all the different formats.

    Congrats on your success.
    Peter
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-24 16:34
    Thanks to all for the help. That code was pretty tricky with all the array shifting. Got confused a couple of times. The method is built and works great. Now its time for the menu structure. I will probably be back. After the menu structure i will need to build an object similar to the step by step system but this time it will drive a stepper motor which is mechanically coupled with a transmitter synchro. After that. I'll need an object to parse the HDT nema183 sentence coming from the converter. That way i can generate all signals used by the converter and calculate errors. Wish me luck. I'll atleast post with project updates. Thanks again
  • kwinnkwinn Posts: 8,697
    edited 2012-10-24 17:15
    Good luck. Looking forward to project updates.
  • pgbpsupgbpsu Posts: 460
    edited 2012-10-25 06:45
    There is at least one object in the obex for reading NMEA strings. It might make life easier, or at least give you some ideas. Best of luck.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-26 17:13
    stepper ctrl demo.spin

    Stepper CTRL.spin

    So the project is going well. The user interface is almost done just polishing it off and trying to correct some bugs. It seems that the first object i wrote is not working as it should. guess i didn't test it enough before using it to develop my UI. For the life of me i can not figure out why it behaves the way it does. Firstly i have the Prop BOE and i have B1-P0 / G1-P1 / R1-P2 connections made to visualize what is happening. I built this quick demo object to run the "stepper CTRL" object. first you call the start method and pass it the step type (1,36,180). Secondly with everything initilized at 0 including your heading you can then call the goto method and it will do some calculations (not fully ironed out) and store that into the ordrHead variable. the cog will read this variable and slew then calculate which direction to slew and how fast to do it. everything works fine if you use a moving right type of heading shift as the first thing to do. if you move left first then it seams P2 stays high and the heading variable changes which means its getting through the step changing instructions but it never seams to output the correct patterns on the leds. Kinda weird youll have to see for yourself. I uploaded the source code of both programs for your reading pleasure. Be kind like i said its my first program.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-27 11:55
    In the stepper control.spin file above, I am using a mov command in PASM to control the various states that are loaded into outa. In theory this should work fine but do you think that because i have other things happening on the other pins at the same time that could be where my problems are coming from? If so is there a way i can load three bits at once without effecting the other pins? I looked at the MUX commands but it seams they will only load one bit at a time depending on the z flag and the c flag. Do i need to make a loop that will handle loading the bits one at a time using MUX? Is it nessisary?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-10-27 12:13
    The MUXxx instructions will load from 0 to 32 bits at the same time from either the carry or zero flags or their complements. The mask (source field) determines which bits. Look at the description of the MUXxx instructions in the Propeller Manual. Essentially, wherever there's a 1 bit in the mask, that bit of the destination will be set to the specified flag bit or its complement.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-10-27 12:24
    My problem is that i need to load say a %110 into outa and only effect those three bits just incase something is bit banging somewhere causeing these weird problems in my program. I understand that i could load the entire 32 bit OUTA at one time however each bit would be the same. i need to load a three bits where either one or two are logical highs at a time. Post # 13 in the code section at the bottom i have the variables "state0..state5" these show what possible states i would need to load. i think the only way to use MUXxx command for this is one bit at a time.
    states     cmp     curstep, #1                 wz       'Sets Z flag if curstep = 1
     if_z      mov         tmp, state1                      'save copy of state1 into temp
     if_z      shr         tmp, #1                 wc       'Load first bit into C flag
     if_z     muxc        outa, #%001                       'Load C flag into bit 0
     if_z      shr         tmp, #1                 wc       'load second bit into C flag
     if_z     muxc        outa, #%010                       'Load C flag into bit 1
     if_z      shr         tmp, #1                 wc       'Load third bit into C flag
     if_z     muxc        outa, #%100                       'Load C flag into bit 2
    

    something like that but maybe more customized for each "state" to load or build a loop that each state change would go through. the output wave form while "stepping" through the heading should look like three squarewaves 120degrees phase shifted so that only two of the output pins are high at once. This generates a 6 bit grey code of sorts that the gyrocompass converter uses to generate NMEA0183 sentences for VHW and HDT

    The above listed code.. is it nessisary or should i just use the MOV command assuming i have other pins doing other things elsewhere in the program? ie when using the MOV command and using a literal in the source field of 3 bits in length, will it only effect just those 3 bits or whill the MOV command set the unspecified bits to lows and effect the entire 32 bits of the OUTA?
  • jsaddictionjsaddiction Posts: 84
    edited 2012-11-03 15:58
    Ok well after a little reading and a lot of experimentation i settled on the fact that the mov command works and it is not nessisary to use MUXxx commands to set each bit. The reason is because each cog maintains its own outa register and these registers are ORed together and that makes up the final output. I did find several other problems with the object that lead to the problems i mentioned in my previous posts. I got all of that fixed and assembled the output circuit to interface with the gyro converter. after scratching my head for a while i lucked onto the correct forumulas for converting my 4 digit variable into the correct steps using case statements. The reason for this is that when using a stepper ouput on a real gyro you only get 6 different steps per degree and since that is less than the possible numbers held in the tenths spot. I had to pick which numbers these 6 steps meant.

    I got all the circuitry all hooked up and started playing around with it and noticed one out standing problem. When i use a slew rate of 10 degrees or less the converter follows exactly. When i get closer to the converters upper limit of 30 degrees per second it seams to have an error inbetween 1 to 5 degrees. I think that this is because when i hit the "go" button it immediatly is outputing the pulses at full slew rate. Of course this is different than how a boat acts. I think i need to add the function of a ramp speed into my pasm code. Does anyone have any pointers on how to implement this into my code?
  • msrobotsmsrobots Posts: 3,709
    edited 2012-11-03 20:56
    Ok well after a little reading and a lot of experimentation i settled on the fact that the mov command works and it is not nessisary to use MUXxx commands to set each bit. The reason is because each cog maintains its own outa register and these registers are ORed together and that makes up the final output.

    exactly! well done.

    As long as the cog has just the used pins as output you are fine.

    After looking at your pasm I think the most easy way would be to change the slew rate to create ramping. Just start and end the first and last (or 2 each) steps with double slew-rate. (2 x waitcnt)

    So go 'half speed' before 'full speed'. This might already do it, its more like '2 steps' and not a ramp.
  • kwinnkwinn Posts: 8,697
    edited 2012-11-04 01:56
    If msrobots suggestion does not work I would suggest starting with a "long delay" time and decrement it by a fixed amount for each step until it is equal to the "short delay" time. By counting the number of times the delay time is decremented you can calculate the number of steps to the position where you start to increment the time in order to decellerate and stop. For example if you have to move 1000 steps and it takes 80 steps to accelerate to maximum speed then you need to start incrementing the delay time at step 920.
  • jsaddictionjsaddiction Posts: 84
    edited 2012-11-06 14:37
    Ok so i played around with slew rates a little over the weekend and experimented with it at work today and im happy to report i finally have it. I settled on a combination of the two ramp styles. Ramping from say 1 degree per second to 30 made the curve too sharp near the peak speeds. Rampin with a couple of different steps resulted in too drastic of a change. What i have now is to start the turn at 5 degrees a second and then adjust the waitcnt by a fixed valu each step. I tested this process using 80 different turns all with 30 degrees a second slew rate and i was never more that one tenth off. This is acceptable since there is only 1/6 degree resolution. Saved it archived it and now on to the next part. AD-10 is a furuno standard for data coms that uses a clock and balanced data lines. Simple enough development will start tomorrow. I plan to verify the signal is present and check for any error using this as an input to the testing equipment. In addition. I will add the same functions for nmea data in. Thanks guyes for all the help. Wish me luck. Its worked so far.
  • kwinnkwinn Posts: 8,697
    edited 2012-11-06 17:11
    Your'e welcome, and good luck with the next step.
Sign In or Register to comment.