sinara-hw / Booster

Modular 8-channel RF power amplifier
Other
16 stars 3 forks source link

Booster: firmware review #8

Closed hartytp closed 6 years ago

hartytp commented 6 years ago

What's the current status of the firmware that's loaded onto Booster at the moment? Should the instructions on the Wiki all work at the moment?

To check I understand things:

Also, I need a way of finding the MAC address of booster (our department does MAC address whitelisting). How can I do that? Can I do that via the UART (e.g. by sending it a request, or if it prints out a boot message)?

hartytp commented 6 years ago

Can you remind me how the interlock works at the moment, please (maybe add a note to the wiki)? IIRC, we agreed that:

  1. There is a hardware interlock that trips if the FET temperature gets too high
  2. there is a hardware interlock that trips if the input, output forwards, or output reverse power is too high
  3. there is an interlock that trips if the FET current/voltage is too high

Is that correct?

IIRC, we agreed that the set-point for (2) would be adjustable from firmware (e.g. to prevent damage to a sensitive load such as an optical modulator). Has this been implemented? If so, what is the command to change the set-point?

hartytp commented 6 years ago

Will all settings be saved to non-volatile memory? If not, can we have an option to save all settings, please?

My concern here is that if I have a sensitive load like an AOM, I may want to use the interlock to ensure that the amplifier can never drive too much power into the load and damage it. If the interlock settings are stored in volatile memory then it would be easy for a short power glitch to clear them without the user realising. This is prevented by having a means of saving them to non-volatile memory.

hartytp commented 6 years ago

One final request ;)

I'm planning to make some measurements on P1dB and third-order intercept on Thursday or Friday, and would be interested to play around with this then while I have the equipment set up if that's possible?

hartytp commented 6 years ago

@gkasprow I'd like to test the FW/interlock later this week. Can you give me any feedback on the questions above?

Thanks!

gkasprow commented 6 years ago

@wizath please respond to @hartytp AFAIK at the moment the processor does not measure the current nor compensate the voltage because according to Maciej this is not necessary. There is only over-current protection implemented for every RF module supply rail.

hartytp commented 6 years ago

AFAIK at the moment the processor does not measure the current nor compensate the voltage because according to Maciej this is not necessary. There is only over-current protection implemented for every RF module supply rail.

Thanks for clarifying.

If possible, I'd definitely like a way of adjusting the bias current to play around with getting higher power efficiency at lower P1dB.

gkasprow commented 6 years ago

It is possible, but can also kill the output MOSFET :)

hartytp commented 6 years ago

You mean if the bias current is set too high? Can we make sure that the FW only allows the users to program it to values within a safe range?

hartytp commented 6 years ago

Anyway, I'm okay if this particular function is a "use at your own risk" one (MOSFETS are cheap anyway).

gkasprow commented 6 years ago

Yes, but the FW would have to monitor the supply current to be 100% sure

hartytp commented 6 years ago

@gkasprow Okay, well playing around with biasing is the lowest item on my to do list. If you can sort the other things out then I'll be happy.

In the long-term, adjusting the biasing is something I'm keen on to improve the power efficiency for lower output powers (0.5W-2W), so I'd like to find some way to do this in the FW. But, we can do that later on.

hartytp commented 6 years ago

ping @wizath I'm ready to play with the firmware/interlock whenever you can give me some feedback on the above questions. Thanks!

wizath commented 6 years ago

ENABLE/DISABEL controls the biasing for the power FET. The pre-amp circuitry remains powered all the time START/STOP control the input switch (ANDed with the INTERLOCK status)

In current version there is single button to power the channel LDO's, amp will start running after enabling power, because of (past) issue of protection circuit.

The current and voltage measurement are measuring the bias voltage and current for the power FET (why are there two per channel?) ADC on each channel gather information about: 30V current, negative voltage current and 5V current.

What are the commands to measure the power (input, output forwards and output reverse) power for each channel?

Measurement are displayed on VUART interface in 1s intervals. Optionally you can use SCIPI commands listed in Booster's wiki page.

Also, I need a way of finding the MAC address of booster (our department does MAC address whitelisting). How can I do that? Can I do that via the UART (e.g. by sending it a request, or if it prints out a boot message)?

You can type ifconfig to check MAC address

IIRC, we agreed that the set-point for (2) would be adjustable from firmware (e.g. to prevent damage to a sensitive load such as an optical modulator). Has this been implemented? If so, what is the command to change the set-point?

At this time, value is fixed within software, we could add single command to change DAC voltage for specified channel.

Will all settings be saved to non-volatile memory? If not, can we have an option to save all settings, please?

This hardware revision is not equipped with any kind of EEPROM memory, but AFAIK @gkasprow added the storage for next rev.

hartytp commented 6 years ago

@wizath Thanks for the feedback. Following up from your answer:

  1. Is the list of commands on the Wiki up to date? Are all commands listed there currently implemented in the firmware, and are all commands in the firmware listed there?
  2. Please can you add a *IDN? type command that prints a device identification string, complete with HW and FW revisions?
  3. Is the input protection circuit implemented in the current firmware? If not, please can I have a version of the firmware with it implemented (the hardware issue is now fixed on my boards)?
  4. Please can you clarify exactly what interlock is implemented in both HW and FW. (input power? reverse output power? output power? amplifier temperature? etc)
  5. what does CHANnel:ENABle do? Does this turn on the LDOs + FET biasing?
  6. what does CHANnel: START do? Does this clear the interlock?
  7. what does CHANnel:MEASure:VOLTage? do? (The description on the wiki at the moment is confusing)
  8. what does CHANnel:MEASure:CURRent? do? (The description on the wiki at the moment is confusing)
  9. What exactly do the two buttons on the front panel do at the moment?
  10. In the next firmware version (when will this be ready?), please could you add a command to set the FET bias voltage. Please add some basic checking to this command to ensure the the FET voltage can only be set within a sensible range that is unlikely to cause damage.
hartytp commented 6 years ago
  1. How do I program/query the various interlock thresholds? e.g. how can I set what maximum output power the device can produce?

I want to test the interlock next, but need answers to (3) (4) and (11) before I can do that.

wizath commented 6 years ago

Is the list of commands on the Wiki up to date? Are all commands listed there currently implemented in the firmware, and are all commands in the firmware listed there?

Yes, they are up-to-date

Please can you add a *IDN? type command that prints a device identification string, complete with HW and FW revisions?

If I recall correctly it's implemented

Is the input protection circuit implemented in the current firmware? If not, please can I have a version of the firmware with it implemented (the hardware issue is now fixed on my boards)? Please can you clarify exactly what interlock is implemented in both HW and FW. (input power? reverse output power? output power? amplifier temperature? etc)

At this moment the ONOFF is shorted to 3.3V so any protection won't work. There is one hardware protection circuit (DAC) and I can implement a SW one, but need to know the voltage thresholds to disable the AMP.

what does CHANnel:ENABle do? Does this turn on the LDOs + FET biasing?

Enables power for selected channel

what does CHANnel: START do? Does this clear the interlock?

Enables ONOFF signal for selected chanel

what does CHANnel:MEASure:VOLTage? do? (The description on the wiki at the moment is confusing) Dumps the channel voltage measurements from forward and reverse power measurements

what does CHANnel:MEASure:CURRent? do? (The description on the wiki at the moment is confusing)

Dumps the channel ADC values for current measurements. These commands were implemented at early stage and weren't really consulted with anyone.

What exactly do the two buttons on the front panel do at the moment?

The first one just enables the power and since ONOFF signal is shorted to VCC so it's starting automagically. The fix is in comment here https://github.com/sinara-hw/sinara/issues/460#issuecomment-383871185 When I will get back working module I'll change the behaviour (1st will enable all channels and 2nd clear errors?)

In the next firmware version (when will this be ready?), please could you add a command to set the FET bias voltage. Please add some basic checking to this command to ensure the the FET voltage can only be set within a sensible range that is unlikely to cause damage.

I want to fix this fan ghosting and several other small issues, I think that will go around next week. Also, could you specify what commands would you like to get from this SCIPI interface and I'll prepare them for you.

hartytp commented 6 years ago

@wizath Thank you for the response.

Before I reply to your questions, I'd like to confirm with @gkasprow how the interlock is supposed to work. @gkasprow is this correct:

Is that all correct? Are there any other interlocks that I've missed? Or, is that the complete list?

I know we've talked about this a few times before, but I wasn't sure if we reached a conclusion. Let's finalise this once and for all and I will write it up on the Wiki.

hartytp commented 6 years ago

@gkasprow I know this is discussed in https://github.com/sinara-hw/sinara/issues/460#issuecomment-387895107, but I would really appreciate it if you could have a look at my post above and give me feedback. Is what I said there correct? Is there anything I'm missing?

hartytp commented 6 years ago

@gkasprow What I want to get clear on first is what our long term plans are here (i.e. not necessarily what has been implemented in the current firmware/hardware).

Also, what is our plan for the bias current/voltage? Will we use feedback to control the current? Or, just run this open loop?

hartytp commented 6 years ago

ping @gkasprow

hartytp commented 6 years ago

ping @gkasprow Please can you confirm what the interlock/biasing plans are? Once you do that, we can finalize a specification for what the firmware must do, and @wizath can start work on the next version.

I'm keen to get this done asap, because I can't test the interlock until it's done.

hartytp commented 6 years ago

@gkasprow ping!

Please can you confirm how the interlock and biasing are supposed to work so that we can finalise the plans for booster. I'd really like to agree on the specification for the firmware before I leave on Wednesday morning.

gkasprow commented 6 years ago

There are following interlocks:

gkasprow commented 6 years ago

So maybe such bias stabilisation should be made on request ?

hartytp commented 6 years ago

Thanks @gkasprow!

each module has a DAC that sets a thresholds for input power and reflected output power.

Is that correct? Looking at the schematics, it seems the it is the input and output forward power that are interlocked in hw. The ret detector Q/Q_n outputs are nc atm.

hartytp commented 6 years ago

each current that supplies each module module is monitored by fast ADC that has digital thresholds and can generate alert when current is exceeded. This happens without software intervention. Each output is routed to the CPU. At the moment we did not implement firmware to react on such event.

This seems worth implementing, doesn't it? Shouldn't the behaviour be to shut the RF switch and disable the regulators for the channel in case of an over current situation?

hartytp commented 6 years ago

There are temperature sensors placed inside of the PA module. They are read by the firmware.

Should we place a software protection here that disables any channel whose temperature exceeds the safe maximum?

hartytp commented 6 years ago

There is possibility of implementing bias current stabilisation, but this needs some kind of PID regulator. The CPU has all information needed. User should not be surprising by changing bias current in random way during experiment. One can discover new physics in this way :)

:) indeed

This is my fear with this kind of feedback loop. Passive stability is obviously better. The question is just how good the passive stability is, and whether active stabilisation of the bias current is necessary. Looking at the bias voltage/current plot for the FET we're using, it seems that it is quite sensitive. So, my concern is that we may see large power changes at the amplifier gets hot.

If the DAC that controls the bias current has a decent resolution and proper filtering on its outputs, I wouldn't expect it to add significant noise to the RF output.

hartytp commented 6 years ago

each module has a DAC that sets a thresholds for input power and reflected output power.

By the way, if you don't think we need reverse power interlock then it's okay with me to leave it out. So long as the amplifier can handle full reverse power, I think the current situation is okay. I just want to make sure that I understand the design decisions.

gkasprow commented 6 years ago

Look here https://github.com/sinara-hw/Booster/releases/download/v1.1_rc1/PA_8CH_CTRL.PDF The IC5 is the DAC that sets the threshold value for the detectors that are sensing input and reflected power on the bottom board.

hartytp commented 6 years ago

@gkasprow I think there are two questions here:

  1. What is implemented in the current hw?
hartytp commented 6 years ago
  1. What should be implemented:
    • We have two goals here: protect the amplifier and protect the load
    • To protect the load, we only need to limit the output forwards power. In principle, this can be done by interlocking the input power. In practice, it seems much better to limit the output forwards power. This way, variations in the circuit gain (for example over frequency, between channels or due to amplifier saturation) don't need to be calibrated out to provide an accurate limit on the output power, which is needed to protect delicate instruments.
    • To protect the amplifier itself, we need to limit the input power. Again, this could be done by limiting the output power only, but it seems to be safer to limit the input as well (although, if you're happy not having a hardware interlock on the input then that's fine by me).
    • To protect the amplifier itself, we may also need to limit the output reverse power. This just depends on whether the amplifier can handle full reverse power without damage/instability. If the amplifier can handle full reverse power then we do not need a reverse power interlock. I leave this decision up to you (but please let me know your decision).
hartytp commented 6 years ago

So, assuming that the amplifier can handle full reverse power, it seems that the current PA schematic -- which has input and output forwards power interlocks -- is the correct way to do it. But, please let me know what you think of my comments above.

gkasprow commented 6 years ago

I'm a bit surprised that the module has only the FWD power monitoring realised in HW. I will clarify it with Maciej. I've just looked at the Tomasz design and it is done in the same way. The original idea was to have this protection realised in the firmware so we will probably have to do it now. Since it is constant threshold protection and we care mainly about thermal effects of handling full reflected power by the output amplifier, implementation in firmware will be easy. Delay of a few tens of ms won't kill the output stage.

hartytp commented 6 years ago

I'm a bit surprised that the module has only the FWD power monitoring realised in HW. I will clarify it with Maciej.

As I said above, I think that hardware interlocks on the input and output forwards power are more important than the output reverse power, so I'm happy with the current situation so long as you and Maciej are -- although, please make sure that the labelling on the various PCBs is consistent.

Since it is constant threshold protection and we care mainly about thermal effects of handling full reflected power by the output amplifier, implementation in firmware will be easy

Is it thermal protection or over voltage protection? I know that in some cases, reverse power can kill amps very quickly by creating large voltages at the FET output. In this case, the protection needs to trigger quickly. Anyway, not sure what the damage mechanism is in this amplifier, and I'm happy to do what you and Maciej think is best.

The original idea was to have this protection realised in the firmware so we will probably have to do it now.

Sounds good. However, don't bother implementing this unless you think it's necessary. e.g. if the damage mechanism is thermal, will the thermal overload protection you've implemented be enough? Also, if the amplifier can take full reverse power anyway, we don't need an interlock on this, since it's safe by design!

hartytp commented 6 years ago

Given the above discussion, here is my summary/proposal for the interlock and firmware interface. Anyone involved/interested in this project (particularly Greg/Maciej/Tomek) should feel free to comment.

Interlocks

If any of these interlocks trip, the input switch is shut off (input disconnected) and the power FET bias current/voltage is shut off.

Firmware commands to follow...

hartytp commented 6 years ago

Firmware commands

@wizath @gkasprow Please feel free to make suggestions for how this should be changed. Also, please feel free to change my notation if I haven't used standard SCPI notation, or to suggest better ways of doing any of this!

Please make sure to document things like the safe range for the bias voltage etc.

Edit/later additions to the above:

hartytp commented 6 years ago

Front panel buttons

hartytp commented 6 years ago

@gkasprow @wizath and others, please offer feedback on this. Once we finalise this all, I'll post it to the Wiki. Thanks!

gkasprow commented 6 years ago

I talked with Tomasz and he says that the hardware interlock was on the reflected power! He simply swapped outputs on his coupler and did not modify schematics because he does not know how to use Altium. And Maciej simply duplicated the error. So we have to switch the coupler outputs in next revision. We can also swap them in current revision.

hartytp commented 6 years ago

He simply swapped outputs on his coupler and did not modify schematics because he does not know how to use Altium. And Maciej simply duplicated the error.

:(

So we have to switch the coupler outputs in next revision. We can also swap them in current revision.

You mean switching them so that the hardware interlock applies to the forward power, and not to the reverse power?

Yes, please can you do that: switch the coupler outputs in both the current prototypes (so that we can test them) and in the next revision so that the input power and output forwards power are hardware interlocked.

hartytp commented 6 years ago

Other than that, do you agree with everything I posted above?

dnadlinger commented 6 years ago

(@hartytp: This explains my confusion, resp. the reason I asked you about the hardware interlocks a couple of weeks back. Agreed that input/output forward power hardware interlocks are the way to go, together with whatever we need to do on the reverse power to tolerate infinite opens/shorts on the outputs.)

gkasprow commented 6 years ago

A the moment we have HW interlocks on the input power and the output power. Original intention was to make it on the reflected power. So we leave it as it is?

hartytp commented 6 years ago

In that case, yes, please leave it as it is.

Please can you double check that you are happy the descriptions I posted above for the interlock/firmware/button functions. And double check that things are implemented that way in the HW/FW.

Also, before we finalise the next revision, please make sure that all schematics are updated and consistent.

Thanks!

hartytp commented 6 years ago

@gkasprow are there any other things we should be able to query from the firmware for diagnostic purposes? All ADCs that we have in the hardware should be readable via the ethernet interface for debugging.

gkasprow commented 6 years ago

@hartytp this looks like a complete list. At the moment we don't have non volatile memory on the main board - only small ID chips on the modules.

hartytp commented 6 years ago

@gkasprow thanks for confirming. I'll copy that to the Wiki at some point in the next few days when I have time.

When will @wizath have time to implement that? I'd ideally like someone to test out Booster with the complete firmware before we order the next hardware revision.

At the moment we don't have non volatile memory on the main board - only small ID chips on the modules.

I think that non-volatile storage of the interlock settings is essential. Otherwise, they can't be relied on to protect sensitive loads. So, we have two options:

  1. If the EEPROM you will use in the next version comes in a sensible package (eg SOIC) then can we kludge one onto the current hardware and dead bug it?
  2. If we can't dead bug it then we can complete our testing without the memory chip and order the next hardware round. Once the next hardware round has been completed, we'll upgrade the control board in the unit we already have. Before this upgrade, we can't rely on the adjustable interlock thresholds.

Let me know which one you want to do.

gkasprow commented 6 years ago

Dead bug is OK, we have free CPU pins.

hartytp commented 6 years ago

Cool, let's do that.