charlesbaynham / DigitalTemperatureController

Schematic, PCB and source code for a high-precision digital temperature controller
10 stars 5 forks source link

Error in commands #1

Closed QiushuoSun closed 2 years ago

QiushuoSun commented 3 years ago

Hi Charles,

I am a research fellow in Sr atoms group at the University of Birmingham. One of my colleagues recommended your design for temperature controllers for high finesse cavities. Thank you very much for providing this design and all the documents!

I have got some PCBs manufactured based on your design, and I have established the communication between the microcontroller and a computer. However, I am having issues with some commands.

The first issue is the Error in startup commands. This error shows up first every time the board is connected.

The second issue is the Error in some of the commands. I found the error only shows up for all the commands that the number of parameters is not 0.

I attached a picture here to give some examples, the first line shows the startup error. The second line is when I sent *TST and I got 'loud and clear' in return without an issue. The third line is when I sent 'LOCK' command but got an error.

temp

I don't have much experience in C++ or Arduino, if you could help with any ideas, that would be very helpful!

Also please can I ask should I use Labview files as a user interface, once I have got the C++ programme running?

Again, thank you very much for the design, and I appreciate any answers.

Best regards, Sarah

han94ros commented 2 years ago

Hi Charles

I am Sarah's colleague, and the issue was that in your VoltageLock C++ function you have defined the CtrlChannel as the first parameter followed by the ErrorChannel as the second. The order is reversed for the documentation of the LOCK arduino command in the manual. You can close this issue now.

charlesbaynham commented 2 years ago

Hello both,

Great to hear you're using the board! Thanks for finding this documentation error, I'll get that sorted out.

For future reference, the CommandHandlerReturn codes come from here:

https://github.com/charlesbaynham/DigitalTemperatureController/blob/82d15f1a2f9fbe171d7a6bbacd06541c10ce3214/Code_for_microcontroller/YbTempCtrl/CommandHandler/CommandHandler.h#L29-L43

So e.g. error 1 means "command not found" and error 2 means "wrong number of params".

For controlling the board you'll find a Labview interface here: https://github.com/charlesbaynham/DigitalTemperatureController/tree/master/Code%20for%20Labview. This includes a driver which implements most of the serial commands, as well as a basic GUI (which might be a bit buggy: sorry!). I'd probably recommend using either the labview driver VIs or implementing a simple one in python. Another package I've written might help with this: https://github.com/charlesbaynham/GenericSCPIDriver/.

Let me know if you have any other question! C