Pages

Showing posts with label Forth. Show all posts
Showing posts with label Forth. Show all posts

Tuesday, 26 October 2021

GM300 - Replacement Brain ?

In my experience modifying ex-commercial radio gear  for ham use is a mixed bag:

  • The Tait 500 was poor when converted to 6m due to powerline interference when mobile
  • I have a brand new VHF Motorola GM328 tuned to 2m which appears to suffer interference from broadcast band FM (pcb inductors in a tuned circuit with varactor tuning means low Q so broadband front end with no selectivity).
  • Unilab's have been very good
  • The Philips PRM80 converted to 2m is perhaps the best mobile radio I have had with regard to coping with pagers. 

Mind you, the Icom and Yaseu mobile rigs I own have been sadly lacking.

So when I opened a Mororla GM300 I was pleasantly surprised to see a radio with shielding over every coil in the receiver front end and a diode mixer. This was a departure from the norm and worth investigation. 

Alas, trying to reprogram the radio for 70cm use was fruitless. After a couple of hours trying every serial interface I had and several versions of the Motorala software I had no success.

Which got me thinking. It's a fairly standard PLL circuit. So I pulled the entire synthesizer/receiver/exciter board from the radio. Powered from the bench using STM8 eForth and a $1 minimal development board I quickly had the PLL loaded up.

Only problem was the oscillators would not lock up oin the required frequencies. Padding with a few surface mount caps was partially successful. The tuning range is only just wide enough.

At this point I have a proof of concept. Driving the LED display on the head looks straightforward. But I am hampered by only having a partial circuit of the radio. If you can help me it would be appreciated. 

73's

Thursday, 28 January 2021

Testing Relay Life - With STM8eforth

 I use a lot of relays in various projects and always wondered what electrical life in the datasheets really meant. Given my skepticism about any claim by a Chines manufacturer I decided to see if life could really be tested. 

My method is to toggle a relay 1800 times per hour while passing a constant current of 2 amps. I measured the voltage drop across the contacts 16 times for each cycle and logged everything to a 32MB flash chip.

Amazes me what can be done with an STM8 and forth.

I intend to operate the relay to failure. That may be a week or so away. But so far, after almost 6000 cycles, the results are pleasing:

 

The Y axis is the raw ADC result, averaged for the 6 readings. Interesting to see periods with a significant degradation in contact resistance which manifests itself as an increase in the ADC reading. 

73's

Thursday, 15 March 2018

1296MHz or 23cm Beacon

A nearby Ham, and a good friend of mine, VK6KDX Jack is working on an EME station for 23cm. Locally our 23cm beacon has been off air for eons. For testing purposes Jack needed a distant signal source. Here then is the 23cm beacon, measuring 10cm x 5cm, under construction:



The beacon is now complete and tested. The ident is in CW every 60 seconds. The PLL chip is loaded at start-up by a STM8S1003F, or STM8S003F, micro running the fantastic STM8 forth with more details here. This micro also gates the amplifier chain to produce the morse ident.

I used parts I had in the junk box. The PLL was recovered from some TV modulator boards I have. The varicap came from another TV demodulator board that I had. The mmics were all recovered too. Except for the final mmic. I had planned to use the AH1 mmic shown in hte phot above which is a 100mW output device. However, both my recovered mmics were broken. So I used an AH101G instead which is a 500mW device. The standing current of 200mA from an 8V supply means 1.6watts is being dissipated which my board wasn't designed for (the AH1 is only 0.75W ). To solve this I used some copper tape to better connect thermally the two sides of the board and create a small fin. I also attached a heatsink to the opposite side of the board. So far, so good. The device hits 75 degrees Celsius and should survive the abuse it will receive.

I'll just have to buy some AH1's and either retrofit one, or build another beacon up. I have a lot of boards left over. Please contact me if you want one. I can furnish a partially populated and programmed board for you.

The code can be found here.

Regards
Richard VK6TT

Thursday, 5 October 2017

Lead Acid Batteries - Measurement of Internal Resistance - Results

It's been about 4 weeks now and some observations of the impact pulse conditioning has had on internal resistance and perhaps battery capacity are warranted. More importantly, the need for a more rigorous approach has become apparent.

Over that last 4 weeks the measured internal resistance has fallen from 264 milli-ohms to 175 milli-ohms. While the reduction in the internal resistance tapered off after about 10 days, there is some support for the battery's capacity having increased as well. At the start I was recharging the battery after 3 days on the pulse conditioner. Now it runs for 5 to 6 days before I have to recharge the battery.

So my initial observations are that the pulse conditioner is beneficial. However, there are several issues with the approach and the results cannot be construed as anything other than weak support for pulse conditioners.

The biggest drawback to the approach is the lack of a control battery. With a second battery I could cycle one on the pulse conditioner whilst the other was cycled on a static load. If the static load battery showed little, or no improvement, in internal resistance then there would be much stronger support for the pulse conditioning approach.

Another drawback stems from the lack of automation. I still have to manually changeover the battery at each step of the pulse, charge, measure cycle. So the time between measurements is not constant and the level of charge and discharge varies from one cycle to the next. I clearly need to automate the cycle and let it run unattended.

The final obvious shortcoming is temperature. We are moving towards summer and the average ambient temperatures have increased over the last month. The temperature change could be influencing the results either directly via battery chemistry somehow, or indirectly by it's impact on the voltage regulator which serves at the voltage reference for the D2A conversion. A temperature controlled testing environment would be useful to remove another source of potential error but that is beyond my reach at present.

The biggest obstacle to the full automation with the W1209 board is the need for an additional two digital outputs. I have considered two approaches. The first is using the + and - keys as both inputs and outputs. That would require some careful soldering to insert a resistor, say 2k, in series with each switch. The second approach is a 4017 counter clocked by the pin driving the relay. Then each of the decoded outputs for 1-3 from the 4017 driving a relay to perform each step of the pulse charge measure cycle.

I'm leaning towards the first approach since I don't know if I have a 4017 in the drawer and the first approach avoids any ambiguity over which step the cycle is in.



Tuesday, 12 September 2017

Lead Acid Batteries - Measurement of Internal Resistance - V3 of Code

​After hours running various tests to determine when the voltage samples should be taken I concluded there was no right answer. Mind you, the sweet joy of using Forth to do this via the serial port was a reward in itself. ( Timing loops could be tested interactively, results displayed on the terminal window, etc etc. )

I settled on a longer delay before sampling the loaded voltage, or Vend in the code, then a short delay before sampling the unloaded voltage, or Vbeg in the  code. Because of the way the voltage depresses over time, then recovers, I doubt there is a right way to do this. But my training in Statistical Process Control and Gauge Capability steered me in this direction.

I now have a testing method that gives me repeatable readings provided each test is run hours apart. So while the calculated internal resistance might not be the value according to some standard it should allow me to discern if my pulse conditioning circuit has any impact over time on the internal resistance.

Over the next few weeks I'll run my trials and see what happens.

Monday, 11 September 2017

Lead acid batteries - Measurement of internal resistance - x4 resolution mod

The initial project used a voltage divider to reduce the measured voltage down to less than 5V. This means the voltage resolution is about 20mV which means the internal resistance measurement for 1 amp of current is 0.020 ohms.

Instead of dividing by 4 with a resistor string, what if we subtracted 10V from the voltage to be measured? This would give us a voltage resolution of about 5mV with an internal resistance measurement for 1 amp of current is 0.005 ohms. This seems like a worthwhile improvement and can be easily achieved.

I had never played with a voltage subtracter before but it proved to work first time. Reaching into the junk box I pulled out a NE5532 dual op amp. I had no reason to chose this device over any other except I had hundreds I had recovered from a couple of boards. A few resistors and it was done.

While I used a NE5532 and 2.4k resistors I don't think there is anything critical about this. Just about any op amp will probably work and the resistors could be anything between perhaps 1k and 100k. As long as they are all the same value.



As before I'll post the updated code over on Hackaday. While this is not yet the complete measurement tool I wanted it will allow me to make some measurements on the impact, if any, pulse conditioning has on internal resistance.

Sunday, 13 August 2017

Lead acid batteries - Measurement of internal resistance - Code

While working on a small hardware modification to improve the resolution of measurements it occurred to me that displaying an internal resistance of 0.2 ohms as 200 was easier to read than 2. I updated the code over on  Hackaday

Debugging a change like this is so easy with Forth, especially when a simple x100 instruction fails because the 16 bit integer maths overflows.

Regards
Richard

ps the hardware mod worked a treat giving a fourfold improvement in resolution. I'll describe it shortly once I've finished the soldering. It might even mean that no modifications to the board are required!

Saturday, 12 August 2017

Lead acid batteries - Measurement of internal resistance - Schematic

Once you have modified the W1209 board here is the schematic for the overall project as it stands today.


Regards
Richard VK6TT

Friday, 11 August 2017

Lead acid batteries - Measurement of internal resistance

Hams, listen up. With our short arm deep pockets mentality this is going to really appeal to you. This project takes a cheap assembly, $2 delivered, from China and turns it into a test fixture for measuring the internal resistance of small lead acid batteries.The project as it stands works very well. However, I've already thought of ways to improve it which I will incorporate in due course and report on.

There were two motivating reasons for this project. The first, and a long standing one, was to measure the internal resistance of lead acid batteries to see if some of the rejuvenate, repair or restore ideas I had come across had any objective merit. As a ham I have plenty of small lead acid batteries which I only require occasionally. I periodically float charge them and occasionally I have had to dispose of one via the recycling depot after cells have gone open or short circuit. Recently I began playing with a pulse conditioning circuit and initial measurements of internal resistance suggested there was some lowering of the internal resistance. But manually setting up a test jig and then remembering to take measurements has been a problem for someone so easily distracted.

So I was looking for a way to automate the entire measurement, conditioning and charging process to firmly establish if there was any benefit in pulse conditioning these batteries. Then I stumbled across the project at eForth for cheap STM8S gadgets • Hackaday.io which is one of the most exciting ideas I have seen in recent times. The thought of taking a $2 board, replacing the firmware, and doing something entirely different with it just thrills me. The more I use these gadgets the more ham applications I see.

This project uses the W1209 thermostat board, readily available for under $2. Delivered. Hams, listen up. What I did was make a few small modification to the board:
  1. remove the 20k smd resistor next to the sensor connector,
  2. throw the sensor in the junk box,
  3. add a 10k resistor across the sensor connector (underneath if a smd resistor or remove the connector if using a through hole resistor)
  4. add a 30k resistor (or two 15k resistors in series) from the upper terminal of the sensor connector to the +12v rail.
Then I built a 1A constant current load from a 5v regulator and two 10 ohm resistors. You probably have those in your junk box ready for a project like this.

At present my board works as follows:
  • after connection to the battery  I hit the "+" key to run the measurement routine. It takes about 1 second and in that time it reads the battery voltage 32 times, summing the result, activates the relay which increase the current drawn by 1 amp and takes a further 32 measurements of the battery voltage summing those results, releases the relay then saves these two sums into eeprom
  • I then hit the "set" key  and the display shows me the average of the open circuit voltage, the loaded battery voltage, and the calculated internal resistance.
  • If I hit the "-" key the run counter is reset to zero.
The current partially discharge battery I tested this project on had a beginning voltage of 12.8V, a loaded voltage of 12.5V, and an internal resistance of 0.2 ohms.  Why not 0.3 ohms? That's the result of scaled integer maths. The 0.2 ohms is the correct answer. e.g. 12.81 - 12.59 = 0.22. But the display only shows voltage truncated to 0.1v.


My longer term goal is a test fixture that repeats daily a charge of the battery, measure the internal resistance, then applies the pulse conditioning until it is time to start the cycle over again. Then once every 8 weeks I can either dump the data back to the PC by reading the eeprom, or read the data via the display for whatever run I chose.

Over a series of posts I will cover the initial Forth code and subsequent improvements, the circuit for the 1A constant current load, how everything is wired up and eventually the further modifications to improve the resolution.

In the meantime here is what you need to do. Firstly, read the hackaday link above for background information. I really like the programmable power supply. I can see several of those going onto my workbench in due course. The team behind this Forth project need a big thank you for doing such a great job.

If you decide to give Forth a try, and I strongly encourage you to do so,  your shopping list is:
  • a few of the W1209 modules, pictured below, 
  • the programming dongle,
  • and a serial interface (USB dongle or MAX232 based device) if you don't already have one.
You'll never touch arduino again and probably end up running amforth or something similar on those those arduino boards like I do.

I will post working copies of my firmware if you simply want to flash the board and not learn Forth. And if all you want is a pre-programmed modified board then you best contact me.