collapse

Author Topic: PLX-DAQ  (Read 881 times)

BaldwinK

  • Member
  • ****
  • B
  • Posts: 20
PLX-DAQ
« on: January 16, 2019, 06:44:18 AM »
Diagnostic help when coding is often achieved using the console print facility of the microprocessor. However, when there is a lot of data, the resulting torrent washing over the screen soon becomes meaningless.

A free download from Parallax Inc provides a link into Excel which shares the same USB port for the console. Either the IDE or PLX-DAQ can be connected, but not both together.

Why Use This?

My ongoing project to make a quadruped walk has nearly been abandoned more than once. Not being able to see exactly what is going on inside a complex distributed system makes progress very difficult.

So I took some time out to write routines to create better tools for the job in hand. This extra work has helped regain focus on the main issues. It shows what can be done, but it is surely well over the top for most needs.

sheet.jpg
*sheet.jpg (202.47 kB . 798x459 - viewed 147 times)

Each slave Nano holds information about the four motors under its control. The master runs a background task to enquire about one set at a time so as not to interfere with normal working. With a cycle time of 15mS this means all the display areas are updated every two seconds or so.

So facing the bot we see information for the Heel, Knee, Pitch and Roll/Rotate motors in each leg. On the screen left centre are the Input angles written into the slaves and at the top are the achieved Deg angles as measured by the servo pots. Excel is set to colour any differences of more than 2 degs.

Bottom left we see the Max permitted PWM values written into the slaves. Duty shows the PWM moving average values measured over one second. Motors are driven at twice the nominal voltage so these checks are important. Again Excel is set up here to colour any value over 80.

Entering 16 angles to test one posture can be time consuming. PLX-DAQ also allows for values to be taken from the spread sheet and sent on. The green boxes are for such use and can be used, or not, with switches in the master software. Best to disconnect whilst making changes to a number of fields.

To the right we have more green boxes for Calibrating the total build of the bot. This allows the position of each motor spline to be aligned with the limb as required. Ref shows the slave register value which will eventually be transferred to the slave default startup code.

Top right are values for IK experiments. Each slave can calculate the angles (Input) given IKx and IKy in mm. Ikw controls the Roll/Rotate motors.

Lastly there are two spare blocks of display; best to code these up front as adding sections later is a pain. Each foot switch FSw shows ground contact and is useful in determining terrain and construction inaccuracies.

The master Nano has direct contact with an IMU for Pitch and Roll info. The User1 tick box is handy for stepping through sequences.

PLX-DAQ Messaging

The download includes a good help file which explains the protocol. Here we see how a simple change to a print string can make a difference to the display appeal.

  Serial.print ("CELL,SET,"); 
  Serial.write (excol);             //byte value ASCII D
  Serial.print (PLXrow);            //integer value 20
  Serial.print (",");
  Serial.print (PLXduty);           //integer value 81
  Serial.println (",");

This sets the value 81 into cell D20 to display HR Duty P.

  Serial.print ("MSG, 100 tiltR ");   
  Serial.print (tiltR); 
  Serial.print ("  tiltP ");   
  Serial.print (tiltP); 
  Serial.println (","); 

This might write 100 tiltR -0.2  tiltP 16 into the diagnostic message line.

PLX-DAQ GET

A bit trickier here because the protocol is asynchronous and without message numbering or acknowledgement. We send a request then must wait patiently for a response. I include a timeout and then move on if it fails to arrive.

  Serial.print ("CELL,GET,");     
  Serial.write (excol);
  Serial.print (PLXrow); 
  Serial.println (",");             //send request for cell value
.
.
.
.
  if (Serial.available() > 1)
  setpoint = Serial.parseInt();     //parse reply


I have found PLX-DAQ an invaluable tool and highly recommend it.

AmandaG

  • Member
  • ****
  • A
  • Posts: 3
Re: PLX-DAQ
« Reply #1 on: August 06, 2019, 01:58:42 PM »
Diagnostic help when coding is often achieved using the console print facility of the microprocessor. However, when there is a lot of data, the resulting torrent washing over the screen soon becomes meaningless.

A free download from Parallax Inc provides a link into Excel which shares the same USB port for the console. Either the IDE or PLX-DAQ can be connected, but not both together.

Why Use This?

My ongoing project to make a quadruped walk has nearly been abandoned more than once. Not being able to see exactly what is going on inside a complex distributed system makes progress very usps tracking difficult.So I took some time out to write routines to create better tools for the job in hand. This extra work has helped regain focus on the main issues. It shows what can be done, but it is surely well over the top for most needs.

sheet.jpg
*sheet.jpg (202.47 kB . 798x459 - viewed 147 times)

Each slave Nano holds information about the four motors under its control. The master runs a background task to enquire about one set at a time so as not to interfere with normal working. With a cycle time of 15mS this means all the display areas are updated every two seconds or so.

So facing the bot we see information for the Heel, Knee, Pitch and Roll/Rotate motors in each leg. On the screen left centre are the Input angles written into the slaves and at the top are the achieved Deg angles as measured by the servo pots. Excel is set to colour any differences of more than 2 degs.

Bottom left we see the Max permitted PWM values written into the slaves. Duty shows the PWM moving average values measured over one second. Motors are driven at twice the nominal voltage so these checks are important. Again Excel is set up here to colour any value over 80.

Entering 16 angles to test one posture can be time consuming. PLX-DAQ also allows for values to be taken from the spread sheet and sent on. The green boxes are for such use and can be used, or not, with switches in the master software. Best to disconnect whilst making changes to a number of fields.

To the right we have more green boxes for Calibrating the total build of the bot. This allows the position of each motor spline to be aligned with the limb as required. Ref shows the slave register value which will eventually be transferred to the slave default startup code.

Top right are values for IK experiments. Each slave can calculate the angles (Input) given IKx and IKy in mm. Ikw controls the Roll/Rotate motors.

Lastly there are two spare blocks of display; best to code these up front as adding sections later is a pain. Each foot switch FSw shows ground contact and is useful in determining terrain and construction inaccuracies.

The master Nano has direct contact with an IMU for Pitch and Roll info. The User1 tick box is handy for stepping through sequences.

PLX-DAQ Messaging

The download includes a good help file which explains the protocol. Here we see how a simple change to a print string can make a difference to the display appeal.

  Serial.print ("CELL,SET,"); 
  Serial.write (excol);             //byte value ASCII D
  Serial.print (PLXrow);            //integer value 20
  Serial.print (",");
  Serial.print (PLXduty);           //integer value 81
  Serial.println (",");

This sets the value 81 into cell D20 to display HR Duty P.

  Serial.print ("MSG, 100 tiltR ");   
  Serial.print (tiltR); 
  Serial.print ("  tiltP ");   
  Serial.print (tiltP); 
  Serial.println (","); 

This might write 100 tiltR -0.2  tiltP 16 into the diagnostic message line.

PLX-DAQ GET

A bit trickier here because the protocol is asynchronous and without message numbering or acknowledgement. We send a request then must wait patiently for a response. I include a timeout and then move on if it fails to arrive.

  Serial.print ("CELL,GET,");     
  Serial.write (excol);
  Serial.print (PLXrow); 
  Serial.println (",");             //send request for cell value
.
.
.
.
  if (Serial.available() > 1)
  setpoint = Serial.parseInt();     //parse reply


I have found PLX-DAQ an invaluable tool and highly recommend it.

You are a gem here. Thanks again for all the help.

Regards,
Amanda
« Last Edit: August 15, 2019, 02:33:08 PM by AmandaG »

 

* Search


* Recent Topics

"1984 Nixie Time" by Gareth
[August 22, 2019, 05:59:29 AM]


Just wanted to say Hi. by ErwinCanto
[August 18, 2019, 10:11:28 PM]


SDR (Software Defined Radio) by Gareth
[August 14, 2019, 01:12:21 PM]


It may be dangerous to work in the virtual realm by fritsl
[August 09, 2019, 09:52:05 AM]


PLX-DAQ by AmandaG
[August 06, 2019, 01:58:42 PM]


DIY Yellow Servo by AmandaG
[August 06, 2019, 01:08:09 PM]


Comp? :o by Impala
[August 02, 2019, 07:32:20 PM]


Website to do list by Killer Angel
[August 02, 2019, 05:38:30 AM]


I Like the new front page! by James
[July 31, 2019, 12:29:53 AM]


Pictures on the front page! by tinhead
[July 30, 2019, 05:17:20 AM]


4x5 Macro Keypad by James
[July 28, 2019, 08:30:41 PM]


My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
[July 08, 2019, 04:01:58 AM]


Coding a Nano i2c Slave by AmandaG
[June 11, 2019, 02:48:03 PM]


repetierHost 2.1.6 not working? by MEgg
[June 09, 2019, 03:11:34 PM]


Servo Calibrator by Bajdi
[May 24, 2019, 04:01:10 AM]

* Recent Posts

Re: "1984 Nixie Time" - Update 20190822 by Gareth
[August 22, 2019, 05:59:29 AM]


Re: "1984 Nixie Time" - Update by Gareth
[August 20, 2019, 11:15:36 AM]


Re: "1984 Nixie Time" by Bajdi
[August 20, 2019, 09:35:39 AM]


Just wanted to say Hi. by ErwinCanto
[August 18, 2019, 10:11:28 PM]


Re: "1984 Nixie Time" by viswesh
[August 18, 2019, 01:48:07 AM]


Re: "1984 Nixie Time" by James
[August 16, 2019, 06:37:11 AM]


"1984 Nixie Time" by Gareth
[August 15, 2019, 06:16:37 AM]


Re: SDR (Software Defined Radio) by Gareth
[August 14, 2019, 01:12:21 PM]


Re: SDR (Software Defined Radio) by fritsl
[August 09, 2019, 09:54:11 AM]


It may be dangerous to work in the virtual realm by fritsl
[August 09, 2019, 09:52:05 AM]


Re: PLX-DAQ by AmandaG
[August 06, 2019, 01:58:42 PM]


Re: DIY Yellow Servo by AmandaG
[August 06, 2019, 01:08:09 PM]


SDR (Software Defined Radio) by Gareth
[August 06, 2019, 11:12:09 AM]


Comp? :o by Impala
[August 02, 2019, 07:32:20 PM]


Re: Website to do list by Killer Angel
[August 02, 2019, 05:38:30 AM]