pulsin then servo

alband

Senior Member
I mean. Will the accelerometer be able to give me it's current angle, or does it only measure at what rate it is accelerating? I'll ask Andrew in his thread.

Looks like it's a pretty conclusive victory for the "ready-boarded" one then.
 

Andrew Cowan

Senior Member
Accelermoneter flat = measures 1g
Accelarometer on its side = measures 0
Somewhere in between = between 1g and 0g.

So yes - as long as it is not accelarating, it gives the current angle.

However, if it is accelarating as well, it will throw off the result.

A
 

Andrew Cowan

Senior Member
It is really easy to interface - just connect the acceleraometer output to an ADC, then use read ACD to work it out.

Note that most accelerometers meansure positive and negative gs, so 0g = a variable reading of 127 (255 divided by 2).

A
 
Last edited:

vk6bgn

New Member
....then use dead ACD to work it out.
read ADC???

BTW, I just spent over an hour reading 166 posts to this thread. Was very very interesting for the first 50 or so. Very neat info about using servo’s, coding for servos; frame rates etc. etc. all to get them to work properly in the tank. Was like a good suspense novel!

Then it got to “Shame on you Alband, your on the wrong frequency!” Then posts from government agencies about rules and regulations. (I almost shut the browser down here, but I battled on.

Then BB quotes the use of 2.4Ghz for RC use in the UK. My thoughts were…. Why would any one put yet another service in the 23cm band. Is not your high power microwave oven in the kitchen, 2.4 Ghz. high power transmitters in the Amateur Radio Service and wireless routers and modems enough! Oh, cordless phones too!

Then the thread moves onto PID loops, accelerometers, inclinometers… ohhh, more interesting stuff!

But after 166 posts….. Alband, I was really barricking for ya mate, hoping that you’d of nutted this problem out.

I’ll be watching this post for a conclusion to the tank turret problem. ;)
 
Last edited:

Wrenow

Senior Member
I mean so that I can change both crystals to get a matching pair that aren't in air frequency.
Within the same band, perhaps (without the radio being retuned, you can introduce unwanted harmonics which can interfere with others. Within a close band, like 35-40 or 72-75 a qualified "maybe," but even more likely to be dangerous. Usig a 35 MHz radio with 75MHZ crystals - really unlikely. Plus, is 72/75 MHz (US frequencies for R/C) legal in UK> I had understood not.

This is really a question for local R/C buffs as to what might or might not work in your area with your particular radio. There are other issyes you need to know about (single or double conversion, etc.). That said, Micron has several possibilities, though I doubt they are the only local option.


Sorry, don't follow. "visually on the fly".
D'you just mean manually.
Kind of. They visually look at the turrets and aim them by shifting them clockwise or counter-clockwise with a geared motor hooked to an ESC (since you are rotating your turret 360+ degrees, I am suspecting you are using a hacked servo, basically the same thing - no absolute/proportional positioning). The trick is in getting the cannon elevation geared down enough as to make the elevation slow enough to handle with on-off.

Cheers,

Wreno
 
Last edited:

Wrenow

Senior Member
read ADC???

Then BB quotes the use of 2.4Ghz for RC use in the UK. My thoughts were…. Why would any one put yet another service in the 23cm band. Is not your high power microwave oven in the kitchen, 2.4 Ghz. high power transmitters in the Amateur Radio Service and wireless routers and modems enough! Oh, cordless phones too!
When it comes to R/C, safety and lack of interference are important as already thoroughly discussed. No only for your equipment, which may represent thousands of hours and tens of thousands of dollars, but also for innocent bystanders (who can be injured by a plane "shot down" by someone playing around with an air frequency TX over a mile away.

As for the 2.4G radios - they are getting quite popular in the US - glitch free, no worrying about channel crystals, rock solid performance. There was a lot of speculation about interference from wireles networks, microwave ovens, cell phones, etc. when they first came out, and the skeptic guys in the field performed some pretty amazing tests. Bottom line, I own both Futaba and Spektrum systems, and my son, the real guru, has moved to almost exclusively using Spektrum for his planes, helicopters, and delicate indoor flyers. They are also getting a following in OZ among the Warship Combat crowd (don't know about the flyboys). The one problem - you cannot run multiple RX's off of a single TX like you can in the old regular RC band stuff.

By the way, there is some new 900MHz Spread Spectrum stuff that looks interesting under development in Canada that I am following.

Cheers,

Wreno
 
Last edited:

BeanieBots

Moderator
I'd just like to add a little more about 2.4Ghz for RC.
First off, it's a digital system and hence far less prone to interference because it includes error correction. It also has the ability to channel hop so will switch to another (free) channel if the one it's using becomes occupied.

The feature which makes it really stand out for RC air use is response time. The 'traditional' transmissions are real-time serial. This results in a delay between stick movement and servo movement. The 2.4Ghz system sends the data at a much higher rate with all servo channels at the Rx changing simultaneously. This results in a much more responsive flight.

Also, you can use the same Tx for ground and air.
The 70Mhz bands are not legal for RC use in the UK.
 

alband

Senior Member
"READ adc" how did I not get that?
Andrew: how does it work using read adc. It's datasheet says it's I2C interface.

Thanks for the kind words Ham. Don't think I could get through that many post in an hour, even if I did write most of them.

Look's like I'm going to need to buy a new, well everything - hurumph :(.
So basically, I need to go for 27Mhz?
Could I get someone to retune my Tx for less that a new on costs?

Anyone got any advice for a cheap 5 channel Rx/Tx pair. e.g. what they would look for.
 

Andrew Cowan

Senior Member
Sorry - I was talking about another freescale accelerometer I built a board for - the MMA7260. That accelermometer is really easy to interface, and easier to solder. I tend to use to use this one whenever I need an accelerometer.

The LGA14 one does use I2C - it is a bit more complex.

A
 

alband

Senior Member
Where did you get the MMA7260. I need to be able to have it smaller than 13mm x 20mm.
If it isn't did you get the more complex one working?
 

boriz

Senior Member
Using an accelerometer to determine angle-of-elevation is going to be problematic on a moving platform. A gyro would be far easier. There will be drift over time, but it can be re-calibrated on the fly manually. IE: Manually set the cannon level to the ground and press ‘set’.
 

alband

Senior Member
I don't think it would fit. I have 13x20x1mm space to fit it in. I'm hoping to get on from Rick for turret rotation and if I can fit that circuit board in I'll buy a second, but I really doubt it'll fit.
 

Andrew Cowan

Senior Member
You can get a sample of the MMA7260 from freescale. It is very small.

However, as boriz points out, if the platform moves, then it will be hard to measure the engle.

A
 

alband

Senior Member
Before I create an account etc. with Freescale, which part number did you get from them; there are a few. Did it come with a circuit board or did you have to make one?
 

Wrenow

Senior Member
Look's like I'm going to need to buy a new, well everything - hurumph :(.
So basically, I need to go for 27Mhz?
Could I get someone to retune my Tx for less that a new on costs?

Anyone got any advice for a cheap 5 channel Rx/Tx pair. e.g. what they would look for.
Doubt you could easily retune a 35MHz to 27MHz. Probably really easy to retune it to 40, as many manufacturers produce them to work on either air or ground band with minimal adjustment in the 35-40 or 72-75 groups. Many manufacturers will let you send them in to their service center for conversion from air to ground or ground to air for free or nominal cost (plus cost of shipping). That is how our Warship Combat guys get their Air Frequency umpteen channel stick radios on ground frequencies (when the manufacturer does not normally sell them on ground frequencies). Again, these are RC questions that are better answered by your local RC groups - there may be tons of inexpensive solutions locally. Or, someone bay have a used one laying about. For what it is worth, Polk Hobbies used to carry a nice 8 channel synthesized (no crystals needed, programmable to any frequency channel) TX in european frequencies for about USD$200.

Haven't seen a lot of 27MHz stuff in the 5-6 channel (or more) variety. Most is low-end, limited range, 2-4 channel stuff.

Cheers,

Wreno
 

Wrenow

Senior Member
Is 40Mhz legal in the UK as ground frequency?
Not being UK myself, not sure - though that is how ground units are advertised there. However, your local RC guys would know. Even your local RC hobby shop.
Have you tried looking at http://www.sussex-model-centre.co.uk/
http://www.rchobby.co.uk/
http://www.hobbystores.co.uk/
or one of the dozen or so others that pop up in Googleing? Surely you are dealing with a local hobby store in getting the bits for your project? They should be able to steer you ro your nearest robotics group, one would think.

Since you are looking for more channels than the standard car drivers (2-3), if I were you, I would seek out the local Robotics Combat guys - particularly the Antweight or Fleaweight - tons of small stuff available in that arena. I know the US sources, like RobotMarketplace, but not the UK or other European sources.

Cheers,

Wreno
 

alband

Senior Member
Problem is I can't talk to my local till Monday + they were the ones who said "Oh go on, it'll be fine using 35Mhz".
 

eclectic

Moderator
I don't think it would fit. I have 13x20x1mm space to fit it in. I'm hoping to get on from Rick for turret rotation and if I can fit that circuit board in I'll buy a second, but I really doubt it'll fit.
I own these two.

http://www.dimensionengineering.com/datasheets/DE-ACCM2G.pdf

http://www.dimensionengineering.com/datasheets/DE-ACCM3D.pdf

Bought direct from USA, but, there's a GB supplier:
http://www.active-robots.com/products/sensors/sensors-accelerometer.shtml

However, the thickness, not including legs = c. 3.25 mm.

I've also had a quick look at the MMA7260 datasheet.
Chip alone is > 1mm thick, before any board.

Tardis time?

e
 

BeanieBots

Moderator
Problem is I can't talk to my local till Monday + they were the ones who said "Oh go on, it'll be fine using 35Mhz".
Please report them Alband.

About three years ago, a shop sold 35Mhz equipment to a guy who siad he wanted to make a "bait boat" for fishing. The guy was caught and the shop (because they knew the purpose at point of sale) was CLOSED DOWN by the authorities. They confiscated ALL his stock. It made the papers, I'll try to find the clip.
 

alband

Senior Member
Afraid not, the axis is the wrong way.

It only has to 1mm in certain places, can stretch to about 2mm max at on end.
 

eclectic

Moderator
Afraid not, the axis is the wrong way.

It only has to 1mm in certain places, can stretch to about 2mm max at on end.
Was the above an answer to post 181?

If so,

1. Which axis is the wrong way?

an irrelevant question, in these circumstances, because

2. How will you be able to fit any chip and board into that space.

Answers on a thin postcard please.
 

alband

Senior Member
Don't think you can do it all on one pin.
Rather than second guess your hardware, here's how it works.

Rx sends out servo position demand. That goes to the gyro. Gyro sends out "corrected" position demand. That goes to the sero. (or ESC in your case).
It is a 'continuous' signal just like any other servo signal. However, the amount of 'correction' varies as the turret moves. If you tried a system like the one using serial data discussed earlier, I think you would have problems with timing.

The tank turn a little bit. The gyro detects it and "corrects' the servo pulses. A little bit later, the "communication" method sends the corrected servo command. Meanwhile, the gyro has not seen an immediate position correction so it adjusts further. By now, the turret has moved to the correct position. then the over-corrected pulses start to arrive. I'm sure you get the picture.

As mentioned earlier, the gyro to servo pulse algorythm is a finely tuned PID loop. By adding a 'comms' delay you may well upset the terms enough to cause oscillation. Turning down the gyro gain will help to prevent that, but if too low, the respsonse will be very 'sloppy'. It would be quicker and easier to try it than it would be to calculate with any level of certainty.
Aww.:(
Are you sure?
There would be quite a lot of data:
Going up: Rx pulse up into turret for gun elevation (this then gets corrected in the turret), laser state, turret rotation state.
Back down: gyro's correction of turret rotation.
There needs to be a 20ms gap between most of these. All but one are servo signals, the exception being the laser which could possibly be integrated into the other signals.
Can anyone think of a way of doing this on 4 pins or even better 3.
Also, does anyone know of a female 3.5mm 4 pole connector that is only as long as the plug (e.g.), that is in the UK for a decent price.
(would get the one in link but P&P cost £12 standard.)
 

BeanieBots

Moderator
To be more precise,
Yes, you could do it ALL on one pin.
Let's face it, your Tx does it all down one aerial.
What I'll almost gaurantee what you can't do, is send all that data using the method you are insisting on using. Namely, serial that is NOT synchronised with the frame rate. Even at the correct frame rate, I think there is still a large potential for the loop delay to cause control problems. You would need to have a slow turret & gun elevation with a low gyro gain to avoid overshoot/oscillation.

This is all theory and there are too many details missing to know for sure. All I can say for sure is that even a slow servo on a heli can result in oscillation and require turning down the gain resulting in 'sloppy' control.
 

alband

Senior Member
4MHz = 4000 cycles per second
= 1 cycle per 1/4000 second
= 1 cycle every 4ms
4 sections of data need sending and receiving in < 20ms
1 section of data needs sending and receiving in < 5ms

- SEROUT pin,N1200,(0)

Measure the time the line is high; that should be 9 bit times. At 1200 baud, a bit time is 833.33uS, x 9 = 7500uS, 7.5mS.
Serin/out commands take 7.5ms. What if the chips were overclocked to 8MHz? They would then only take 3.75ms.

Also, the Rx isn't sending everything at once is it? It sends signals channel by channel? If it does, couldn't a PICAXE control a load of FET's to let pulses trough the serial line and into the correct servo/ESC/Gyro?

What do you mean my syncronised with a frame rate? Do you mean serial communication with one serial line and one clock line e.g. Ic2?
 
Last edited:

BCJKiwi

Senior Member
Ahem;
slight problem with the math!
Mega = 1 million
milli = 1/1000

4MHz = 4,000,000 cycles per second
= 1 cycle per 1/4,000,000 second
= 4,000 cycles per 1ms
 

BeanieBots

Moderator
By synchronised, I meant as described way, way back.
The serial is sent between every frame. The frame is determined by the Rx pulses.
 

alband

Senior Member
Answered my own question. You mean somthing like this?

Code:
main:
pulsin 1,b0' turret rotation from Rx
pulsout 1,b0' send to turret chip then to gyro
pulsin 2,b1' Gun elevation from Rx
pulsout 2,b1' send to turret chip then to 2nd gyro then servo
pulsin 3,b2' laser from Rx
pulsout 1,b2' send to turret chipwhich converst to a high or low.
pulsin 4,b0' Corrected turret rotation from gyro in turret
pulsout 2,b0' to the ESC for the turret rotation
goto main
At 4Mhz that all should take less that 20ms. It might need reordering to suit the Rx pulses.
 

Wrenow

Senior Member
Answered my own question. You mean somthing like this?

Code:
main:
pulsin 1,b0' turret rotation from Rx
pulsout 1,b0' send to turret chip then to gyro
pulsin 2,b1' Gun elevation from Rx
pulsout 2,b1' send to turret chip then to 2nd gyro then servo
pulsin 3,b2' laser from Rx
pulsout 1,b2' send to turret chipwhich converst to a high or low.
pulsin 4,b0' Corrected turret rotation from gyro in turret
pulsout 2,b0' to the ESC for the turret rotation
goto main
At 4Mhz that all should take less that 20ms. It might need reordering to suit the Rx pulses.
Leaving aside the Gyro considerations, due to the tight timings beween pulses, I would personally group all the pulsins together. Then, to multiplex the laser on/off, you could do something like:
Code:
main:
pulsin 1,b0' turret rotation from Rx
pulsin 2,b1' Gun elevation from Rx
pulsin 3,b2' laser from Rx - assume > 150= "on"
  If b2 > 150 'test to see if you want the laser turned on
   then pulsout 2, b1+200 'add an offset if laser on
   else pulsout 2, b1 'pass elevation without offset if laser off
  endif
pulsout 1,b0' send to turret chip then to gyro
pulsout 1,b2' send to turret chip which converst to a high or low.
pulsin 4,b0' Corrected turret rotation from gyro in turret
pulsout 2,b0' to the ESC for the turret rotation
goto main
then, demultiplex it on the turret chip, thus saving a hard line.

with something like
pulsin 2,b2' multiplexed elevation/laser signal
If b2 < 250 'test to see if you want the laser turned on
then pulsout 1, b2: low 4 ' elevation signal passed, laser off
else
high 4 ' turn laser on
b2=b2-200 ' remove the offset, demultiplexing the elevation signal
pulsout 1, b2 'pass demultiplexed elevation signal
endif

Again, as to the gyros, no real hands-on experience, so I will leave that to others. A question, though. While a stabilized gun or turret is "cool", what tank are you modeling? Did it have those features in 1:1?

Also, on your connecton, it seems you could use some vertical relief. Have you considered going to concentric rings with redundant offset brushes? Think an archery target. Not too difficult to gobble out of K&S brass tubing and plastruct, methinks.

Cheers,

Wreno
 

alband

Senior Member
M1A2 Abrams so definitely realistic.
Do you mean for the slip-ring. I've tried it with PCB. I just made some concentric rings but there was no way to get connections to the middle tracks through the board.
The headphone connector is just much more reliable and sturdy.
 
Last edited:

alband

Senior Member
Thanks, but it is too big. I also think I'm going to use an accelerometer as a plan B since it would also record froward and back movement.
When Rick Harris gets back in touch and I've got the gyro, I'm going to see if it's circuit would fit as a gun elevation sensor. If not, then it'll have to be accelerometer or nothing.
 

Wrenow

Senior Member
M1A2 Abrams so definitely realistic.
Do you mean for the slip-ring. I've tried it with PCB. I just made some concentric rings but there was no way to get connections to the middle tracks through the board.
The headphone connector is just much more reliable and sturdy.

Actually, I was talking about using nested brass tubing alternating with plastic tubing. Solder to the top of the tubing. You can also inset the brass from the plastic tubing to allow a track for the brushes. Or, if you wanted to do a printed circuit board, through-holes are what you use to get the trace to the other side to attach wires to all (including inner) track By multiplexing, of course, you save the necessity for one track (or one collar on your pin). Leaving aside the gyros, you should be able to do what you originally asked on your original 3 channel pin setup.

Might be good to go there first, then tweak with gyros later (the elevation gyro can be added in the turret easily enough without further adjustment).

Cheers,

Wreno
 

alband

Senior Member
I see; nice. That gets round the connection to the track and separation of the track issues I had before. It would be hard to get metal tubing that is thick enough for a wire to run on its end at a small enough diameter, even with guide plastic pieces. Does sound very good apart from that though, so I get some stuff this weekend if I can.

Hope he doesn't mind me asking; but does anyone know where Rick has gone? :confused:
 
Top