collapse

Author Topic: PLX-DAQ  (Read 1752 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 184 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 184 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

2D Side Scroller Cyberpunk themed by Killer Angel
[November 12, 2019, 07:56:15 AM]


The unnamed (yet) quatruped spider project by tinhead
[November 09, 2019, 05:58:16 AM]


Ebot SL by erco
[October 31, 2019, 04:27:36 PM]


Discord anyone? by tinhead
[October 20, 2019, 05:35:59 AM]


MKS Gen L 1.0 by lllloydo
[October 06, 2019, 01:24:26 AM]


Saturn pics anyone by viswesh
[September 28, 2019, 11:55:53 PM]


Hello Robot Rebels by Passixs
[September 15, 2019, 10:19:10 PM]


All Ya'll. And me. by James
[September 09, 2019, 10:35:19 PM]


MSD - Motorized solder dispenser (Work in progress) by James
[September 09, 2019, 08:45:29 PM]


It may be dangerous to work in the virtual realm by ZeroMax
[September 05, 2019, 05:55:16 PM]


"1984 Nixie Time" by Gareth
[August 25, 2019, 12:21:58 PM]


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]


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


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

* Recent Posts

Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[November 12, 2019, 07:56:15 AM]


Re: The unnamed (yet) quatruped spider project by tinhead
[November 09, 2019, 05:58:16 AM]


Re: The unnamed (yet) quatruped spider project by Nemesis
[November 09, 2019, 03:29:02 AM]


Re: Ebot SL by erco
[October 31, 2019, 04:27:36 PM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 31, 2019, 09:57:48 AM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 31, 2019, 06:01:53 AM]


Re: 2D Side Scroller Cyberpunk themed by maelh
[October 30, 2019, 03:06:28 AM]


Discord anyone? by tinhead
[October 20, 2019, 05:35:59 AM]


The unnamed (yet) quatruped spider project by tinhead
[October 20, 2019, 05:28:14 AM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 17, 2019, 09:44:06 AM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 17, 2019, 08:16:11 AM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 14, 2019, 08:52:20 AM]


2D Side Scroller Cyberpunk themed by Killer Angel
[October 14, 2019, 03:32:40 AM]


Re: MKS Gen L 1.0 by lllloydo
[October 06, 2019, 01:24:26 AM]


Re: Saturn pics anyone by viswesh
[September 28, 2019, 11:55:53 PM]